From 00c87518042b269101079ad63f6fbea2fadd84ab Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 8 Jul 2021 13:17:40 +0200 Subject: [PATCH 001/101] Wrap catalog filters in accordion for smaller screens Signed-off-by: Philipp Hugenroth --- .../CatalogFilter/CatalogFilter.tsx | 76 +++++++++++++++++++ .../src/components/CatalogFilter/index.ts | 17 +++++ .../components/CatalogPage/CatalogPage.tsx | 64 ++++++---------- 3 files changed, 117 insertions(+), 40 deletions(-) create mode 100644 plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx create mode 100644 plugins/catalog/src/components/CatalogFilter/index.ts diff --git a/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx b/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx new file mode 100644 index 0000000000..a8673b395a --- /dev/null +++ b/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx @@ -0,0 +1,76 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + EntityKindPicker, + EntityLifecyclePicker, + EntityOwnerPicker, + EntityTagPicker, + EntityTypePicker, + UserListFilterKind, + UserListPicker, +} from '@backstage/plugin-catalog-react'; +import { + Accordion, + AccordionDetails, + AccordionSummary, + Grid, + isWidthDown, + Typography, + withWidth, +} from '@material-ui/core'; +import { Breakpoint } from '@material-ui/core/styles/createBreakpoints'; +import ExpandMore from '@material-ui/icons/ExpandMore'; +import React, { PropsWithChildren } from 'react'; + +interface IProps { + initiallySelectedFilter?: UserListFilterKind; +} + +const CatalogFilterWrapper = withWidth()( + ({ width, children }: PropsWithChildren<{ width: Breakpoint }>) => + isWidthDown('md', width) ? ( + + }> + Filters + + {children} + + ) : ( + {children} + ), +); + +export const CatalogFilter = ({ + initiallySelectedFilter = 'owned', +}: IProps) => ( + + + + + + + + + + + + + + +); diff --git a/plugins/catalog/src/components/CatalogFilter/index.ts b/plugins/catalog/src/components/CatalogFilter/index.ts new file mode 100644 index 0000000000..dc57ef02e2 --- /dev/null +++ b/plugins/catalog/src/components/CatalogFilter/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { CatalogFilter } from './CatalogFilter'; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 089e61f0fb..6f8dd0dd2b 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -15,16 +15,10 @@ */ import React from 'react'; -import { Grid } from '@material-ui/core'; +import { Grid, withWidth } from '@material-ui/core'; import { - EntityKindPicker, - EntityLifecyclePicker, EntityListProvider, - EntityOwnerPicker, - EntityTagPicker, - EntityTypePicker, UserListFilterKind, - UserListPicker, } from '@backstage/plugin-catalog-react'; import { CatalogTable } from '../CatalogTable'; @@ -38,6 +32,7 @@ import { TableColumn, TableProps, } from '@backstage/core-components'; +import { CatalogFilter } from '../CatalogFilter'; export type CatalogPageProps = { initiallySelectedFilter?: UserListFilterKind; @@ -45,40 +40,29 @@ export type CatalogPageProps = { actions?: TableProps['actions']; }; -export const CatalogPage = ({ - initiallySelectedFilter = 'owned', - columns, - actions, -}: CatalogPageProps) => ( - - - - - All your software catalog entities - - - - - - - - - - + + + ); + }, ); From 4fe222ff389841655682ea5e4e050751d95b2139 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 8 Jul 2021 13:37:00 +0200 Subject: [PATCH 002/101] Add changeset Signed-off-by: Philipp Hugenroth --- .changeset/fuzzy-wolves-travel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fuzzy-wolves-travel.md diff --git a/.changeset/fuzzy-wolves-travel.md b/.changeset/fuzzy-wolves-travel.md new file mode 100644 index 0000000000..6b51be64c0 --- /dev/null +++ b/.changeset/fuzzy-wolves-travel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Move filter to CatalogFilter component & wrap them in an accordion on smaller screens to improve the UX From 9eaabc365509451a89227589c63cbb2e6c0d05ef Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 8 Jul 2021 13:54:27 +0200 Subject: [PATCH 003/101] Remove unused theme HOC Signed-off-by: Philipp Hugenroth --- .../components/CatalogPage/CatalogPage.tsx | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 6f8dd0dd2b..a97116dd80 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { Grid, withWidth } from '@material-ui/core'; +import { Grid } from '@material-ui/core'; import { EntityListProvider, UserListFilterKind, @@ -40,29 +40,31 @@ export type CatalogPageProps = { actions?: TableProps['actions']; }; -export const CatalogPage = withWidth()( - ({ columns, actions, initiallySelectedFilter }: CatalogPageProps) => { - return ( - - - - - All your software catalog entities - - - - - - - - - - - - - - ); - }, -); +export const CatalogPage = ({ + columns, + actions, + initiallySelectedFilter, +}: CatalogPageProps) => { + return ( + + + + + All your software catalog entities + + + + + + + + + + + + + + ); +}; From 713949231f33689b4cddfaeb2afaf294f0897815 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Fri, 9 Jul 2021 11:51:19 +0200 Subject: [PATCH 004/101] Fix tests to support window.matchMedia & add tests for responsiveness Signed-off-by: Philipp Hugenroth --- .../src/testUtils/mockBreakpoint.ts | 34 ++++++++++---- .../CatalogPage/CatalogPage.test.tsx | 9 ++++ .../components/CatalogPage/CatalogPage.tsx | 46 +++++++++---------- 3 files changed, 55 insertions(+), 34 deletions(-) diff --git a/packages/test-utils/src/testUtils/mockBreakpoint.ts b/packages/test-utils/src/testUtils/mockBreakpoint.ts index 37f0e761b6..0e04f58f70 100644 --- a/packages/test-utils/src/testUtils/mockBreakpoint.ts +++ b/packages/test-utils/src/testUtils/mockBreakpoint.ts @@ -18,6 +18,8 @@ import { act } from '@testing-library/react'; type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; +const defaultBreakpoint: Breakpoint = 'xl'; + const queryToBreakpoint = { '(min-width:1920px)': 'xl', '(min-width:1280px)': 'lg', @@ -26,14 +28,17 @@ const queryToBreakpoint = { '(min-width:0px)': 'xs', } as Record; -function toBreakpoint(query: string) { - const breakpoint = queryToBreakpoint[query]; - if (!breakpoint) { - throw new Error( - `received unknown media query in breakpoint mock: '${query}'`, - ); - } - return breakpoint; +/** + * Converts media query string to Breakpoint. + * Chooses the default breakpoint if no breakpoint is set in the media query. + * + * @param query media query string + * @returns Breakpoint + */ +function toBreakpoint(query: string): Breakpoint { + return queryToBreakpoint[query] + ? queryToBreakpoint[query] + : defaultBreakpoint; } type Listener = (event: { matches: boolean }) => void; @@ -41,6 +46,8 @@ type Listener = (event: { matches: boolean }) => void; interface QueryList { addListener(listener: Listener): void; removeListener(listener: Listener): void; + addEventListener(listener: Listener): void; + removeEventListener(listener: Listener): void; matches: boolean; } @@ -50,12 +57,15 @@ interface Query { listeners: Set; } -export default function mockBreakpoint(initialBreakpoint: Breakpoint = 'xl') { +export default function mockBreakpoint( + initialBreakpoint: Breakpoint = defaultBreakpoint, +) { let currentBreakpoint = initialBreakpoint; const queries = Array(); const previousMatchMedia: any = (window as any).matchMedia; + // https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom (window as any).matchMedia = (query: string): QueryList => { const listeners = new Set(); @@ -66,6 +76,12 @@ export default function mockBreakpoint(initialBreakpoint: Breakpoint = 'xl') { removeListener(listener) { listeners.delete(listener); }, + addEventListener(listener) { + listeners.add(listener); + }, + removeEventListener(listener) { + listeners.delete(listener); + }, matches: toBreakpoint(query) === currentBreakpoint, }; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index 584eea0850..d5e31a16a7 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -26,6 +26,7 @@ import { MockStorageApi, renderWithEffects, wrapInTestApp, + mockBreakpoint, } from '@backstage/test-utils'; import { fireEvent, screen } from '@testing-library/react'; import React from 'react'; @@ -111,6 +112,8 @@ describe('CatalogPage', () => { getProfile: () => testProfile, }; + const { set: setBreakpoint } = mockBreakpoint(); + const renderWrapped = (children: React.ReactNode) => renderWithEffects( wrapInTestApp( @@ -244,4 +247,10 @@ describe('CatalogPage', () => { screen.findByText(/Starred \(1\)/), ).resolves.toBeInTheDocument(); }); + + it('should wrap filter in accordion on smaller screens', async () => { + setBreakpoint('sm'); + const { findByText } = await renderWrapped(); + await expect(findByText(/Filters/)).resolves.toBeInTheDocument(); + }); }); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index a97116dd80..9eeb91ca3c 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -43,28 +43,24 @@ export type CatalogPageProps = { export const CatalogPage = ({ columns, actions, - initiallySelectedFilter, -}: CatalogPageProps) => { - return ( - - - - - All your software catalog entities - - - - - - - - - - - - - - ); -}; + initiallySelectedFilter = 'owned', +}: CatalogPageProps) => ( + + + + + All your software catalog entities + + + + + + + + + + + + + +); From 84feb21147018aa37d2e0a6105216fd2fa11c10f Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 8 Jul 2021 13:17:40 +0200 Subject: [PATCH 005/101] Wrap catalog filters in accordion for smaller screens Signed-off-by: Philipp Hugenroth --- .../CatalogFilter/CatalogFilter.tsx | 76 +++++++++++++++++++ .../src/components/CatalogFilter/index.ts | 17 +++++ .../components/CatalogPage/CatalogPage.tsx | 64 ++++++---------- 3 files changed, 117 insertions(+), 40 deletions(-) create mode 100644 plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx create mode 100644 plugins/catalog/src/components/CatalogFilter/index.ts diff --git a/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx b/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx new file mode 100644 index 0000000000..a8673b395a --- /dev/null +++ b/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx @@ -0,0 +1,76 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + EntityKindPicker, + EntityLifecyclePicker, + EntityOwnerPicker, + EntityTagPicker, + EntityTypePicker, + UserListFilterKind, + UserListPicker, +} from '@backstage/plugin-catalog-react'; +import { + Accordion, + AccordionDetails, + AccordionSummary, + Grid, + isWidthDown, + Typography, + withWidth, +} from '@material-ui/core'; +import { Breakpoint } from '@material-ui/core/styles/createBreakpoints'; +import ExpandMore from '@material-ui/icons/ExpandMore'; +import React, { PropsWithChildren } from 'react'; + +interface IProps { + initiallySelectedFilter?: UserListFilterKind; +} + +const CatalogFilterWrapper = withWidth()( + ({ width, children }: PropsWithChildren<{ width: Breakpoint }>) => + isWidthDown('md', width) ? ( + + }> + Filters + + {children} + + ) : ( + {children} + ), +); + +export const CatalogFilter = ({ + initiallySelectedFilter = 'owned', +}: IProps) => ( + + + + + + + + + + + + + + +); diff --git a/plugins/catalog/src/components/CatalogFilter/index.ts b/plugins/catalog/src/components/CatalogFilter/index.ts new file mode 100644 index 0000000000..dc57ef02e2 --- /dev/null +++ b/plugins/catalog/src/components/CatalogFilter/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { CatalogFilter } from './CatalogFilter'; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 089e61f0fb..6f8dd0dd2b 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -15,16 +15,10 @@ */ import React from 'react'; -import { Grid } from '@material-ui/core'; +import { Grid, withWidth } from '@material-ui/core'; import { - EntityKindPicker, - EntityLifecyclePicker, EntityListProvider, - EntityOwnerPicker, - EntityTagPicker, - EntityTypePicker, UserListFilterKind, - UserListPicker, } from '@backstage/plugin-catalog-react'; import { CatalogTable } from '../CatalogTable'; @@ -38,6 +32,7 @@ import { TableColumn, TableProps, } from '@backstage/core-components'; +import { CatalogFilter } from '../CatalogFilter'; export type CatalogPageProps = { initiallySelectedFilter?: UserListFilterKind; @@ -45,40 +40,29 @@ export type CatalogPageProps = { actions?: TableProps['actions']; }; -export const CatalogPage = ({ - initiallySelectedFilter = 'owned', - columns, - actions, -}: CatalogPageProps) => ( - - - - - All your software catalog entities - - - - - - - - - - + + + ); + }, ); From e50d7bf9ac62bbb6944ba76ab29523266eb2bc58 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 8 Jul 2021 13:37:00 +0200 Subject: [PATCH 006/101] Add changeset Signed-off-by: Philipp Hugenroth --- .changeset/fuzzy-wolves-travel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fuzzy-wolves-travel.md diff --git a/.changeset/fuzzy-wolves-travel.md b/.changeset/fuzzy-wolves-travel.md new file mode 100644 index 0000000000..6b51be64c0 --- /dev/null +++ b/.changeset/fuzzy-wolves-travel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Move filter to CatalogFilter component & wrap them in an accordion on smaller screens to improve the UX From 9cf8779ddafdf465e0857c725c118f2f82941ee5 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 8 Jul 2021 13:54:27 +0200 Subject: [PATCH 007/101] Remove unused theme HOC Signed-off-by: Philipp Hugenroth --- .../components/CatalogPage/CatalogPage.tsx | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 6f8dd0dd2b..a97116dd80 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { Grid, withWidth } from '@material-ui/core'; +import { Grid } from '@material-ui/core'; import { EntityListProvider, UserListFilterKind, @@ -40,29 +40,31 @@ export type CatalogPageProps = { actions?: TableProps['actions']; }; -export const CatalogPage = withWidth()( - ({ columns, actions, initiallySelectedFilter }: CatalogPageProps) => { - return ( - - - - - All your software catalog entities - - - - - - - - - - - - - - ); - }, -); +export const CatalogPage = ({ + columns, + actions, + initiallySelectedFilter, +}: CatalogPageProps) => { + return ( + + + + + All your software catalog entities + + + + + + + + + + + + + + ); +}; From db935a4c102d1e629c98c387ca1cf9879561be7b Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Fri, 9 Jul 2021 11:51:19 +0200 Subject: [PATCH 008/101] Fix tests to support window.matchMedia & add tests for responsiveness Signed-off-by: Philipp Hugenroth --- .../src/testUtils/mockBreakpoint.ts | 34 ++++++++++---- .../CatalogPage/CatalogPage.test.tsx | 9 ++++ .../components/CatalogPage/CatalogPage.tsx | 46 +++++++++---------- 3 files changed, 55 insertions(+), 34 deletions(-) diff --git a/packages/test-utils/src/testUtils/mockBreakpoint.ts b/packages/test-utils/src/testUtils/mockBreakpoint.ts index 37f0e761b6..0e04f58f70 100644 --- a/packages/test-utils/src/testUtils/mockBreakpoint.ts +++ b/packages/test-utils/src/testUtils/mockBreakpoint.ts @@ -18,6 +18,8 @@ import { act } from '@testing-library/react'; type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; +const defaultBreakpoint: Breakpoint = 'xl'; + const queryToBreakpoint = { '(min-width:1920px)': 'xl', '(min-width:1280px)': 'lg', @@ -26,14 +28,17 @@ const queryToBreakpoint = { '(min-width:0px)': 'xs', } as Record; -function toBreakpoint(query: string) { - const breakpoint = queryToBreakpoint[query]; - if (!breakpoint) { - throw new Error( - `received unknown media query in breakpoint mock: '${query}'`, - ); - } - return breakpoint; +/** + * Converts media query string to Breakpoint. + * Chooses the default breakpoint if no breakpoint is set in the media query. + * + * @param query media query string + * @returns Breakpoint + */ +function toBreakpoint(query: string): Breakpoint { + return queryToBreakpoint[query] + ? queryToBreakpoint[query] + : defaultBreakpoint; } type Listener = (event: { matches: boolean }) => void; @@ -41,6 +46,8 @@ type Listener = (event: { matches: boolean }) => void; interface QueryList { addListener(listener: Listener): void; removeListener(listener: Listener): void; + addEventListener(listener: Listener): void; + removeEventListener(listener: Listener): void; matches: boolean; } @@ -50,12 +57,15 @@ interface Query { listeners: Set; } -export default function mockBreakpoint(initialBreakpoint: Breakpoint = 'xl') { +export default function mockBreakpoint( + initialBreakpoint: Breakpoint = defaultBreakpoint, +) { let currentBreakpoint = initialBreakpoint; const queries = Array(); const previousMatchMedia: any = (window as any).matchMedia; + // https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom (window as any).matchMedia = (query: string): QueryList => { const listeners = new Set(); @@ -66,6 +76,12 @@ export default function mockBreakpoint(initialBreakpoint: Breakpoint = 'xl') { removeListener(listener) { listeners.delete(listener); }, + addEventListener(listener) { + listeners.add(listener); + }, + removeEventListener(listener) { + listeners.delete(listener); + }, matches: toBreakpoint(query) === currentBreakpoint, }; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index 584eea0850..d5e31a16a7 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -26,6 +26,7 @@ import { MockStorageApi, renderWithEffects, wrapInTestApp, + mockBreakpoint, } from '@backstage/test-utils'; import { fireEvent, screen } from '@testing-library/react'; import React from 'react'; @@ -111,6 +112,8 @@ describe('CatalogPage', () => { getProfile: () => testProfile, }; + const { set: setBreakpoint } = mockBreakpoint(); + const renderWrapped = (children: React.ReactNode) => renderWithEffects( wrapInTestApp( @@ -244,4 +247,10 @@ describe('CatalogPage', () => { screen.findByText(/Starred \(1\)/), ).resolves.toBeInTheDocument(); }); + + it('should wrap filter in accordion on smaller screens', async () => { + setBreakpoint('sm'); + const { findByText } = await renderWrapped(); + await expect(findByText(/Filters/)).resolves.toBeInTheDocument(); + }); }); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index a97116dd80..9eeb91ca3c 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -43,28 +43,24 @@ export type CatalogPageProps = { export const CatalogPage = ({ columns, actions, - initiallySelectedFilter, -}: CatalogPageProps) => { - return ( - - - - - All your software catalog entities - - - - - - - - - - - - - - ); -}; + initiallySelectedFilter = 'owned', +}: CatalogPageProps) => ( + + + + + All your software catalog entities + + + + + + + + + + + + + +); From 2a295bcec92f465900c48d95be06b10029570842 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 12 Jul 2021 14:41:30 +0200 Subject: [PATCH 009/101] Add TablePage components - Change CatalogPage to use generic TablePage Signed-off-by: Philipp Hugenroth --- .../src/layout/Header/Header.tsx | 2 +- .../src/layout/TablePage/Layout.tsx | 37 ++++------ .../src/layout/TablePage/TablePage.tsx | 68 +++++++++++++++++++ .../src/layout/TablePage}/index.ts | 5 +- packages/core-components/src/layout/index.ts | 1 + .../components/CatalogPage/CatalogPage.tsx | 57 ++++++++-------- .../src/components/CatalogPage/index.ts | 1 - .../CreateComponentButton.tsx | 38 ----------- 8 files changed, 115 insertions(+), 94 deletions(-) rename plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx => packages/core-components/src/layout/TablePage/Layout.tsx (52%) create mode 100644 packages/core-components/src/layout/TablePage/TablePage.tsx rename {plugins/catalog/src/components/CreateComponentButton => packages/core-components/src/layout/TablePage}/index.ts (84%) delete mode 100644 plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx diff --git a/packages/core-components/src/layout/Header/Header.tsx b/packages/core-components/src/layout/Header/Header.tsx index 96d024f524..8c51f2f7fc 100644 --- a/packages/core-components/src/layout/Header/Header.tsx +++ b/packages/core-components/src/layout/Header/Header.tsx @@ -88,7 +88,7 @@ const useStyles = makeStyles(theme => ({ type HeaderStyles = ReturnType; -type Props = { +export type Props = { component?: ReactNode; pageTitleOverride?: string; style?: CSSProperties; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx b/packages/core-components/src/layout/TablePage/Layout.tsx similarity index 52% rename from plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx rename to packages/core-components/src/layout/TablePage/Layout.tsx index 2471ac9df2..79ad9c24b8 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx +++ b/packages/core-components/src/layout/TablePage/Layout.tsx @@ -16,27 +16,20 @@ import React from 'react'; -import { configApiRef, useApi } from '@backstage/core-plugin-api'; -import { Header, Page } from '@backstage/core-components'; +import { Header, Page } from '../../'; +import { Props as HeaderProps } from '../../layout/Header/Header'; -type Props = { - children?: React.ReactNode; -}; +export interface IProps extends HeaderProps { + themeId: string; +} -export const CatalogLayout = ({ children }: Props) => { - const orgName = - useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; - - return ( - -
- {children} - - ); -}; - -export default CatalogLayout; +export const Layout = ({ + themeId, + children, + ...props +}: React.PropsWithChildren) => ( + +
+ {children} + +); diff --git a/packages/core-components/src/layout/TablePage/TablePage.tsx b/packages/core-components/src/layout/TablePage/TablePage.tsx new file mode 100644 index 0000000000..f58da0b553 --- /dev/null +++ b/packages/core-components/src/layout/TablePage/TablePage.tsx @@ -0,0 +1,68 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react'; +import { Grid } from '@material-ui/core'; + +import { Content, ContentHeader, SupportButton, Button } from '../..'; +import { Layout, IProps as LayoutProps } from './Layout'; +import { Link as RouterLink } from 'react-router-dom'; + +interface IProps extends LayoutProps { + supportMessage: string; + filter: React.ReactNode; + header: string; + headerLink?: string; +} + +const TablePageLink = ({ link }: { link?: string }) => { + return link ? ( + + ) : null; +}; + +export const TablePage = ({ + supportMessage, + filter, + children, + header, + headerLink, + ...props +}: React.PropsWithChildren) => ( + + + + + {supportMessage} + + + + {filter} + + + {children} + + + + +); diff --git a/plugins/catalog/src/components/CreateComponentButton/index.ts b/packages/core-components/src/layout/TablePage/index.ts similarity index 84% rename from plugins/catalog/src/components/CreateComponentButton/index.ts rename to packages/core-components/src/layout/TablePage/index.ts index e525bef782..5df8aa4c40 100644 --- a/plugins/catalog/src/components/CreateComponentButton/index.ts +++ b/packages/core-components/src/layout/TablePage/index.ts @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Backstage Authors + * Copyright 2020 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { CreateComponentButton } from './CreateComponentButton'; + +export { TablePage } from './TablePage'; diff --git a/packages/core-components/src/layout/index.ts b/packages/core-components/src/layout/index.ts index 4abde642dc..dce33c7f2a 100644 --- a/packages/core-components/src/layout/index.ts +++ b/packages/core-components/src/layout/index.ts @@ -29,3 +29,4 @@ export * from './Sidebar'; export * from './SignInPage'; export * from './TabbedCard'; export * from './Breadcrumbs'; +export * from './TablePage'; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 9eeb91ca3c..bd23e5ccdb 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -15,24 +15,17 @@ */ import React from 'react'; -import { Grid } from '@material-ui/core'; import { EntityListProvider, UserListFilterKind, } from '@backstage/plugin-catalog-react'; import { CatalogTable } from '../CatalogTable'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; import { EntityRow } from '../CatalogTable/types'; -import CatalogLayout from './CatalogLayout'; -import { CreateComponentButton } from '../CreateComponentButton'; -import { - Content, - ContentHeader, - SupportButton, - TableColumn, - TableProps, -} from '@backstage/core-components'; +import { TableColumn, TableProps, TablePage } from '@backstage/core-components'; import { CatalogFilter } from '../CatalogFilter'; +import { createComponentRouteRef } from '../../routes'; export type CatalogPageProps = { initiallySelectedFilter?: UserListFilterKind; @@ -44,23 +37,27 @@ export const CatalogPage = ({ columns, actions, initiallySelectedFilter = 'owned', -}: CatalogPageProps) => ( - - - - - All your software catalog entities - - - - - - - - - - - - - -); +}: CatalogPageProps) => { + const orgName = + useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; + const createComponentLink = useRouteRef(createComponentRouteRef); + + return ( + + + } + title={`${orgName} Catalog`} + subtitle={`Catalog of software components at ${orgName}`} + themeId="home" + pageTitleOverride="Home" + headerLink={createComponentLink ? createComponentLink() : ''} + > + + + + ); +}; diff --git a/plugins/catalog/src/components/CatalogPage/index.ts b/plugins/catalog/src/components/CatalogPage/index.ts index 66c3c2f4b3..dc7ed68229 100644 --- a/plugins/catalog/src/components/CatalogPage/index.ts +++ b/plugins/catalog/src/components/CatalogPage/index.ts @@ -13,5 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { CatalogLayout } from './CatalogLayout'; export { CatalogPage } from './CatalogPage'; diff --git a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx deleted file mode 100644 index 482a0c0a3c..0000000000 --- a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2021 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import { Link as RouterLink } from 'react-router-dom'; -import { Button } from '@material-ui/core'; -import { createComponentRouteRef } from '../../routes'; -import { useRouteRef } from '@backstage/core-plugin-api'; - -export const CreateComponentButton = () => { - const createComponentLink = useRouteRef(createComponentRouteRef); - - if (!createComponentLink) return null; - - return ( - - ); -}; From 48ec80da3ac8caec10b8529fd579610fb3cb6880 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 12 Jul 2021 17:27:44 +0200 Subject: [PATCH 010/101] Apply generic table page to ApiExplorer Signed-off-by: Philipp Hugenroth --- .../src/layout/TablePage/TablePage.tsx | 35 ++++--- .../ApiExplorerPage/ApiExplorerLayout.tsx | 40 -------- .../ApiExplorerPage/ApiExplorerPage.tsx | 94 +++++++------------ .../CatalogFilter/CatalogFilter.tsx | 4 +- .../components/CatalogPage/CatalogPage.tsx | 13 +-- plugins/catalog/src/index.ts | 3 +- 6 files changed, 68 insertions(+), 121 deletions(-) delete mode 100644 plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx diff --git a/packages/core-components/src/layout/TablePage/TablePage.tsx b/packages/core-components/src/layout/TablePage/TablePage.tsx index f58da0b553..5bf69f4e64 100644 --- a/packages/core-components/src/layout/TablePage/TablePage.tsx +++ b/packages/core-components/src/layout/TablePage/TablePage.tsx @@ -21,22 +21,27 @@ import { Content, ContentHeader, SupportButton, Button } from '../..'; import { Layout, IProps as LayoutProps } from './Layout'; import { Link as RouterLink } from 'react-router-dom'; -interface IProps extends LayoutProps { - supportMessage: string; - filter: React.ReactNode; - header: string; - headerLink?: string; +interface ILinkProps { + contentLink?: string; + contentLinkText?: string; } -const TablePageLink = ({ link }: { link?: string }) => { - return link ? ( +type IProps = LayoutProps & + ILinkProps & { + contentTitle: string; + supportMessage: string; + filter: React.ReactNode; + }; + +const TablePageLink = ({ contentLink, contentLinkText }: ILinkProps) => { + return contentLink && contentLinkText ? ( ) : null; }; @@ -45,14 +50,18 @@ export const TablePage = ({ supportMessage, filter, children, - header, - headerLink, + contentTitle, + contentLink, + contentLinkText, ...props }: React.PropsWithChildren) => ( - - + + {supportMessage} diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx deleted file mode 100644 index 5638c23634..0000000000 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; - -import { Header, Page } from '@backstage/core-components'; -import { useApi, configApiRef } from '@backstage/core-plugin-api'; - -type Props = { - children?: React.ReactNode; -}; -export const ApiExplorerLayout = ({ children }: Props) => { - const configApi = useApi(configApiRef); - const generatedSubtitle = `${ - configApi.getOptionalString('organization.name') ?? 'Backstage' - } API Explorer`; - return ( - -
- {children} - - ); -}; diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx index 9a8b725ffc..bcc18e4021 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx @@ -14,39 +14,19 @@ * limitations under the License. */ +import { TableColumn, TablePage } from '@backstage/core-components'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; +import { + CatalogFilter, + CatalogTable, + CatalogTableRow, +} from '@backstage/plugin-catalog'; import { - EntityKindPicker, - EntityLifecyclePicker, EntityListProvider, - EntityOwnerPicker, - EntityTagPicker, - EntityTypePicker, UserListFilterKind, - UserListPicker, } from '@backstage/plugin-catalog-react'; -import { CatalogTable, CatalogTableRow } from '@backstage/plugin-catalog'; -import { Button, makeStyles } from '@material-ui/core'; import React from 'react'; -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', - gridTemplateAreas: "'filters' 'table'", - gridTemplateColumns: '250px 1fr', - gridColumnGap: theme.spacing(2), - }, -})); const defaultColumns: TableColumn[] = [ CatalogTable.columns.createNameColumn({ defaultKind: 'API' }), @@ -58,8 +38,11 @@ const defaultColumns: TableColumn[] = [ CatalogTable.columns.createTagsColumn(), ]; -export type ApiExplorerPageProps = { +interface IApiExplorerePageFilterProps { initiallySelectedFilter?: UserListFilterKind; +} + +export type ApiExplorerPageProps = IApiExplorerePageFilterProps & { columns?: TableColumn[]; }; @@ -67,39 +50,32 @@ export const ApiExplorerPage = ({ initiallySelectedFilter = 'all', columns, }: ApiExplorerPageProps) => { - const styles = useStyles(); const createComponentLink = useRouteRef(createComponentRouteRef); + const configApi = useApi(configApiRef); + const generatedSubtitle = `${ + configApi.getOptionalString('organization.name') ?? 'Backstage' + } API Explorer`; return ( - - - - {createComponentLink && ( - - )} - All your APIs - -
- -
-
- -
-
-
-
+ + + } + > + + + ); }; diff --git a/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx b/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx index a8673b395a..6704f429ee 100644 --- a/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx +++ b/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx @@ -38,6 +38,7 @@ import React, { PropsWithChildren } from 'react'; interface IProps { initiallySelectedFilter?: UserListFilterKind; + initialFilter?: 'component' | 'api'; } const CatalogFilterWrapper = withWidth()( @@ -56,11 +57,12 @@ const CatalogFilterWrapper = withWidth()( export const CatalogFilter = ({ initiallySelectedFilter = 'owned', + initialFilter = 'component', }: IProps) => ( - diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index bd23e5ccdb..702d9f2ed3 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -45,16 +45,17 @@ export const CatalogPage = ({ return ( } - title={`${orgName} Catalog`} - subtitle={`Catalog of software components at ${orgName}`} - themeId="home" - pageTitleOverride="Home" - headerLink={createComponentLink ? createComponentLink() : ''} > diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index f2f28679a5..7c8d7ac122 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -15,11 +15,9 @@ */ export * from './components/AboutCard'; -export { CatalogLayout } from './components/CatalogPage'; export { CatalogResultListItem } from './components/CatalogResultListItem'; export { CatalogTable } from './components/CatalogTable'; export type { EntityRow as CatalogTableRow } from './components/CatalogTable'; -export { CreateComponentButton } from './components/CreateComponentButton'; export { EntityLayout } from './components/EntityLayout'; export * from './components/EntityOrphanWarning'; export { EntityPageLayout } from './components/EntityPageLayout'; @@ -42,3 +40,4 @@ export { EntitySystemDiagramCard, } from './plugin'; export * from './components/CatalogTable/columns'; +export * from './components/CatalogFilter'; From 45b5fc3a83ef6fd4b87422d09ab9e1aba2865a4f Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 12 Jul 2021 17:57:37 +0200 Subject: [PATCH 011/101] Add changeset for combined PR Signed-off-by: Philipp Hugenroth --- .changeset/fuzzy-wolves-travel.md | 5 ----- .changeset/green-lies-hammer.md | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) delete mode 100644 .changeset/fuzzy-wolves-travel.md create mode 100644 .changeset/green-lies-hammer.md diff --git a/.changeset/fuzzy-wolves-travel.md b/.changeset/fuzzy-wolves-travel.md deleted file mode 100644 index 6b51be64c0..0000000000 --- a/.changeset/fuzzy-wolves-travel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog': patch ---- - -Move filter to CatalogFilter component & wrap them in an accordion on smaller screens to improve the UX diff --git a/.changeset/green-lies-hammer.md b/.changeset/green-lies-hammer.md new file mode 100644 index 0000000000..bf0a9a3995 --- /dev/null +++ b/.changeset/green-lies-hammer.md @@ -0,0 +1,8 @@ +--- +'@backstage/core-components': patch +'@backstage/test-utils': patch +'@backstage/plugin-api-docs': patch +'@backstage/plugin-catalog': patch +--- + +Build a general TablePage component to enforce a more responsive layout for the Catalog & API page. Filters are now wrapped in an accordion on smaller screens, enabling the user to see & interact better with the table. Additionally, a test was added, to check that the responsive wrapping is working for the Catalog page. From 2934eb3a5036e25505ab7f220fba86b66ee27af9 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Tue, 13 Jul 2021 20:33:33 +0200 Subject: [PATCH 012/101] [DRAFT] Drawer Filters Signed-off-by: Philipp Hugenroth --- .../layout/ContentHeader/ContentHeader.tsx | 6 +- .../src/layout/ContentHeader/index.ts | 2 +- .../Layout.tsx => Page/PageWithHeader.tsx} | 2 +- .../core-components/src/layout/Page/index.ts | 1 + .../src/layout/TablePage/TablePage.tsx | 77 ----------- packages/core-components/src/layout/index.ts | 1 - .../ApiExplorerPage/ApiExplorerPage.tsx | 61 +-------- .../components/CatalogPage/CatalogPage.tsx | 120 ++++++++++++++---- .../CreateComponentButton.tsx | 38 ++++++ .../CreateComponentButton/indext.ts | 17 +++ .../FilterContainer/FilterContainer.tsx | 57 +++++++++ .../src/components/FilterContainer}/index.ts | 4 +- .../FilteredTableLayout.tsx | 30 +++++ .../components/FilteredTableLayout/index.ts | 17 +++ 14 files changed, 269 insertions(+), 164 deletions(-) rename packages/core-components/src/layout/{TablePage/Layout.tsx => Page/PageWithHeader.tsx} (96%) delete mode 100644 packages/core-components/src/layout/TablePage/TablePage.tsx create mode 100644 plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx create mode 100644 plugins/catalog/src/components/CreateComponentButton/indext.ts create mode 100644 plugins/catalog/src/components/FilterContainer/FilterContainer.tsx rename {packages/core-components/src/layout/TablePage => plugins/catalog/src/components/FilterContainer}/index.ts (85%) create mode 100644 plugins/catalog/src/components/FilteredTableLayout/FilteredTableLayout.tsx create mode 100644 plugins/catalog/src/components/FilteredTableLayout/index.ts diff --git a/packages/core-components/src/layout/ContentHeader/ContentHeader.tsx b/packages/core-components/src/layout/ContentHeader/ContentHeader.tsx index 1e2ad0b5d4..5c773770be 100644 --- a/packages/core-components/src/layout/ContentHeader/ContentHeader.tsx +++ b/packages/core-components/src/layout/ContentHeader/ContentHeader.tsx @@ -59,10 +59,10 @@ const useStyles = (props: ContentHeaderProps) => type DefaultTitleProps = { title?: string; - className: string; + className?: string; }; -const DefaultTitle = ({ +export const ContentHeaderTitle = ({ title = 'Unknown page', className, }: DefaultTitleProps) => ( @@ -95,7 +95,7 @@ export const ContentHeader = ({ const renderedTitle = TitleComponent ? ( ) : ( - + ); return ( diff --git a/packages/core-components/src/layout/ContentHeader/index.ts b/packages/core-components/src/layout/ContentHeader/index.ts index 537a2b6ed9..1a4aacd305 100644 --- a/packages/core-components/src/layout/ContentHeader/index.ts +++ b/packages/core-components/src/layout/ContentHeader/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { ContentHeader } from './ContentHeader'; +export { ContentHeader, ContentHeaderTitle } from './ContentHeader'; diff --git a/packages/core-components/src/layout/TablePage/Layout.tsx b/packages/core-components/src/layout/Page/PageWithHeader.tsx similarity index 96% rename from packages/core-components/src/layout/TablePage/Layout.tsx rename to packages/core-components/src/layout/Page/PageWithHeader.tsx index 79ad9c24b8..e20788e2e2 100644 --- a/packages/core-components/src/layout/TablePage/Layout.tsx +++ b/packages/core-components/src/layout/Page/PageWithHeader.tsx @@ -23,7 +23,7 @@ export interface IProps extends HeaderProps { themeId: string; } -export const Layout = ({ +export const PageWithHeader = ({ themeId, children, ...props diff --git a/packages/core-components/src/layout/Page/index.ts b/packages/core-components/src/layout/Page/index.ts index d2523e8467..91db73657e 100644 --- a/packages/core-components/src/layout/Page/index.ts +++ b/packages/core-components/src/layout/Page/index.ts @@ -15,3 +15,4 @@ */ export { Page } from './Page'; +export { PageWithHeader } from './PageWithHeader'; diff --git a/packages/core-components/src/layout/TablePage/TablePage.tsx b/packages/core-components/src/layout/TablePage/TablePage.tsx deleted file mode 100644 index 5bf69f4e64..0000000000 --- a/packages/core-components/src/layout/TablePage/TablePage.tsx +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import { Grid } from '@material-ui/core'; - -import { Content, ContentHeader, SupportButton, Button } from '../..'; -import { Layout, IProps as LayoutProps } from './Layout'; -import { Link as RouterLink } from 'react-router-dom'; - -interface ILinkProps { - contentLink?: string; - contentLinkText?: string; -} - -type IProps = LayoutProps & - ILinkProps & { - contentTitle: string; - supportMessage: string; - filter: React.ReactNode; - }; - -const TablePageLink = ({ contentLink, contentLinkText }: ILinkProps) => { - return contentLink && contentLinkText ? ( - - ) : null; -}; - -export const TablePage = ({ - supportMessage, - filter, - children, - contentTitle, - contentLink, - contentLinkText, - ...props -}: React.PropsWithChildren) => ( - - - - - {supportMessage} - - - - {filter} - - - {children} - - - - -); diff --git a/packages/core-components/src/layout/index.ts b/packages/core-components/src/layout/index.ts index dce33c7f2a..4abde642dc 100644 --- a/packages/core-components/src/layout/index.ts +++ b/packages/core-components/src/layout/index.ts @@ -29,4 +29,3 @@ export * from './Sidebar'; export * from './SignInPage'; export * from './TabbedCard'; export * from './Breadcrumbs'; -export * from './TablePage'; diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx index bcc18e4021..32fab2c1ec 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx @@ -14,29 +14,10 @@ * limitations under the License. */ -import { TableColumn, TablePage } from '@backstage/core-components'; -import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; -import { - CatalogFilter, - CatalogTable, - CatalogTableRow, -} from '@backstage/plugin-catalog'; -import { - EntityListProvider, - UserListFilterKind, -} from '@backstage/plugin-catalog-react'; +import { TableColumn } from '@backstage/core-components'; +import { CatalogTableRow } from '@backstage/plugin-catalog'; +import { UserListFilterKind } from '@backstage/plugin-catalog-react'; import React from 'react'; -import { createComponentRouteRef } from '../../routes'; - -const defaultColumns: TableColumn[] = [ - CatalogTable.columns.createNameColumn({ defaultKind: 'API' }), - CatalogTable.columns.createSystemColumn(), - CatalogTable.columns.createOwnerColumn(), - CatalogTable.columns.createSpecTypeColumn(), - CatalogTable.columns.createSpecLifecycleColumn(), - CatalogTable.columns.createMetadataDescriptionColumn(), - CatalogTable.columns.createTagsColumn(), -]; interface IApiExplorerePageFilterProps { initiallySelectedFilter?: UserListFilterKind; @@ -46,36 +27,6 @@ export type ApiExplorerPageProps = IApiExplorerePageFilterProps & { columns?: TableColumn[]; }; -export const ApiExplorerPage = ({ - initiallySelectedFilter = 'all', - columns, -}: ApiExplorerPageProps) => { - const createComponentLink = useRouteRef(createComponentRouteRef); - const configApi = useApi(configApiRef); - const generatedSubtitle = `${ - configApi.getOptionalString('organization.name') ?? 'Backstage' - } API Explorer`; - - return ( - - - } - > - - - - ); -}; +export const ApiExplorerPage = ({}: ApiExplorerPageProps) => ( +
Please revert me...
+); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 702d9f2ed3..50fb2433df 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -14,18 +14,35 @@ * limitations under the License. */ -import React from 'react'; import { + Content, + ContentHeader, + ContentHeaderTitle, + PageWithHeader, + SupportButton, + TableColumn, + TableProps, +} from '@backstage/core-components'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; +import { + EntityKindPicker, + EntityLifecyclePicker, EntityListProvider, + EntityOwnerPicker, + EntityTagPicker, + EntityTypePicker, UserListFilterKind, + UserListPicker, } from '@backstage/plugin-catalog-react'; +import { BackstageTheme } from '@backstage/theme'; +import { Box, Grid, IconButton, useMediaQuery } from '@material-ui/core'; +import FilterListIcon from '@material-ui/icons/FilterList'; +import React, { useState } from 'react'; import { CatalogTable } from '../CatalogTable'; -import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; - import { EntityRow } from '../CatalogTable/types'; -import { TableColumn, TableProps, TablePage } from '@backstage/core-components'; -import { CatalogFilter } from '../CatalogFilter'; -import { createComponentRouteRef } from '../../routes'; +import { CreateComponentButton } from '../CreateComponentButton/CreateComponentButton'; +import { FilterContainer } from '../FilterContainer'; +import { FilteredTableLayout } from '../FilteredTableLayout'; export type CatalogPageProps = { initiallySelectedFilter?: UserListFilterKind; @@ -33,32 +50,87 @@ export type CatalogPageProps = { actions?: TableProps['actions']; }; +const CatalogPageHeaderAction = ({ + showFilter, + toggleFilter, + isMidSizeScreen, +}: { + showFilter: boolean; + toggleFilter: (showFilter: boolean) => void; + isMidSizeScreen: boolean; +}) => + isMidSizeScreen ? ( + + + toggleFilter(!showFilter)}> + + + + ) : ( + + ); + +const CatalogPageHeader = ({ + children, + ...props +}: React.PropsWithChildren<{ + showFilter: boolean; + toggleFilter: (showFilter: boolean) => void; + isMidSizeScreen: boolean; +}>) => { + return ( + } + > + {children} + + ); +}; + export const CatalogPage = ({ columns, actions, initiallySelectedFilter = 'owned', }: CatalogPageProps) => { + const [showFilter, toggleFilter] = useState(false); + const isMidSizeScreen = useMediaQuery(theme => + theme.breakpoints.down('md'), + ); + const orgName = useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; - const createComponentLink = useRouteRef(createComponentRouteRef); return ( - - - } - > - - - + + + + + All your software catalog entities + + + + + + + + + + + + ); }; diff --git a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx new file mode 100644 index 0000000000..482a0c0a3c --- /dev/null +++ b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx @@ -0,0 +1,38 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react'; +import { Link as RouterLink } from 'react-router-dom'; +import { Button } from '@material-ui/core'; +import { createComponentRouteRef } from '../../routes'; +import { useRouteRef } from '@backstage/core-plugin-api'; + +export const CreateComponentButton = () => { + const createComponentLink = useRouteRef(createComponentRouteRef); + + if (!createComponentLink) return null; + + return ( + + ); +}; diff --git a/plugins/catalog/src/components/CreateComponentButton/indext.ts b/plugins/catalog/src/components/CreateComponentButton/indext.ts new file mode 100644 index 0000000000..edf59d18a6 --- /dev/null +++ b/plugins/catalog/src/components/CreateComponentButton/indext.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { CreateComponentButton } from './CreateComponentButton'; diff --git a/plugins/catalog/src/components/FilterContainer/FilterContainer.tsx b/plugins/catalog/src/components/FilterContainer/FilterContainer.tsx new file mode 100644 index 0000000000..4083062478 --- /dev/null +++ b/plugins/catalog/src/components/FilterContainer/FilterContainer.tsx @@ -0,0 +1,57 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Box, Drawer, Grid } from '@material-ui/core'; +import React from 'react'; + +interface IProps { + showFilter: boolean; + toggleFilter: (showFilter: boolean) => void; + isMidSizeScreen: boolean; +} + +export const FilterContainer = ({ + children, + showFilter, + toggleFilter, + isMidSizeScreen, +}: React.PropsWithChildren) => + isMidSizeScreen ? ( + { + toggleFilter(false); + }} + elevation={0} + disableAutoFocus + PaperProps={{ + style: { position: 'absolute', width: '250px' }, + }} + BackdropProps={{ style: { position: 'absolute' } }} + ModalProps={{ + container: document.getElementById('drawer-container'), + disableEnforceFocus: true, + style: { position: 'absolute' }, + }} + variant="temporary" + > + {children} + + ) : ( + + {children} + + ); diff --git a/packages/core-components/src/layout/TablePage/index.ts b/plugins/catalog/src/components/FilterContainer/index.ts similarity index 85% rename from packages/core-components/src/layout/TablePage/index.ts rename to plugins/catalog/src/components/FilterContainer/index.ts index 5df8aa4c40..a25071e3c5 100644 --- a/packages/core-components/src/layout/TablePage/index.ts +++ b/plugins/catalog/src/components/FilterContainer/index.ts @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,4 +14,4 @@ * limitations under the License. */ -export { TablePage } from './TablePage'; +export { FilterContainer } from './FilterContainer'; diff --git a/plugins/catalog/src/components/FilteredTableLayout/FilteredTableLayout.tsx b/plugins/catalog/src/components/FilteredTableLayout/FilteredTableLayout.tsx new file mode 100644 index 0000000000..a0debe618f --- /dev/null +++ b/plugins/catalog/src/components/FilteredTableLayout/FilteredTableLayout.tsx @@ -0,0 +1,30 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react'; +import { Grid } from '@material-ui/core'; + +interface IProps {} + +export const FilteredTableLayout = ({ + children, +}: React.PropsWithChildren) => { + return ( + + {children} + + ); +}; diff --git a/plugins/catalog/src/components/FilteredTableLayout/index.ts b/plugins/catalog/src/components/FilteredTableLayout/index.ts new file mode 100644 index 0000000000..77d49a773a --- /dev/null +++ b/plugins/catalog/src/components/FilteredTableLayout/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { FilteredTableLayout } from './FilteredTableLayout'; From f3b58ecd8ea57df25ccae137672e47bebdf38d1c Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Wed, 14 Jul 2021 11:10:08 +0200 Subject: [PATCH 013/101] Reorganize Drawer & move drawer state to EntityListProvider Signed-off-by: Philipp Hugenroth --- .../src/hooks/useEntityListProvider.tsx | 7 ++ .../components/CatalogPage/CatalogPage.tsx | 79 ++++--------------- .../CatalogPage/CatalogPageHeader.tsx | 50 ++++++++++++ .../CreateComponentButton.tsx | 4 +- .../FilterContainer.tsx | 40 ++++------ .../TableContainer.tsx} | 9 ++- .../components/FilteredTableLayout/index.ts | 2 + 7 files changed, 97 insertions(+), 94 deletions(-) create mode 100644 plugins/catalog/src/components/CatalogPage/CatalogPageHeader.tsx rename plugins/catalog/src/components/{FilterContainer => FilteredTableLayout}/FilterContainer.tsx (53%) rename plugins/catalog/src/components/{FilterContainer/index.ts => FilteredTableLayout/TableContainer.tsx} (74%) diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index 8ca3efd243..7db2205deb 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -84,6 +84,9 @@ export type EntityListContextProps< */ queryParameters: Partial>; + showFiltersDrawer: boolean; + toggleFiltersDrawer: (showFiltersDrawer: boolean) => void; + loading: boolean; error?: Error; }; @@ -108,6 +111,8 @@ export const EntityListProvider = ({ const [requestedFilters, setRequestedFilters] = useState( {} as EntityFilters, ); + // Show + const [showFiltersDrawer, toggleFiltersDrawer] = useState(false); const [outputState, setOutputState] = useState>({ appliedFilters: {} as EntityFilters, entities: [], @@ -203,6 +208,8 @@ export const EntityListProvider = ({ updateFilters, queryParameters: outputState.queryParameters, loading, + showFiltersDrawer, + toggleFiltersDrawer, error, }} > diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 50fb2433df..3df46ff0c0 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -16,8 +16,6 @@ import { Content, - ContentHeader, - ContentHeaderTitle, PageWithHeader, SupportButton, TableColumn, @@ -34,15 +32,16 @@ import { UserListFilterKind, UserListPicker, } from '@backstage/plugin-catalog-react'; -import { BackstageTheme } from '@backstage/theme'; -import { Box, Grid, IconButton, useMediaQuery } from '@material-ui/core'; -import FilterListIcon from '@material-ui/icons/FilterList'; -import React, { useState } from 'react'; +import React from 'react'; import { CatalogTable } from '../CatalogTable'; import { EntityRow } from '../CatalogTable/types'; import { CreateComponentButton } from '../CreateComponentButton/CreateComponentButton'; -import { FilterContainer } from '../FilterContainer'; -import { FilteredTableLayout } from '../FilteredTableLayout'; +import { + FilteredTableLayout, + TableContainer, + FilterContainer, +} from '../FilteredTableLayout'; +import { CatalogPageHeader } from './CatalogPageHeader'; export type CatalogPageProps = { initiallySelectedFilter?: UserListFilterKind; @@ -50,74 +49,24 @@ export type CatalogPageProps = { actions?: TableProps['actions']; }; -const CatalogPageHeaderAction = ({ - showFilter, - toggleFilter, - isMidSizeScreen, -}: { - showFilter: boolean; - toggleFilter: (showFilter: boolean) => void; - isMidSizeScreen: boolean; -}) => - isMidSizeScreen ? ( - - - toggleFilter(!showFilter)}> - - - - ) : ( - - ); - -const CatalogPageHeader = ({ - children, - ...props -}: React.PropsWithChildren<{ - showFilter: boolean; - toggleFilter: (showFilter: boolean) => void; - isMidSizeScreen: boolean; -}>) => { - return ( - } - > - {children} - - ); -}; - export const CatalogPage = ({ columns, actions, initiallySelectedFilter = 'owned', }: CatalogPageProps) => { - const [showFilter, toggleFilter] = useState(false); - const isMidSizeScreen = useMediaQuery(theme => - theme.breakpoints.down('md'), - ); - const orgName = useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; return ( - - - All your software catalog entities - + + + All your software catalog entities + - + - + - + diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPageHeader.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPageHeader.tsx new file mode 100644 index 0000000000..f628aef596 --- /dev/null +++ b/plugins/catalog/src/components/CatalogPage/CatalogPageHeader.tsx @@ -0,0 +1,50 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ContentHeader, ContentHeaderTitle } from '@backstage/core-components'; +import { useEntityListProvider } from '@backstage/plugin-catalog-react'; +import { BackstageTheme } from '@backstage/theme'; +import { Box, IconButton, useMediaQuery } from '@material-ui/core'; +import FilterListIcon from '@material-ui/icons/FilterList'; +import React from 'react'; + +const CatalogPageHeaderAction = () => { + const isMidSizeScreen = useMediaQuery(theme => + theme.breakpoints.down('md'), + ); + const { showFiltersDrawer, toggleFiltersDrawer } = useEntityListProvider(); + + return isMidSizeScreen ? ( + + + toggleFiltersDrawer(!showFiltersDrawer)}> + + + + ) : ( + + ); +}; + +export const CatalogPageHeader = ({ + children, +}: React.PropsWithChildren<{}>) => { + return ( + }> + {children} + + ); +}; diff --git a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx index 482a0c0a3c..4be93c1aa0 100644 --- a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx +++ b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx @@ -23,9 +23,7 @@ import { useRouteRef } from '@backstage/core-plugin-api'; export const CreateComponentButton = () => { const createComponentLink = useRouteRef(createComponentRouteRef); - if (!createComponentLink) return null; - - return ( + return !createComponentLink ? null : ( ( diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 3df46ff0c0..5da46eec97 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -16,6 +16,7 @@ import { Content, + ContentHeader, PageWithHeader, SupportButton, TableColumn, @@ -41,7 +42,6 @@ import { TableContainer, FilterContainer, } from '../FilteredTableLayout'; -import { CatalogPageHeader } from './CatalogPageHeader'; export type CatalogPageProps = { initiallySelectedFilter?: UserListFilterKind; @@ -60,11 +60,11 @@ export const CatalogPage = ({ return ( + + + All your software catalog entities + - - - All your software catalog entities -
); diff --git a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx index 1534656f24..c7adf23204 100644 --- a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx +++ b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx @@ -14,13 +14,12 @@ * limitations under the License. */ -import { Link, makeStyles, Typography } from '@material-ui/core'; +import { Link, makeStyles, Typography, Grid } from '@material-ui/core'; import React from 'react'; const useStyles = makeStyles(theme => ({ root: { textAlign: 'left', - margin: theme.spacing(2), display: 'inline-block', }, label: { @@ -64,9 +63,11 @@ export const HeaderLabel = ({ label, value, url }: HeaderLabelProps) => { /> ); return ( - - {label} - {url ? {content} : content} - + + + {label} + {url ? {content} : content} + + ); }; From 5b0b5baa5e0b20596d8083197a00bbd605340d28 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Wed, 14 Jul 2021 18:52:03 +0200 Subject: [PATCH 019/101] Fix Grid in EntityPage for smaller screens Signed-off-by: Philipp Hugenroth --- .../app/src/components/catalog/EntityPage.tsx | 30 ++++++++++++------- .../src/components/EmptyState/EmptyState.tsx | 20 +++++++------ .../components/EmptyState/EmptyStateImage.tsx | 2 +- plugins/api-docs/README.md | 16 +++++----- 4 files changed, 40 insertions(+), 28 deletions(-) diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index 16107a6cc0..7965561516 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -135,6 +135,12 @@ const EntityLayoutWrapper = (props: { children?: ReactNode }) => { ); }; +/** + * TODO: For the MUI Grid to work there have to be "xs" set on every GridItem, + * such that the seperation of space is clear from the smalles screen size upwards + * https://material-ui.com/components/grid/#basic-grid. + */ + export const cicdContent = ( @@ -292,10 +298,10 @@ const serviceEntityPage = ( - + - + @@ -303,10 +309,10 @@ const serviceEntityPage = ( - + - + @@ -431,15 +437,17 @@ const apiPage = ( - + - - - - - - + + + + + + + + diff --git a/packages/core-components/src/components/EmptyState/EmptyState.tsx b/packages/core-components/src/components/EmptyState/EmptyState.tsx index 1d8d5a798f..5d55c5da93 100644 --- a/packages/core-components/src/components/EmptyState/EmptyState.tsx +++ b/packages/core-components/src/components/EmptyState/EmptyState.tsx @@ -49,15 +49,17 @@ export const EmptyState = ({ title, description, missing, action }: Props) => { className={classes.root} spacing={2} > - - - {title} - - - {description} - - - {action} + + + + {title} + + + {description} + + + {action} + diff --git a/packages/core-components/src/components/EmptyState/EmptyStateImage.tsx b/packages/core-components/src/components/EmptyState/EmptyStateImage.tsx index a76f0863f7..660e7fc947 100644 --- a/packages/core-components/src/components/EmptyState/EmptyStateImage.tsx +++ b/packages/core-components/src/components/EmptyState/EmptyStateImage.tsx @@ -29,7 +29,7 @@ const useStyles = makeStyles({ generalImg: { width: '95%', zIndex: 2, - position: 'absolute', + position: 'relative', left: '50%', top: '50%', transform: 'translate(-50%, 15%)', diff --git a/plugins/api-docs/README.md b/plugins/api-docs/README.md index 60d8986d9b..d5ed198dc1 100644 --- a/plugins/api-docs/README.md +++ b/plugins/api-docs/README.md @@ -59,15 +59,17 @@ const apiPage = ( - + - - - - - - + + + + + + + + From e35b13afa9e0c9a7a8865df769cc9086b84a31ba Mon Sep 17 00:00:00 2001 From: Dominik Henneke Date: Tue, 13 Jul 2021 17:17:46 +0200 Subject: [PATCH 020/101] Handle error responses in `getTechDocsMetadata` and `getEntityMetadata` such that `` doesn't throw errors. Signed-off-by: Dominik Henneke --- .changeset/techdocs-young-gorillas-share.md | 5 +++++ plugins/techdocs/src/client.ts | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 .changeset/techdocs-young-gorillas-share.md diff --git a/.changeset/techdocs-young-gorillas-share.md b/.changeset/techdocs-young-gorillas-share.md new file mode 100644 index 0000000000..6b1d3f03da --- /dev/null +++ b/.changeset/techdocs-young-gorillas-share.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Handle error responses in `getTechDocsMetadata` and `getEntityMetadata` such that `` doesn't throw errors. diff --git a/plugins/techdocs/src/client.ts b/plugins/techdocs/src/client.ts index afbf4b74a0..f867ce4011 100644 --- a/plugins/techdocs/src/client.ts +++ b/plugins/techdocs/src/client.ts @@ -17,7 +17,7 @@ import { EntityName } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; -import { NotFoundError } from '@backstage/errors'; +import { NotFoundError, ResponseError } from '@backstage/errors'; import EventSource from 'eventsource'; import { SyncResult, TechDocsApi, TechDocsStorageApi } from './api'; import { TechDocsEntityMetadata, TechDocsMetadata } from './types'; @@ -72,9 +72,12 @@ export class TechDocsClient implements TechDocsApi { const request = await fetch(`${requestUrl}`, { headers: token ? { Authorization: `Bearer ${token}` } : {}, }); - const res = await request.json(); - return res; + if (!request.ok) { + throw await ResponseError.fromResponse(request); + } + + return await request.json(); } /** @@ -97,9 +100,12 @@ export class TechDocsClient implements TechDocsApi { const request = await fetch(`${requestUrl}`, { headers: token ? { Authorization: `Bearer ${token}` } : {}, }); - const res = await request.json(); - return res; + if (!request.ok) { + throw await ResponseError.fromResponse(request); + } + + return await request.json(); } } From 9ed3d401c8f04e42e536150ef84c67e7f266662d Mon Sep 17 00:00:00 2001 From: Dominik Henneke Date: Tue, 13 Jul 2021 17:21:27 +0200 Subject: [PATCH 021/101] Refactor `` to not use `AsyncState` as inputs Signed-off-by: Dominik Henneke --- plugins/techdocs/api-report.md | 2 +- .../src/reader/components/TechDocsPage.tsx | 10 ++-- .../components/TechDocsPageHeader.test.tsx | 55 ++++++------------- .../reader/components/TechDocsPageHeader.tsx | 37 ++++--------- plugins/techdocs/src/types.ts | 6 +- 5 files changed, 39 insertions(+), 71 deletions(-) diff --git a/plugins/techdocs/api-report.md b/plugins/techdocs/api-report.md index d63303c134..10e338c89a 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -13,7 +13,7 @@ import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { EntityName } from '@backstage/catalog-model'; import { IdentityApi } from '@backstage/core-plugin-api'; -import { Location as Location_2 } from '@backstage/catalog-model'; +import { LocationSpec } from '@backstage/catalog-model'; import { RouteRef } from '@backstage/core-plugin-api'; // Warning: (ae-missing-release-tag) "DocsCardGrid" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.tsx index 88c53a38a7..19092f47c3 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.tsx @@ -30,7 +30,7 @@ export const TechDocsPage = () => { const techdocsApi = useApi(techdocsApiRef); - const techdocsMetadataRequest = useAsync(() => { + const { value: techdocsMetadataValue } = useAsync(() => { if (documentReady) { return techdocsApi.getTechDocsMetadata({ kind, namespace, name }); } @@ -38,7 +38,7 @@ export const TechDocsPage = () => { return Promise.resolve(undefined); }, [kind, namespace, name, techdocsApi, documentReady]); - const entityMetadataRequest = useAsync(() => { + const { value: entityMetadataValue } = useAsync(() => { return techdocsApi.getEntityMetadata({ kind, namespace, name }); }, [kind, namespace, name, techdocsApi]); @@ -49,10 +49,8 @@ export const TechDocsPage = () => { return ( ', () => { name: 'test-name', namespace: 'test-namespace', }} - metadataRequest={{ - entity: { - loading: false, - value: { - locationMetadata: { - type: 'github', - target: 'https://example.com/', - }, - spec: { - owner: 'test', - }, - }, + entityMetadata={{ + locationMetadata: { + type: 'github', + target: 'https://example.com/', }, - techdocs: { - loading: false, - value: { - site_name: 'test-site-name', - site_description: 'test-site-desc', - }, + apiVersion: 'v1', + kind: 'Component', + metadata: { + name: 'test', }, + spec: { + owner: 'test', + }, + }} + techDocsMetadata={{ + site_name: 'test-site-name', + site_description: 'test-site-desc', }} />, { @@ -75,14 +72,6 @@ describe('', () => { name: 'test-name', namespace: 'test-namespace', }} - metadataRequest={{ - entity: { - loading: false, - }, - techdocs: { - loading: false, - }, - }} />, { mountedRoutes: { @@ -105,17 +94,9 @@ describe('', () => { name: 'test-name', namespace: 'test-namespace', }} - metadataRequest={{ - entity: { - loading: false, - }, - techdocs: { - loading: false, - value: { - site_name: 'test-site-name', - site_description: 'test-site-desc', - }, - }, + techDocsMetadata={{ + site_name: 'test-site-name', + site_description: 'test-site-desc', }} />, { diff --git a/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx b/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx index 38e122e9cb..34d564bdfe 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPageHeader.tsx @@ -15,6 +15,8 @@ */ import { EntityName, RELATION_OWNED_BY } from '@backstage/catalog-model'; +import { Header, HeaderLabel } from '@backstage/core-components'; +import { useRouteRef } from '@backstage/core-plugin-api'; import { EntityRefLink, EntityRefLinks, @@ -22,45 +24,30 @@ import { } from '@backstage/plugin-catalog-react'; import CodeIcon from '@material-ui/icons/Code'; import React from 'react'; -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'; +import { TechDocsEntityMetadata, TechDocsMetadata } from '../../types'; type TechDocsPageHeaderProps = { entityId: EntityName; - metadataRequest: { - entity: AsyncState; - techdocs: AsyncState; - }; + entityMetadata?: TechDocsEntityMetadata; + techDocsMetadata?: TechDocsMetadata; }; export const TechDocsPageHeader = ({ entityId, - metadataRequest, + entityMetadata, + techDocsMetadata, }: TechDocsPageHeaderProps) => { - const { - techdocs: techdocsMetadata, - entity: entityMetadata, - } = metadataRequest; - - const { value: techdocsMetadataValues } = techdocsMetadata; - const { value: entityMetadataValues } = entityMetadata; - const { name } = entityId; const { site_name: siteName, site_description: siteDescription } = - techdocsMetadataValues || {}; + techDocsMetadata || {}; - const { - locationMetadata, - spec: { lifecycle }, - } = entityMetadataValues || { spec: {} }; + const { locationMetadata, spec } = entityMetadata || {}; + const lifecycle = spec?.lifecycle; - const ownedByRelations = entityMetadataValues - ? getEntityRelations(entityMetadataValues, RELATION_OWNED_BY) + const ownedByRelations = entityMetadata + ? getEntityRelations(entityMetadata, RELATION_OWNED_BY) : []; const docsRootLink = useRouteRef(rootRouteRef)(); diff --git a/plugins/techdocs/src/types.ts b/plugins/techdocs/src/types.ts index f6d849b426..dd35e255b6 100644 --- a/plugins/techdocs/src/types.ts +++ b/plugins/techdocs/src/types.ts @@ -14,11 +14,13 @@ * limitations under the License. */ -import { Entity, Location } from '@backstage/catalog-model'; +import { Entity, LocationSpec } from '@backstage/catalog-model'; export type TechDocsMetadata = { site_name: string; site_description: string; }; -export type TechDocsEntityMetadata = Entity & { locationMetadata?: Location }; +export type TechDocsEntityMetadata = Entity & { + locationMetadata?: LocationSpec; +}; From 417cee84722e6d35904e6370a1b17fe3ddb0f799 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 7 Jul 2021 13:53:17 +0200 Subject: [PATCH 022/101] chore: added sample cookiecutter module Signed-off-by: blam --- .../.eslintrc.js | 3 ++ .../README.md | 13 +++++ .../package.json | 41 +++++++++++++++ .../src/index.ts | 17 ++++++ .../src/run.ts | 33 ++++++++++++ .../src/service/router.test.ts | 45 ++++++++++++++++ .../src/service/router.ts | 40 ++++++++++++++ .../src/service/standaloneServer.ts | 52 +++++++++++++++++++ .../src/setupTests.ts | 17 ++++++ 9 files changed, 261 insertions(+) create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/.eslintrc.js create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/README.md create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/package.json create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/src/index.ts create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/src/run.ts create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.test.ts create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.ts create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/src/service/standaloneServer.ts create mode 100644 plugins/scaffolder-backend-module-cookiecutter-backend/src/setupTests.ts diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/.eslintrc.js b/plugins/scaffolder-backend-module-cookiecutter-backend/.eslintrc.js new file mode 100644 index 0000000000..16a033dbc6 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint.backend')], +}; diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/README.md b/plugins/scaffolder-backend-module-cookiecutter-backend/README.md new file mode 100644 index 0000000000..c7a2497cce --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/README.md @@ -0,0 +1,13 @@ +# scaffolder-backend-module-cookiecutter + +Welcome to the scaffolder-backend-module-cookiecutter backend plugin! + +_This plugin was created through the Backstage CLI_ + +## Getting started + +Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/scaffolder-backend-module-cookiecutter](http://localhost:3000/scaffolder-backend-module-cookiecutter). + +You can also serve the plugin in isolation by running `yarn start` in the plugin directory. +This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. +It is only meant for local development, and the setup for it can be found inside the [/dev](/dev) directory. diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/package.json b/plugins/scaffolder-backend-module-cookiecutter-backend/package.json new file mode 100644 index 0000000000..db2f197002 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/package.json @@ -0,0 +1,41 @@ +{ + "name": "plugin-scaffolder-backend-module-cookiecutter", + "version": "0.1.1", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "private": true, + "publishConfig": { + "access": "public", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts" + }, + "scripts": { + "start": "backstage-cli backend:dev", + "build": "backstage-cli backend:build", + "lint": "backstage-cli lint", + "test": "backstage-cli test", + "prepack": "backstage-cli prepack", + "postpack": "backstage-cli postpack", + "clean": "backstage-cli clean" + }, + "dependencies": { + "@backstage/backend-common": "^0.8.4", + "@backstage/config": "^0.1.5", + "@types/express": "^4.17.6", + "express": "^4.17.1", + "express-promise-router": "^4.1.0", + "winston": "^3.2.1", + "cross-fetch": "^3.0.6", + "yn": "^4.0.0" + }, + "devDependencies": { + "@backstage/cli": "^0.7.3", + "@types/supertest": "^2.0.8", + "supertest": "^4.0.2", + "msw": "^0.29.0" + }, + "files": [ + "dist" + ] +} diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/index.ts b/plugins/scaffolder-backend-module-cookiecutter-backend/src/index.ts new file mode 100644 index 0000000000..ca73cb27ba --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/src/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './service/router'; diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/run.ts b/plugins/scaffolder-backend-module-cookiecutter-backend/src/run.ts new file mode 100644 index 0000000000..54d2716290 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/src/run.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { getRootLogger } from '@backstage/backend-common'; +import yn from 'yn'; +import { startStandaloneServer } from './service/standaloneServer'; + +const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7000; +const enableCors = yn(process.env.PLUGIN_CORS, { default: false }); +const logger = getRootLogger(); + +startStandaloneServer({ port, enableCors, logger }).catch(err => { + logger.error(err); + process.exit(1); +}); + +process.on('SIGINT', () => { + logger.info('CTRL+C pressed; exiting.'); + process.exit(0); +}); diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.test.ts b/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.test.ts new file mode 100644 index 0000000000..8b77a04348 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.test.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { getVoidLogger } from '@backstage/backend-common'; +import express from 'express'; +import request from 'supertest'; + +import { createRouter } from './router'; + +describe('createRouter', () => { + let app: express.Express; + + beforeAll(async () => { + const router = await createRouter({ + logger: getVoidLogger(), + }); + app = express().use(router); + }); + + beforeEach(() => { + jest.resetAllMocks(); + }); + + describe('GET /health', () => { + it('returns ok', async () => { + const response = await request(app).get('/health'); + + expect(response.status).toEqual(200); + expect(response.body).toEqual({ status: 'ok' }); + }); + }); +}); diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.ts b/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.ts new file mode 100644 index 0000000000..9ceaa47627 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.ts @@ -0,0 +1,40 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { errorHandler } from '@backstage/backend-common'; +import express from 'express'; +import Router from 'express-promise-router'; +import { Logger } from 'winston'; + +export interface RouterOptions { + logger: Logger; +} + +export async function createRouter( + options: RouterOptions, +): Promise { + const { logger } = options; + + const router = Router(); + router.use(express.json()); + + router.get('/health', (_, response) => { + logger.info('PONG!'); + response.send({ status: 'ok' }); + }); + router.use(errorHandler()); + return router; +} diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/standaloneServer.ts b/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/standaloneServer.ts new file mode 100644 index 0000000000..d35fb1e5ad --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/standaloneServer.ts @@ -0,0 +1,52 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { createServiceBuilder } from '@backstage/backend-common'; +import { Server } from 'http'; +import { Logger } from 'winston'; +import { createRouter } from './router'; + +export interface ServerOptions { + port: number; + enableCors: boolean; + logger: Logger; +} + +export async function startStandaloneServer( + options: ServerOptions, +): Promise { + const logger = options.logger.child({ + service: 'scaffolder-backend-module-cookiecutter-backend', + }); + logger.debug('Starting application server...'); + const router = await createRouter({ + logger, + }); + + let service = createServiceBuilder(module) + .setPort(options.port) + .addRouter('/scaffolder-backend-module-cookiecutter', router); + if (options.enableCors) { + service = service.enableCors({ origin: 'http://localhost:3000' }); + } + + return await service.start().catch(err => { + logger.error(err); + process.exit(1); + }); +} + +module.hot?.accept(); diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/setupTests.ts b/plugins/scaffolder-backend-module-cookiecutter-backend/src/setupTests.ts new file mode 100644 index 0000000000..d3232290a7 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter-backend/src/setupTests.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {}; From 271e13d7238415229ae715c022bbcb0ca1e86c8e Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 7 Jul 2021 15:46:21 +0200 Subject: [PATCH 023/101] chore: move the action to something better Signed-off-by: blam --- .../.eslintrc.js | 0 .../README.md | 0 .../package.json | 0 .../src/index.ts | 0 .../src/run.ts | 0 .../src/service/router.test.ts | 0 .../src/service/router.ts | 0 .../src/service/standaloneServer.ts | 0 .../src/setupTests.ts | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/.eslintrc.js (100%) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/README.md (100%) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/package.json (100%) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/src/index.ts (100%) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/src/run.ts (100%) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/src/service/router.test.ts (100%) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/src/service/router.ts (100%) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/src/service/standaloneServer.ts (100%) rename plugins/{scaffolder-backend-module-cookiecutter-backend => scaffolder-backend-module-cookiecutter}/src/setupTests.ts (100%) diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/.eslintrc.js b/plugins/scaffolder-backend-module-cookiecutter/.eslintrc.js similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/.eslintrc.js rename to plugins/scaffolder-backend-module-cookiecutter/.eslintrc.js diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/README.md b/plugins/scaffolder-backend-module-cookiecutter/README.md similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/README.md rename to plugins/scaffolder-backend-module-cookiecutter/README.md diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/package.json rename to plugins/scaffolder-backend-module-cookiecutter/package.json diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/index.ts b/plugins/scaffolder-backend-module-cookiecutter/src/index.ts similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/src/index.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/index.ts diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/run.ts b/plugins/scaffolder-backend-module-cookiecutter/src/run.ts similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/src/run.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/run.ts diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.test.ts b/plugins/scaffolder-backend-module-cookiecutter/src/service/router.test.ts similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.test.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/service/router.test.ts diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.ts b/plugins/scaffolder-backend-module-cookiecutter/src/service/router.ts similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/src/service/router.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/service/router.ts diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/service/standaloneServer.ts b/plugins/scaffolder-backend-module-cookiecutter/src/service/standaloneServer.ts similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/src/service/standaloneServer.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/service/standaloneServer.ts diff --git a/plugins/scaffolder-backend-module-cookiecutter-backend/src/setupTests.ts b/plugins/scaffolder-backend-module-cookiecutter/src/setupTests.ts similarity index 100% rename from plugins/scaffolder-backend-module-cookiecutter-backend/src/setupTests.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/setupTests.ts From b60091b11768203e6871d2eca2d2e18686440582 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 7 Jul 2021 15:53:15 +0200 Subject: [PATCH 024/101] chore: update some packages Signed-off-by: blam --- plugins/scaffolder-backend-module-cookiecutter/package.json | 1 + plugins/scaffolder-backend-module-rails/package.json | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json index db2f197002..5b8c7d2d95 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/package.json +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@backstage/backend-common": "^0.8.4", + "@backstage/plugin-scaffolder-backend": "^0.12.2", "@backstage/config": "^0.1.5", "@types/express": "^4.17.6", "express": "^4.17.1", diff --git a/plugins/scaffolder-backend-module-rails/package.json b/plugins/scaffolder-backend-module-rails/package.json index 3062136a76..e805473c61 100644 --- a/plugins/scaffolder-backend-module-rails/package.json +++ b/plugins/scaffolder-backend-module-rails/package.json @@ -20,8 +20,13 @@ "clean": "backstage-cli clean" }, "dependencies": { +<<<<<<< HEAD "@backstage/backend-common": "^0.8.6", "@backstage/plugin-scaffolder-backend": "^0.14.0", +======= + "@backstage/backend-common": "^0.8.4", + "@backstage/plugin-scaffolder-backend": "^0.12.2", +>>>>>>> chore: update some packages "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.8", From 4e23d2276c269ce4d4e6cd16ed57c58ec0c45357 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 7 Jul 2021 17:11:09 +0200 Subject: [PATCH 025/101] chore: moved out the cookiecutter action to its own repo Signed-off-by: blam --- .../package.json | 16 +- .../src/actions/fetch/cookiecutter.test.ts | 215 ++++++++++++++++ .../src/actions/fetch/cookiecutter.ts | 242 ++++++++++++++++++ .../{setupTests.ts => actions/fetch/index.ts} | 5 +- .../src/{ => actions}/index.ts | 5 +- .../src/run.ts | 33 --- .../src/service/router.test.ts | 45 ---- .../src/service/router.ts | 40 --- .../src/service/standaloneServer.ts | 52 ---- 9 files changed, 471 insertions(+), 182 deletions(-) create mode 100644 plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.test.ts create mode 100644 plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.ts rename plugins/scaffolder-backend-module-cookiecutter/src/{setupTests.ts => actions/fetch/index.ts} (84%) rename plugins/scaffolder-backend-module-cookiecutter/src/{ => actions}/index.ts (85%) delete mode 100644 plugins/scaffolder-backend-module-cookiecutter/src/run.ts delete mode 100644 plugins/scaffolder-backend-module-cookiecutter/src/service/router.test.ts delete mode 100644 plugins/scaffolder-backend-module-cookiecutter/src/service/router.ts delete mode 100644 plugins/scaffolder-backend-module-cookiecutter/src/service/standaloneServer.ts diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json index 5b8c7d2d95..373b22c5c2 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/package.json +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -1,6 +1,6 @@ { "name": "plugin-scaffolder-backend-module-cookiecutter", - "version": "0.1.1", + "version": "0.1.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,19 +21,23 @@ }, "dependencies": { "@backstage/backend-common": "^0.8.4", + "@backstage/errors": "^0.1.1", + "@backstage/integration": "^0.5.7", "@backstage/plugin-scaffolder-backend": "^0.12.2", "@backstage/config": "^0.1.5", - "@types/express": "^4.17.6", - "express": "^4.17.1", - "express-promise-router": "^4.1.0", + "command-exists": "^1.2.9", + "fs-extra": "^10.0.0", "winston": "^3.2.1", "cross-fetch": "^3.0.6", "yn": "^4.0.0" }, "devDependencies": { "@backstage/cli": "^0.7.3", - "@types/supertest": "^2.0.8", - "supertest": "^4.0.2", + "@types/fs-extra": "^9.0.1", + "@types/mock-fs": "^4.13.0", + "@types/jest": "^26.0.7", + "@types/command-exists": "^1.2.0", + "mock-fs": "^4.13.0", "msw": "^0.29.0" }, "files": [ diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.test.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.test.ts new file mode 100644 index 0000000000..bc3fe3eca2 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.test.ts @@ -0,0 +1,215 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const runCommand = jest.fn(); +const commandExists = jest.fn(); +const fetchContents = jest.fn(); + +jest.mock('@backstage/plugin-scaffolder-backend', () => ({ + ...jest.requireActual('@backstage/plugin-scaffolder-backend'), + fetchContents, + runCommand, +})); +jest.mock('command-exists', () => commandExists); + +import { + getVoidLogger, + UrlReader, + ContainerRunner, +} from '@backstage/backend-common'; +import { ConfigReader, JsonObject } from '@backstage/config'; +import { ScmIntegrations } from '@backstage/integration'; +import mockFs from 'mock-fs'; +import os from 'os'; +import { PassThrough } from 'stream'; +import { createFetchCookiecutterAction } from './cookiecutter'; +import { join } from 'path'; +import type { ActionContext } from '@backstage/plugin-scaffolder-backend'; + +describe('fetch:cookiecutter', () => { + const integrations = ScmIntegrations.fromConfig( + new ConfigReader({ + integrations: { + azure: [ + { host: 'dev.azure.com', token: 'tokenlols' }, + { host: 'myazurehostnotoken.com' }, + ], + }, + }), + ); + + const mockTmpDir = os.tmpdir(); + + let mockContext: ActionContext<{ + url: string; + targetPath?: string; + values: JsonObject; + copyWithoutRender?: string[]; + extensions?: string[]; + imageName?: string; + }>; + + const containerRunner: jest.Mocked = { + runContainer: jest.fn(), + }; + + const mockReader: UrlReader = { + read: jest.fn(), + readTree: jest.fn(), + search: jest.fn(), + }; + + const action = createFetchCookiecutterAction({ + integrations, + containerRunner, + reader: mockReader, + }); + + beforeEach(() => { + jest.resetAllMocks(); + + mockContext = { + input: { + url: 'https://google.com/cookie/cutter', + targetPath: 'something', + values: { + help: 'me', + }, + }, + baseUrl: 'somebase', + workspacePath: mockTmpDir, + logger: getVoidLogger(), + logStream: new PassThrough(), + output: jest.fn(), + createTemporaryDirectory: jest.fn().mockResolvedValue(mockTmpDir), + }; + + // mock the temp directory + mockFs({ [mockTmpDir]: {} }); + mockFs({ [`${join(mockTmpDir, 'template')}`]: {} }); + + commandExists.mockResolvedValue(null); + + // Mock when run container is called it creates some new files in the mock filesystem + containerRunner.runContainer.mockImplementation(async () => { + mockFs({ + [`${join(mockTmpDir, 'intermediate')}`]: { + 'testfile.json': '{}', + }, + }); + }); + + // Mock when runCommand is called it creats some new files in the mock filesystem + runCommand.mockImplementation(async () => { + mockFs({ + [`${join(mockTmpDir, 'intermediate')}`]: { + 'testfile.json': '{}', + }, + }); + }); + }); + + afterEach(() => { + mockFs.restore(); + }); + + it('should throw an error when copyWithoutRender is not an array', async () => { + (mockContext.input as any).copyWithoutRender = 'not an array'; + + await expect(action.handler(mockContext)).rejects.toThrowError( + /Fetch action input copyWithoutRender must be an Array/, + ); + }); + + it('should throw an error when extensions is not an array', async () => { + (mockContext.input as any).extensions = 'not an array'; + + await expect(action.handler(mockContext)).rejects.toThrowError( + /Fetch action input extensions must be an Array/, + ); + }); + + it('should call fetchContents with the correct variables', async () => { + fetchContents.mockImplementation(() => Promise.resolve()); + await action.handler(mockContext); + expect(fetchContents).toHaveBeenCalledWith( + expect.objectContaining({ + reader: mockReader, + integrations, + baseUrl: mockContext.baseUrl, + fetchUrl: mockContext.input.url, + outputPath: join( + mockTmpDir, + 'template', + "{{cookiecutter and 'contents'}}", + ), + }), + ); + }); + + it('should call out to cookiecutter using runCommand when cookiecutter is installed', async () => { + commandExists.mockResolvedValue(true); + + await action.handler(mockContext); + + expect(runCommand).toHaveBeenCalledWith( + expect.objectContaining({ + command: 'cookiecutter', + args: [ + '--no-input', + '-o', + join(mockTmpDir, 'intermediate'), + join(mockTmpDir, 'template'), + '--verbose', + ], + logStream: mockContext.logStream, + }), + ); + }); + + it('should call out to the containerRunner when there is no cookiecutter installed', async () => { + commandExists.mockResolvedValue(false); + + await action.handler(mockContext); + + expect(containerRunner.runContainer).toHaveBeenCalledWith( + expect.objectContaining({ + imageName: 'spotify/backstage-cookiecutter', + command: 'cookiecutter', + args: ['--no-input', '-o', '/output', '/input', '--verbose'], + mountDirs: { + [join(mockTmpDir, 'intermediate')]: '/output', + [join(mockTmpDir, 'template')]: '/input', + }, + workingDir: '/input', + envVars: { HOME: '/tmp' }, + logStream: mockContext.logStream, + }), + ); + }); + + it('should use a custom imageName when there is an image supplied to the context', async () => { + const imageName = 'test-image'; + mockContext.input.imageName = imageName; + + await action.handler(mockContext); + + expect(containerRunner.runContainer).toHaveBeenCalledWith( + expect.objectContaining({ + imageName, + }), + ); + }); +}); diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.ts new file mode 100644 index 0000000000..1f6fbdb7d8 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.ts @@ -0,0 +1,242 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + ContainerRunner, + UrlReader, + resolveSafeChildPath, +} from '@backstage/backend-common'; +import { JsonObject, JsonValue } from '@backstage/config'; +import { InputError } from '@backstage/errors'; +import { ScmIntegrations } from '@backstage/integration'; +import commandExists from 'command-exists'; +import fs from 'fs-extra'; +import path, { resolve as resolvePath } from 'path'; +import { Writable } from 'stream'; +import { + runCommand, + createTemplateAction, + fetchContents, +} from '@backstage/plugin-scaffolder-backend'; + +export class CookiecutterRunner { + private readonly containerRunner: ContainerRunner; + + constructor({ containerRunner }: { containerRunner: ContainerRunner }) { + this.containerRunner = containerRunner; + } + + private async fetchTemplateCookieCutter( + directory: string, + ): Promise> { + try { + return await fs.readJSON(path.join(directory, 'cookiecutter.json')); + } catch (ex) { + if (ex.code !== 'ENOENT') { + throw ex; + } + + return {}; + } + } + + public async run({ + workspacePath, + values, + logStream, + }: { + workspacePath: string; + values: JsonObject; + logStream: Writable; + }): Promise { + const templateDir = path.join(workspacePath, 'template'); + const intermediateDir = path.join(workspacePath, 'intermediate'); + await fs.ensureDir(intermediateDir); + const resultDir = path.join(workspacePath, 'result'); + + // First lets grab the default cookiecutter.json file + const cookieCutterJson = await this.fetchTemplateCookieCutter(templateDir); + + const { imageName, ...valuesForCookieCutterJson } = values; + const cookieInfo = { + ...cookieCutterJson, + ...valuesForCookieCutterJson, + }; + + await fs.writeJSON(path.join(templateDir, 'cookiecutter.json'), cookieInfo); + + // Directories to bind on container + const mountDirs = { + [templateDir]: '/input', + [intermediateDir]: '/output', + }; + + // the command-exists package returns `true` or throws an error + const cookieCutterInstalled = await commandExists('cookiecutter').catch( + () => false, + ); + if (cookieCutterInstalled) { + await runCommand({ + command: 'cookiecutter', + args: ['--no-input', '-o', intermediateDir, templateDir, '--verbose'], + logStream, + }); + } else { + await this.containerRunner.runContainer({ + imageName: (imageName as string) ?? 'spotify/backstage-cookiecutter', + command: 'cookiecutter', + args: ['--no-input', '-o', '/output', '/input', '--verbose'], + mountDirs, + workingDir: '/input', + // Set the home directory inside the container as something that applications can + // write to, otherwise they will just fail trying to write to / + envVars: { HOME: '/tmp' }, + logStream, + }); + } + + // if cookiecutter was successful, intermediateDir will contain + // exactly one directory. + + const [generated] = await fs.readdir(intermediateDir); + + if (generated === undefined) { + throw new Error('No data generated by cookiecutter'); + } + + await fs.move(path.join(intermediateDir, generated), resultDir); + } +} + +export function createFetchCookiecutterAction(options: { + reader: UrlReader; + integrations: ScmIntegrations; + containerRunner: ContainerRunner; +}) { + const { reader, containerRunner, integrations } = options; + + return createTemplateAction<{ + url: string; + targetPath?: string; + values: JsonObject; + copyWithoutRender?: string[]; + extensions?: string[]; + imageName?: string; + }>({ + id: 'fetch:cookiecutter', + description: + 'Downloads a template from the given URL into the workspace, and runs cookiecutter on it.', + schema: { + input: { + type: 'object', + required: ['url'], + properties: { + url: { + title: 'Fetch URL', + description: + 'Relative path or absolute URL pointing to the directory tree to fetch', + type: 'string', + }, + targetPath: { + title: 'Target Path', + description: + 'Target path within the working directory to download the contents to.', + type: 'string', + }, + values: { + title: 'Template Values', + description: 'Values to pass on to cookiecutter for templating', + type: 'object', + }, + copyWithoutRender: { + title: 'Copy Without Render', + description: + 'Avoid rendering directories and files in the template', + type: 'array', + items: { + type: 'string', + }, + }, + extensions: { + title: 'Template Extensions', + description: + "Jinja2 extensions to add filters, tests, globals or extend the parser. Extensions must be installed in the container or on the host where Cookiecutter executes. See the contrib directory in Backstage's repo for more information", + type: 'array', + items: { + type: 'string', + }, + }, + imageName: { + title: 'Cookiecutter Docker image', + description: + "Specify a custom Docker image to run cookiecutter, to override the default: 'spotify/backstage-cookiecutter'. This can be used to execute cookiecutter with Template Extensions. Used only when a local cookiecutter is not found.", + type: 'string', + }, + }, + }, + }, + async handler(ctx) { + ctx.logger.info('Fetching and then templating using cookiecutter'); + const workDir = await ctx.createTemporaryDirectory(); + const templateDir = resolvePath(workDir, 'template'); + const templateContentsDir = resolvePath( + templateDir, + "{{cookiecutter and 'contents'}}", + ); + const resultDir = resolvePath(workDir, 'result'); + + if ( + ctx.input.copyWithoutRender && + !Array.isArray(ctx.input.copyWithoutRender) + ) { + throw new InputError( + 'Fetch action input copyWithoutRender must be an Array', + ); + } + if (ctx.input.extensions && !Array.isArray(ctx.input.extensions)) { + throw new InputError('Fetch action input extensions must be an Array'); + } + + await fetchContents({ + reader, + integrations, + baseUrl: ctx.baseUrl, + fetchUrl: ctx.input.url, + outputPath: templateContentsDir, + }); + + const cookiecutter = new CookiecutterRunner({ containerRunner }); + const values = { + ...ctx.input.values, + _copy_without_render: ctx.input.copyWithoutRender, + _extensions: ctx.input.extensions, + imageName: ctx.input.imageName, + }; + + // Will execute the template in ./template and put the result in ./result + await cookiecutter.run({ + workspacePath: workDir, + logStream: ctx.logStream, + values, + }); + + // Finally move the template result into the task workspace + const targetPath = ctx.input.targetPath ?? './'; + const outputPath = resolveSafeChildPath(ctx.workspacePath, targetPath); + await fs.copy(resultDir, outputPath); + }, + }); +} diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/setupTests.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/index.ts similarity index 84% rename from plugins/scaffolder-backend-module-cookiecutter/src/setupTests.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/index.ts index d3232290a7..bbe5a16a04 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/src/setupTests.ts +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/index.ts @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,5 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -export {}; +export { createFetchCookiecutterAction } from './cookiecutter'; diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/index.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts similarity index 85% rename from plugins/scaffolder-backend-module-cookiecutter/src/index.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts index ca73cb27ba..1d70b91a34 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/src/index.ts +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,5 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -export * from './service/router'; +export { createFetchCookiecutterAction } from './fetch'; diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/run.ts b/plugins/scaffolder-backend-module-cookiecutter/src/run.ts deleted file mode 100644 index 54d2716290..0000000000 --- a/plugins/scaffolder-backend-module-cookiecutter/src/run.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { getRootLogger } from '@backstage/backend-common'; -import yn from 'yn'; -import { startStandaloneServer } from './service/standaloneServer'; - -const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7000; -const enableCors = yn(process.env.PLUGIN_CORS, { default: false }); -const logger = getRootLogger(); - -startStandaloneServer({ port, enableCors, logger }).catch(err => { - logger.error(err); - process.exit(1); -}); - -process.on('SIGINT', () => { - logger.info('CTRL+C pressed; exiting.'); - process.exit(0); -}); diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/service/router.test.ts b/plugins/scaffolder-backend-module-cookiecutter/src/service/router.test.ts deleted file mode 100644 index 8b77a04348..0000000000 --- a/plugins/scaffolder-backend-module-cookiecutter/src/service/router.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { getVoidLogger } from '@backstage/backend-common'; -import express from 'express'; -import request from 'supertest'; - -import { createRouter } from './router'; - -describe('createRouter', () => { - let app: express.Express; - - beforeAll(async () => { - const router = await createRouter({ - logger: getVoidLogger(), - }); - app = express().use(router); - }); - - beforeEach(() => { - jest.resetAllMocks(); - }); - - describe('GET /health', () => { - it('returns ok', async () => { - const response = await request(app).get('/health'); - - expect(response.status).toEqual(200); - expect(response.body).toEqual({ status: 'ok' }); - }); - }); -}); diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/service/router.ts b/plugins/scaffolder-backend-module-cookiecutter/src/service/router.ts deleted file mode 100644 index 9ceaa47627..0000000000 --- a/plugins/scaffolder-backend-module-cookiecutter/src/service/router.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { errorHandler } from '@backstage/backend-common'; -import express from 'express'; -import Router from 'express-promise-router'; -import { Logger } from 'winston'; - -export interface RouterOptions { - logger: Logger; -} - -export async function createRouter( - options: RouterOptions, -): Promise { - const { logger } = options; - - const router = Router(); - router.use(express.json()); - - router.get('/health', (_, response) => { - logger.info('PONG!'); - response.send({ status: 'ok' }); - }); - router.use(errorHandler()); - return router; -} diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/service/standaloneServer.ts b/plugins/scaffolder-backend-module-cookiecutter/src/service/standaloneServer.ts deleted file mode 100644 index d35fb1e5ad..0000000000 --- a/plugins/scaffolder-backend-module-cookiecutter/src/service/standaloneServer.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { createServiceBuilder } from '@backstage/backend-common'; -import { Server } from 'http'; -import { Logger } from 'winston'; -import { createRouter } from './router'; - -export interface ServerOptions { - port: number; - enableCors: boolean; - logger: Logger; -} - -export async function startStandaloneServer( - options: ServerOptions, -): Promise { - const logger = options.logger.child({ - service: 'scaffolder-backend-module-cookiecutter-backend', - }); - logger.debug('Starting application server...'); - const router = await createRouter({ - logger, - }); - - let service = createServiceBuilder(module) - .setPort(options.port) - .addRouter('/scaffolder-backend-module-cookiecutter', router); - if (options.enableCors) { - service = service.enableCors({ origin: 'http://localhost:3000' }); - } - - return await service.start().catch(err => { - logger.error(err); - process.exit(1); - }); -} - -module.hot?.accept(); From df7c9243d334ea6c2498b134b20d11df0d9c17b0 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 7 Jul 2021 17:17:12 +0200 Subject: [PATCH 026/101] chore: use the cookiecutter templater library Signed-off-by: blam --- .../package.json | 2 +- .../src/index.ts | 16 ++ plugins/scaffolder-backend/package.json | 1 + .../actions/builtin/createBuiltinActions.ts | 2 +- .../builtin/fetch/cookiecutter.test.ts | 212 ---------------- .../actions/builtin/fetch/cookiecutter.ts | 240 ------------------ .../scaffolder/actions/builtin/fetch/index.ts | 1 - 7 files changed, 19 insertions(+), 455 deletions(-) create mode 100644 plugins/scaffolder-backend-module-cookiecutter/src/index.ts delete mode 100644 plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts delete mode 100644 plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.ts diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json index 373b22c5c2..9a8afa8324 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/package.json +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -1,5 +1,5 @@ { - "name": "plugin-scaffolder-backend-module-cookiecutter", + "name": "@backstage/plugin-scaffolder-backend-module-cookiecutter", "version": "0.1.0", "main": "src/index.ts", "types": "src/index.ts", diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/index.ts b/plugins/scaffolder-backend-module-cookiecutter/src/index.ts new file mode 100644 index 0000000000..e8de675502 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/src/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export { createFetchCookiecutterAction } from './actions'; diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 8f10c9fa53..e44a22403c 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -35,6 +35,7 @@ "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.8", + "@backstage/plugin-scaffolder-backend-module-cookiecutter": "^0.1.0", "@gitbeaker/core": "^30.2.0", "@gitbeaker/node": "^30.2.0", "@octokit/rest": "^18.5.3", diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts index 6541625035..c367f0abb7 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts @@ -25,10 +25,10 @@ import { import { createDebugLogAction } from './debug'; import { - createFetchCookiecutterAction, createFetchPlainAction, createFetchTemplateAction, } from './fetch'; +import { createFetchCookiecutterAction } from '@backstage/plugin-scaffolder-backend-module-cookiecutter'; import { createFilesystemDeleteAction, createFilesystemRenameAction, diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts deleted file mode 100644 index 86f953a6a5..0000000000 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2021 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const runCommand = jest.fn(); -const commandExists = jest.fn(); -const fetchContents = jest.fn(); - -jest.mock('./helpers', () => ({ fetchContents })); -jest.mock('command-exists', () => commandExists); -jest.mock('../helpers', () => ({ runCommand })); - -import { - getVoidLogger, - UrlReader, - ContainerRunner, -} from '@backstage/backend-common'; -import { ConfigReader, JsonObject } from '@backstage/config'; -import { ScmIntegrations } from '@backstage/integration'; -import mockFs from 'mock-fs'; -import os from 'os'; -import { PassThrough } from 'stream'; -import { createFetchCookiecutterAction } from './cookiecutter'; -import { join } from 'path'; -import { ActionContext } from '../../types'; - -describe('fetch:cookiecutter', () => { - const integrations = ScmIntegrations.fromConfig( - new ConfigReader({ - integrations: { - azure: [ - { host: 'dev.azure.com', token: 'tokenlols' }, - { host: 'myazurehostnotoken.com' }, - ], - }, - }), - ); - - const mockTmpDir = os.tmpdir(); - - let mockContext: ActionContext<{ - url: string; - targetPath?: string; - values: JsonObject; - copyWithoutRender?: string[]; - extensions?: string[]; - imageName?: string; - }>; - - const containerRunner: jest.Mocked = { - runContainer: jest.fn(), - }; - - const mockReader: UrlReader = { - read: jest.fn(), - readTree: jest.fn(), - search: jest.fn(), - }; - - const action = createFetchCookiecutterAction({ - integrations, - containerRunner, - reader: mockReader, - }); - - beforeEach(() => { - jest.resetAllMocks(); - - mockContext = { - input: { - url: 'https://google.com/cookie/cutter', - targetPath: 'something', - values: { - help: 'me', - }, - }, - baseUrl: 'somebase', - workspacePath: mockTmpDir, - logger: getVoidLogger(), - logStream: new PassThrough(), - output: jest.fn(), - createTemporaryDirectory: jest.fn().mockResolvedValue(mockTmpDir), - }; - - // mock the temp directory - mockFs({ [mockTmpDir]: {} }); - mockFs({ [`${join(mockTmpDir, 'template')}`]: {} }); - - commandExists.mockResolvedValue(null); - - // Mock when run container is called it creates some new files in the mock filesystem - containerRunner.runContainer.mockImplementation(async () => { - mockFs({ - [`${join(mockTmpDir, 'intermediate')}`]: { - 'testfile.json': '{}', - }, - }); - }); - - // Mock when runCommand is called it creats some new files in the mock filesystem - runCommand.mockImplementation(async () => { - mockFs({ - [`${join(mockTmpDir, 'intermediate')}`]: { - 'testfile.json': '{}', - }, - }); - }); - }); - - afterEach(() => { - mockFs.restore(); - }); - - it('should throw an error when copyWithoutRender is not an array', async () => { - (mockContext.input as any).copyWithoutRender = 'not an array'; - - await expect(action.handler(mockContext)).rejects.toThrowError( - /Fetch action input copyWithoutRender must be an Array/, - ); - }); - - it('should throw an error when extensions is not an array', async () => { - (mockContext.input as any).extensions = 'not an array'; - - await expect(action.handler(mockContext)).rejects.toThrowError( - /Fetch action input extensions must be an Array/, - ); - }); - - it('should call fetchContents with the correct variables', async () => { - fetchContents.mockImplementation(() => Promise.resolve()); - await action.handler(mockContext); - expect(fetchContents).toHaveBeenCalledWith( - expect.objectContaining({ - reader: mockReader, - integrations, - baseUrl: mockContext.baseUrl, - fetchUrl: mockContext.input.url, - outputPath: join( - mockTmpDir, - 'template', - "{{cookiecutter and 'contents'}}", - ), - }), - ); - }); - - it('should call out to cookiecutter using runCommand when cookiecutter is installed', async () => { - commandExists.mockResolvedValue(true); - - await action.handler(mockContext); - - expect(runCommand).toHaveBeenCalledWith( - expect.objectContaining({ - command: 'cookiecutter', - args: [ - '--no-input', - '-o', - join(mockTmpDir, 'intermediate'), - join(mockTmpDir, 'template'), - '--verbose', - ], - logStream: mockContext.logStream, - }), - ); - }); - - it('should call out to the containerRunner when there is no cookiecutter installed', async () => { - commandExists.mockResolvedValue(false); - - await action.handler(mockContext); - - expect(containerRunner.runContainer).toHaveBeenCalledWith( - expect.objectContaining({ - imageName: 'spotify/backstage-cookiecutter', - command: 'cookiecutter', - args: ['--no-input', '-o', '/output', '/input', '--verbose'], - mountDirs: { - [join(mockTmpDir, 'intermediate')]: '/output', - [join(mockTmpDir, 'template')]: '/input', - }, - workingDir: '/input', - envVars: { HOME: '/tmp' }, - logStream: mockContext.logStream, - }), - ); - }); - - it('should use a custom imageName when there is an image supplied to the context', async () => { - const imageName = 'test-image'; - mockContext.input.imageName = imageName; - - await action.handler(mockContext); - - expect(containerRunner.runContainer).toHaveBeenCalledWith( - expect.objectContaining({ - imageName, - }), - ); - }); -}); diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.ts deleted file mode 100644 index 048b2bba64..0000000000 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright 2021 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - ContainerRunner, - UrlReader, - resolveSafeChildPath, -} from '@backstage/backend-common'; -import { JsonObject, JsonValue } from '@backstage/config'; -import { InputError } from '@backstage/errors'; -import { ScmIntegrations } from '@backstage/integration'; -import commandExists from 'command-exists'; -import fs from 'fs-extra'; -import path, { resolve as resolvePath } from 'path'; -import { Writable } from 'stream'; -import { runCommand } from '../helpers'; -import { createTemplateAction } from '../../createTemplateAction'; -import { fetchContents } from './helpers'; - -export class CookiecutterRunner { - private readonly containerRunner: ContainerRunner; - - constructor({ containerRunner }: { containerRunner: ContainerRunner }) { - this.containerRunner = containerRunner; - } - - private async fetchTemplateCookieCutter( - directory: string, - ): Promise> { - try { - return await fs.readJSON(path.join(directory, 'cookiecutter.json')); - } catch (ex) { - if (ex.code !== 'ENOENT') { - throw ex; - } - - return {}; - } - } - - public async run({ - workspacePath, - values, - logStream, - }: { - workspacePath: string; - values: JsonObject; - logStream: Writable; - }): Promise { - const templateDir = path.join(workspacePath, 'template'); - const intermediateDir = path.join(workspacePath, 'intermediate'); - await fs.ensureDir(intermediateDir); - const resultDir = path.join(workspacePath, 'result'); - - // First lets grab the default cookiecutter.json file - const cookieCutterJson = await this.fetchTemplateCookieCutter(templateDir); - - const { imageName, ...valuesForCookieCutterJson } = values; - const cookieInfo = { - ...cookieCutterJson, - ...valuesForCookieCutterJson, - }; - - await fs.writeJSON(path.join(templateDir, 'cookiecutter.json'), cookieInfo); - - // Directories to bind on container - const mountDirs = { - [templateDir]: '/input', - [intermediateDir]: '/output', - }; - - // the command-exists package returns `true` or throws an error - const cookieCutterInstalled = await commandExists('cookiecutter').catch( - () => false, - ); - if (cookieCutterInstalled) { - await runCommand({ - command: 'cookiecutter', - args: ['--no-input', '-o', intermediateDir, templateDir, '--verbose'], - logStream, - }); - } else { - await this.containerRunner.runContainer({ - imageName: (imageName as string) ?? 'spotify/backstage-cookiecutter', - command: 'cookiecutter', - args: ['--no-input', '-o', '/output', '/input', '--verbose'], - mountDirs, - workingDir: '/input', - // Set the home directory inside the container as something that applications can - // write to, otherwise they will just fail trying to write to / - envVars: { HOME: '/tmp' }, - logStream, - }); - } - - // if cookiecutter was successful, intermediateDir will contain - // exactly one directory. - - const [generated] = await fs.readdir(intermediateDir); - - if (generated === undefined) { - throw new Error('No data generated by cookiecutter'); - } - - await fs.move(path.join(intermediateDir, generated), resultDir); - } -} - -export function createFetchCookiecutterAction(options: { - reader: UrlReader; - integrations: ScmIntegrations; - containerRunner: ContainerRunner; -}) { - const { reader, containerRunner, integrations } = options; - - return createTemplateAction<{ - url: string; - targetPath?: string; - values: JsonObject; - copyWithoutRender?: string[]; - extensions?: string[]; - imageName?: string; - }>({ - id: 'fetch:cookiecutter', - description: - "Downloads a template from the given URL into the workspace, and runs cookiecutter on it. This action is deprecated in favor of 'fetch:template'. See https://backstage.io/docs/features/software-templates/builtin-actions#migrating-from-fetch-cookiecutter-to-fetch-template for more details.", - schema: { - input: { - type: 'object', - required: ['url'], - properties: { - url: { - title: 'Fetch URL', - description: - 'Relative path or absolute URL pointing to the directory tree to fetch', - type: 'string', - }, - targetPath: { - title: 'Target Path', - description: - 'Target path within the working directory to download the contents to.', - type: 'string', - }, - values: { - title: 'Template Values', - description: 'Values to pass on to cookiecutter for templating', - type: 'object', - }, - copyWithoutRender: { - title: 'Copy Without Render', - description: - 'Avoid rendering directories and files in the template', - type: 'array', - items: { - type: 'string', - }, - }, - extensions: { - title: 'Template Extensions', - description: - "Jinja2 extensions to add filters, tests, globals or extend the parser. Extensions must be installed in the container or on the host where Cookiecutter executes. See the contrib directory in Backstage's repo for more information", - type: 'array', - items: { - type: 'string', - }, - }, - imageName: { - title: 'Cookiecutter Docker image', - description: - "Specify a custom Docker image to run cookiecutter, to override the default: 'spotify/backstage-cookiecutter'. This can be used to execute cookiecutter with Template Extensions. Used only when a local cookiecutter is not found.", - type: 'string', - }, - }, - }, - }, - async handler(ctx) { - ctx.logger.info('Fetching and then templating using cookiecutter'); - const workDir = await ctx.createTemporaryDirectory(); - const templateDir = resolvePath(workDir, 'template'); - const templateContentsDir = resolvePath( - templateDir, - "{{cookiecutter and 'contents'}}", - ); - const resultDir = resolvePath(workDir, 'result'); - - if ( - ctx.input.copyWithoutRender && - !Array.isArray(ctx.input.copyWithoutRender) - ) { - throw new InputError( - 'Fetch action input copyWithoutRender must be an Array', - ); - } - if (ctx.input.extensions && !Array.isArray(ctx.input.extensions)) { - throw new InputError('Fetch action input extensions must be an Array'); - } - - await fetchContents({ - reader, - integrations, - baseUrl: ctx.baseUrl, - fetchUrl: ctx.input.url, - outputPath: templateContentsDir, - }); - - const cookiecutter = new CookiecutterRunner({ containerRunner }); - const values = { - ...ctx.input.values, - _copy_without_render: ctx.input.copyWithoutRender, - _extensions: ctx.input.extensions, - imageName: ctx.input.imageName, - }; - - // Will execute the template in ./template and put the result in ./result - await cookiecutter.run({ - workspacePath: workDir, - logStream: ctx.logStream, - values, - }); - - // Finally move the template result into the task workspace - const targetPath = ctx.input.targetPath ?? './'; - const outputPath = resolveSafeChildPath(ctx.workspacePath, targetPath); - await fs.copy(resultDir, outputPath); - }, - }); -} diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/index.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/index.ts index fea32df39c..c9a16c274e 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/index.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/index.ts @@ -15,6 +15,5 @@ */ export { createFetchPlainAction } from './plain'; -export { createFetchCookiecutterAction } from './cookiecutter'; export { createFetchTemplateAction } from './template'; export { fetchContents } from './helpers'; From 7cea90592fb8cf6e11fb728cb98b67dc39a3bf4a Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 8 Jul 2021 02:55:42 +0200 Subject: [PATCH 027/101] chore: add changeset Signed-off-by: blam --- .changeset/spotty-pandas-deny.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/spotty-pandas-deny.md diff --git a/.changeset/spotty-pandas-deny.md b/.changeset/spotty-pandas-deny.md new file mode 100644 index 0000000000..dbd4c97c2c --- /dev/null +++ b/.changeset/spotty-pandas-deny.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +'@backstage/plugin-scaffolder-backend-module-rails': patch +--- + +- Align versions for the rails plugin +- Move out the cookiecutter templating to it's own module that is depended on by the `scaffolder-backend` no breaking change yet, but we will drop first class support for `cookiecutter` in the future and it will become an opt-in feature. From 4a087f05ea2925de85d97700f2bf830308c6aa5d Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 8 Jul 2021 03:10:52 +0200 Subject: [PATCH 028/101] chore: fix readme Signed-off-by: blam --- plugins/scaffolder-backend-module-cookiecutter/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/scaffolder-backend-module-cookiecutter/README.md b/plugins/scaffolder-backend-module-cookiecutter/README.md index c7a2497cce..a76d8076e4 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/README.md +++ b/plugins/scaffolder-backend-module-cookiecutter/README.md @@ -6,8 +6,4 @@ _This plugin was created through the Backstage CLI_ ## Getting started -Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/scaffolder-backend-module-cookiecutter](http://localhost:3000/scaffolder-backend-module-cookiecutter). - -You can also serve the plugin in isolation by running `yarn start` in the plugin directory. -This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. -It is only meant for local development, and the setup for it can be found inside the [/dev](/dev) directory. + From 4cdc9d1d0b3edf65b09058e03f57f964852a1d34 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 8 Jul 2021 03:34:21 +0200 Subject: [PATCH 029/101] chore: added api for cookiecutter Signed-off-by: blam --- .../api-report.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 plugins/scaffolder-backend-module-cookiecutter/api-report.md diff --git a/plugins/scaffolder-backend-module-cookiecutter/api-report.md b/plugins/scaffolder-backend-module-cookiecutter/api-report.md new file mode 100644 index 0000000000..fe2f23c1fd --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/api-report.md @@ -0,0 +1,22 @@ +## API Report File for "@backstage/plugin-scaffolder-backend-module-cookiecutter" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ContainerRunner } from '@backstage/backend-common'; +import { ScmIntegrations } from '@backstage/integration'; +import { TemplateAction } from '@backstage/plugin-scaffolder-backend'; +import { UrlReader } from '@backstage/backend-common'; + +// @public (undocumented) +export function createFetchCookiecutterAction(options: { + reader: UrlReader; + integrations: ScmIntegrations; + containerRunner: ContainerRunner; +}): TemplateAction; + + +// (No @packageDocumentation comment for this package) + +``` From 8b93d985c00ab0f8298583d6830a967127199aa3 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 15 Jul 2021 12:16:56 +0200 Subject: [PATCH 030/101] chore: fixing merge b0rked Signed-off-by: blam --- plugins/scaffolder-backend-module-cookiecutter/package.json | 5 ++--- plugins/scaffolder-backend-module-rails/package.json | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json index 9a8afa8324..71f7ae0e40 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/package.json +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -4,7 +4,6 @@ "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", - "private": true, "publishConfig": { "access": "public", "main": "dist/index.cjs.js", @@ -20,10 +19,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.4", + "@backstage/backend-common": "^0.8.6", "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.7", - "@backstage/plugin-scaffolder-backend": "^0.12.2", + "@backstage/plugin-scaffolder-backend": "^0.14.0", "@backstage/config": "^0.1.5", "command-exists": "^1.2.9", "fs-extra": "^10.0.0", diff --git a/plugins/scaffolder-backend-module-rails/package.json b/plugins/scaffolder-backend-module-rails/package.json index e805473c61..3062136a76 100644 --- a/plugins/scaffolder-backend-module-rails/package.json +++ b/plugins/scaffolder-backend-module-rails/package.json @@ -20,13 +20,8 @@ "clean": "backstage-cli clean" }, "dependencies": { -<<<<<<< HEAD "@backstage/backend-common": "^0.8.6", "@backstage/plugin-scaffolder-backend": "^0.14.0", -======= - "@backstage/backend-common": "^0.8.4", - "@backstage/plugin-scaffolder-backend": "^0.12.2", ->>>>>>> chore: update some packages "@backstage/config": "^0.1.5", "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.8", From a0149f0228797cf621c1f8f2ada3e571f8767c89 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 15 Jul 2021 12:21:53 +0200 Subject: [PATCH 031/101] chore: code review comments Signed-off-by: blam --- .../scaffolder-backend-module-cookiecutter/src/actions/index.ts | 2 +- plugins/scaffolder-backend-module-cookiecutter/src/index.ts | 2 +- .../scaffolder-backend/src/scaffolder/actions/builtin/index.ts | 2 ++ yarn.lock | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts index 1d70b91a34..1b47db9e03 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts @@ -13,4 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { createFetchCookiecutterAction } from './fetch'; +export * from './fetch'; diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/index.ts b/plugins/scaffolder-backend-module-cookiecutter/src/index.ts index e8de675502..4f06b14a86 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/src/index.ts +++ b/plugins/scaffolder-backend-module-cookiecutter/src/index.ts @@ -13,4 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { createFetchCookiecutterAction } from './actions'; +export * from './actions'; diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/index.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/index.ts index 849b056ac9..2a583f369a 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/index.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/index.ts @@ -20,4 +20,6 @@ export * from './debug'; export * from './fetch'; export * from './filesystem'; export * from './publish'; + +export { createFetchCookiecutterAction } from '@backstage/plugin-scaffolder-backend-module-cookiecutter'; export { runCommand } from './helpers'; diff --git a/yarn.lock b/yarn.lock index bc34978977..766d71e7d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13177,7 +13177,7 @@ fs-constants@^1.0.0: resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@10.0.0: +fs-extra@10.0.0, fs-extra@^10.0.0: version "10.0.0" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== From 94c00f9ba7b5ea856eaaec42fca41bb73d395660 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 15 Jul 2021 12:26:48 +0200 Subject: [PATCH 032/101] api-report: update the api reports for the plugins Signed-off-by: blam --- .../api-report.md | 11 ++++++----- plugins/scaffolder-backend/api-report.md | 10 ++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/plugins/scaffolder-backend-module-cookiecutter/api-report.md b/plugins/scaffolder-backend-module-cookiecutter/api-report.md index fe2f23c1fd..8e46667fce 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/api-report.md +++ b/plugins/scaffolder-backend-module-cookiecutter/api-report.md @@ -3,20 +3,21 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// import { ContainerRunner } from '@backstage/backend-common'; import { ScmIntegrations } from '@backstage/integration'; import { TemplateAction } from '@backstage/plugin-scaffolder-backend'; import { UrlReader } from '@backstage/backend-common'; +// Warning: (ae-missing-release-tag) "createFetchCookiecutterAction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// // @public (undocumented) export function createFetchCookiecutterAction(options: { - reader: UrlReader; - integrations: ScmIntegrations; - containerRunner: ContainerRunner; + reader: UrlReader; + integrations: ScmIntegrations; + containerRunner: ContainerRunner; }): TemplateAction; - // (No @packageDocumentation comment for this package) - ``` diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index f29274cc24..0e7a25534c 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -8,6 +8,7 @@ import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { ContainerRunner } from '@backstage/backend-common'; +import { createFetchCookiecutterAction } from '@backstage/plugin-scaffolder-backend-module-cookiecutter'; import { createPullRequest } from 'octokit-plugin-create-pull-request'; import express from 'express'; import { JsonObject } from '@backstage/config'; @@ -78,14 +79,7 @@ export function createCatalogWriteAction(): TemplateAction; // @public export function createDebugLogAction(): TemplateAction; -// Warning: (ae-missing-release-tag) "createFetchCookiecutterAction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function createFetchCookiecutterAction(options: { - reader: UrlReader; - integrations: ScmIntegrations; - containerRunner: ContainerRunner; -}): TemplateAction; +export { createFetchCookiecutterAction }; // Warning: (ae-missing-release-tag) "createFetchPlainAction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // From 2bffb188596ab5e76dc19b8a6408696aeac65b50 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 15 Jul 2021 12:34:55 +0200 Subject: [PATCH 033/101] chore: run prettier on ugly document Signed-off-by: blam --- .../src/scaffolder/actions/builtin/createBuiltinActions.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts index c367f0abb7..ae5a7d0697 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts @@ -24,10 +24,7 @@ import { } from './catalog'; import { createDebugLogAction } from './debug'; -import { - createFetchPlainAction, - createFetchTemplateAction, -} from './fetch'; +import { createFetchPlainAction, createFetchTemplateAction } from './fetch'; import { createFetchCookiecutterAction } from '@backstage/plugin-scaffolder-backend-module-cookiecutter'; import { createFilesystemDeleteAction, From 6efd28c44165fae1cd33f54e741719332269c9c1 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 15 Jul 2021 12:51:19 +0200 Subject: [PATCH 034/101] chore: fix changeset and update some deps to avoid bringing in multiple Signed-off-by: blam --- .changeset/spotty-pandas-deny.md | 4 +--- plugins/scaffolder-backend-module-cookiecutter/package.json | 2 +- yarn.lock | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.changeset/spotty-pandas-deny.md b/.changeset/spotty-pandas-deny.md index dbd4c97c2c..51c90515e5 100644 --- a/.changeset/spotty-pandas-deny.md +++ b/.changeset/spotty-pandas-deny.md @@ -1,7 +1,5 @@ --- '@backstage/plugin-scaffolder-backend': patch -'@backstage/plugin-scaffolder-backend-module-rails': patch --- -- Align versions for the rails plugin -- Move out the cookiecutter templating to it's own module that is depended on by the `scaffolder-backend` no breaking change yet, but we will drop first class support for `cookiecutter` in the future and it will become an opt-in feature. +- Move out the `cookiecutter` templating to it's own module that is depended on by the `scaffolder-backend` no breaking change yet, but we will drop first class support for `cookiecutter` in the future and it will become an opt-in feature. diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json index 71f7ae0e40..f321d6b45c 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/package.json +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -25,7 +25,7 @@ "@backstage/plugin-scaffolder-backend": "^0.14.0", "@backstage/config": "^0.1.5", "command-exists": "^1.2.9", - "fs-extra": "^10.0.0", + "fs-extra": "10.0.0", "winston": "^3.2.1", "cross-fetch": "^3.0.6", "yn": "^4.0.0" diff --git a/yarn.lock b/yarn.lock index 766d71e7d5..bc34978977 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13177,7 +13177,7 @@ fs-constants@^1.0.0: resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@10.0.0, fs-extra@^10.0.0: +fs-extra@10.0.0: version "10.0.0" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== From 417aeb2e71c63ee0a4d0373f9716dfe9c1463d99 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 15 Jul 2021 12:57:23 +0200 Subject: [PATCH 035/101] Update API report Signed-off-by: Philipp Hugenroth --- packages/core-components/api-report.md | 10 ++++++ plugins/catalog/api-report.md | 48 ++++++++++++++++++-------- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index e915e004ee..bfc6852a97 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -1202,6 +1202,16 @@ export const Page: ({ children, }: PropsWithChildren) => JSX.Element; +// Warning: (ae-forgotten-export) The symbol "IProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "PageWithHeader" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PageWithHeader: ({ + themeId, + children, + ...props +}: React_2.PropsWithChildren) => JSX.Element; + // Warning: (ae-missing-release-tag) "Progress" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index a85954906a..b3169d5c29 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -30,7 +30,7 @@ export function AboutCard({ variant }: AboutCardProps): JSX.Element; // Warning: (ae-missing-release-tag) "AboutContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const AboutContent: ({ entity }: Props_2) => JSX.Element; +export const AboutContent: ({ entity }: Props) => JSX.Element; // Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "AboutField" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -41,29 +41,32 @@ export const AboutField: ({ value, gridSizes, children, -}: Props_3) => JSX.Element; +}: Props_2) => JSX.Element; // Warning: (ae-missing-release-tag) "CatalogEntityPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export const CatalogEntityPage: () => JSX.Element; +// Warning: (ae-forgotten-export) The symbol "IProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "CatalogFilter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const CatalogFilter: ({ + initiallySelectedFilter, + initialFilter, +}: IProps) => JSX.Element; + // Warning: (ae-forgotten-export) The symbol "CatalogPageProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "CatalogIndexPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export const CatalogIndexPage: ({ - initiallySelectedFilter, columns, actions, + initiallySelectedFilter, }: CatalogPageProps) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "CatalogLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const CatalogLayout: ({ children }: Props) => JSX.Element; - // Warning: (ae-missing-release-tag) "catalogPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -110,11 +113,6 @@ export type CatalogTableRow = { }; }; -// Warning: (ae-missing-release-tag) "CreateComponentButton" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const CreateComponentButton: () => JSX.Element | null; - // Warning: (ae-missing-release-tag) "createMetadataDescriptionColumn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -287,6 +285,21 @@ export const EntitySwitch: { // @public (undocumented) export const EntitySystemDiagramCard: SystemDiagramCard; +// Warning: (ae-missing-release-tag) "FilterContainer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const FilterContainer: ({ + children, +}: React_2.PropsWithChildren<{}>) => JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "IProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "FilteredTableLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const FilteredTableLayout: ({ + children, +}: React_2.PropsWithChildren) => JSX.Element; + // Warning: (ae-missing-release-tag) "isComponentType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -316,6 +329,13 @@ export const Router: ({ EntityPage?: React_2.ComponentType<{}> | undefined; }) => JSX.Element; +// Warning: (ae-missing-release-tag) "TableContainer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const TableContainer: ({ + children, +}: React_2.PropsWithChildren<{}>) => JSX.Element; + // Warnings were encountered during analysis: // // src/components/CatalogTable/CatalogTable.d.ts:10:5 - (ae-forgotten-export) The symbol "CatalogTableProps" needs to be exported by the entry point index.d.ts From a7f0e1994a88375b01d84e63b2ce2098c14d0761 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 15 Jul 2021 13:09:25 +0200 Subject: [PATCH 036/101] docs: document the cookiecutter actions Signed-off-by: blam --- .../README.md | 160 +++++++++++++++++- 1 file changed, 156 insertions(+), 4 deletions(-) diff --git a/plugins/scaffolder-backend-module-cookiecutter/README.md b/plugins/scaffolder-backend-module-cookiecutter/README.md index a76d8076e4..b97b1bbb05 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/README.md +++ b/plugins/scaffolder-backend-module-cookiecutter/README.md @@ -1,9 +1,161 @@ # scaffolder-backend-module-cookiecutter -Welcome to the scaffolder-backend-module-cookiecutter backend plugin! - -_This plugin was created through the Backstage CLI_ +Welcome to the `fetch:cookiecutter` action for the `scaffolder-backend`. ## Getting started - +You need to configure the action in your backend: + +## From your Backstage root directory + +``` +cd packages/backend +yarn add @backstage/plugin-scaffolder-backend-module-cookiecutter +``` + +Configure the action (you can check +the [docs](https://backstage.io/docs/features/software-templates/writing-custom-actions#registering-custom-actions) to +see all options): + +```typescript +const actions = [ + createFetchCookiecutterAction({ + integrations, + reader, + containerRunner, + }), + ...createBuiltInActions({ + ... + }) +]; + +return await createRouter({ + containerRunner, + logger, + config, + database, + catalogClient, + reader, + actions, +}); +``` + +After that you can use the action in your template: + +```yaml +apiVersion: backstage.io/v1beta2 +kind: Template +metadata: + name: cookiecutter-demo + title: Cookiecutter Test + description: Cookiecutter example +spec: + owner: backstage/techdocs-core + type: service + + parameters: + - title: Fill in some steps + required: + - name + - owner + properties: + name: + title: Name + type: string + description: Unique name of the component + ui:autofocus: true + ui:options: + rows: 5 + owner: + title: Owner + type: string + description: Owner of the component + ui:field: OwnerPicker + ui:options: + allowedKinds: + - Group + system: + title: System + type: string + description: System of the component + ui:field: EntityPicker + ui:options: + allowedKinds: + - System + defaultKind: System + + - title: Choose a location + required: + - repoUrl + - dryRun + properties: + repoUrl: + title: Repository Location + type: string + ui:field: RepoUrlPicker + ui:options: + allowedHosts: + - github.com + dryRun: + title: Only perform a dry run, don't publish anything + type: boolean + default: false + + steps: + - id: fetch-base + name: Fetch Base + action: fetch:cookiecutter + input: + url: ./template + values: + name: '{{ parameters.name }}' + owner: '{{ parameters.owner }}' + system: '{{ parameters.system }}' + destination: '{{ parseRepoUrl parameters.repoUrl }}' + + - id: publish + if: '{{ not parameters.dryRun }}' + name: Publish + action: publish:github + input: + allowedHosts: ['github.com'] + description: 'This is {{ parameters.name }}' + repoUrl: '{{ parameters.repoUrl }}' + + - id: register + if: '{{ not parameters.dryRun }}' + name: Register + action: catalog:register + input: + repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}' + catalogInfoPath: '/catalog-info.yaml' + + - name: Results + if: '{{ parameters.dryRun }}' + action: debug:log + input: + listWorkspace: true + + output: + links: + - title: Repository + url: '{{ steps.publish.output.remoteUrl }}' + - title: Open in catalog + icon: 'catalog' + entityRef: '{{ steps.register.output.entityRef }}' +``` + +You can also visit the `/create/actions` route in your Backstage application to find out more about the parameters this action accepts when it's installed to configure how you like. + +### Environment setup + +The environment needs to have either `cookiecutter` installed and be available in the `PATH` or access to a `docker` daemon so it can spin up a docker container with `cookiecutter` available. + +If you are running Backstage from a Docker container and you want to avoid calling a container inside a container, you can set up `cookiecutter` in your own image, this will use the local installation instead. + +You can do so by including the following lines in the last step of your Dockerfile: + +```dockerfile +RUN apt-get update && apt-get install -y python3 python3-pip +RUN pip3 install cookiecutter +``` From 4af11b2cf585670c5c62195cfad2e159f802a6dc Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 15 Jul 2021 13:11:39 +0200 Subject: [PATCH 037/101] chore: updating the actions documentation again Signed-off-by: blam --- plugins/scaffolder-backend-module-cookiecutter/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend-module-cookiecutter/README.md b/plugins/scaffolder-backend-module-cookiecutter/README.md index b97b1bbb05..77ae93c5f3 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/README.md +++ b/plugins/scaffolder-backend-module-cookiecutter/README.md @@ -13,11 +13,12 @@ cd packages/backend yarn add @backstage/plugin-scaffolder-backend-module-cookiecutter ``` -Configure the action (you can check -the [docs](https://backstage.io/docs/features/software-templates/writing-custom-actions#registering-custom-actions) to -see all options): +Configure the action: +(you can check the [docs](https://backstage.io/docs/features/software-templates/writing-custom-actions#registering-custom-actions) to see all options): ```typescript +// packages/backend/src/plugins/scaffolder.ts + const actions = [ createFetchCookiecutterAction({ integrations, From 0a7e3d243c33073327bec7062165e1411aea0f11 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 15 Jul 2021 13:25:50 +0200 Subject: [PATCH 038/101] chore: fix changeset Signed-off-by: blam --- .changeset/spotty-pandas-deny.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/spotty-pandas-deny.md b/.changeset/spotty-pandas-deny.md index 51c90515e5..c3da6afe2b 100644 --- a/.changeset/spotty-pandas-deny.md +++ b/.changeset/spotty-pandas-deny.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder-backend': patch --- -- Move out the `cookiecutter` templating to it's own module that is depended on by the `scaffolder-backend` no breaking change yet, but we will drop first class support for `cookiecutter` in the future and it will become an opt-in feature. +- Move out the `cookiecutter` templating to its own module that is depended on by the `scaffolder-backend` plugin. No breaking change yet, but we will drop first class support for `cookiecutter` in the future and it will become an opt-in feature. From 5c4cc638549a3eae7489d5beba07b1e0db56e68d Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 15 Jul 2021 14:00:24 +0200 Subject: [PATCH 039/101] Use ellipsis in the header Signed-off-by: Philipp Hugenroth --- .../src/layout/Header/Header.tsx | 1 + .../components/EntityLayout/EntityLayout.tsx | 39 ++++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/packages/core-components/src/layout/Header/Header.tsx b/packages/core-components/src/layout/Header/Header.tsx index b02ba29d88..572f1f8c32 100644 --- a/packages/core-components/src/layout/Header/Header.tsx +++ b/packages/core-components/src/layout/Header/Header.tsx @@ -42,6 +42,7 @@ const useStyles = makeStyles(theme => ({ backgroundSize: 'cover', }, leftItemsBox: { + maxWidth: '100%', flex: '1 1 auto', marginBottom: theme.spacing(1), }, diff --git a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx index 9cb0b7c961..a5b85082cc 100644 --- a/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx +++ b/plugins/catalog/src/components/EntityLayout/EntityLayout.tsx @@ -20,9 +20,17 @@ import { RELATION_OWNED_BY, } from '@backstage/catalog-model'; import { - useElementFilter, + Content, + Header, + HeaderLabel, + Page, + Progress, + RoutedTabs, +} from '@backstage/core-components'; +import { attachComponentData, IconComponent, + useElementFilter, } from '@backstage/core-plugin-api'; import { EntityContext, @@ -37,14 +45,6 @@ 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; @@ -68,12 +68,21 @@ const EntityLayoutTitle = ({ }: { title: string; entity: Entity | undefined; -}) => ( - - {title} - {entity && } - -); +}) => { + return ( + + + {title} + + {entity && } + + ); +}; const headerProps = ( paramKind: string | undefined, From bcfdd852c253091ded73e10da7ab9a6e3b8005a8 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 15 Jul 2021 15:12:16 +0200 Subject: [PATCH 040/101] Break error message text for docs on EntityPage Signed-off-by: Philipp Hugenroth --- .../techdocs/src/reader/components/Reader.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index d63ddf8125..9dd8a2d656 100644 --- a/plugins/techdocs/src/reader/components/Reader.tsx +++ b/plugins/techdocs/src/reader/components/Reader.tsx @@ -19,7 +19,12 @@ import { Progress } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; import { scmIntegrationsApiRef } from '@backstage/integration-react'; import { BackstageTheme } from '@backstage/theme'; -import { Button, CircularProgress, useTheme } from '@material-ui/core'; +import { + Button, + CircularProgress, + makeStyles, + useTheme, +} from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; @@ -45,10 +50,17 @@ type Props = { onReady?: () => void; }; +const useStyles = makeStyles(() => ({ + message: { + overflowWrap: 'anywhere', + }, +})); + export const Reader = ({ entityId, onReady }: Props) => { const { kind, namespace, name } = entityId; const { '*': path } = useParams(); const theme = useTheme(); + const classes = useStyles(); const { state, @@ -369,6 +381,7 @@ export const Reader = ({ entityId, onReady }: Props) => { variant="outlined" severity="error" action={} + classes={{ message: classes.message }} > Building a newer version of this documentation failed.{' '} {syncErrorMessage} @@ -381,6 +394,7 @@ export const Reader = ({ entityId, onReady }: Props) => { variant="outlined" severity="error" action={} + classes={{ message: classes.message }} > Building a newer version of this documentation failed.{' '} {syncErrorMessage} From 73b7f246e4ff24179caffd56eb5cb49e3b2f83f3 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 15 Jul 2021 18:56:16 +0200 Subject: [PATCH 041/101] Fix testing for MUI breakpoints Signed-off-by: Philipp Hugenroth --- .../src/testUtils/mockBreakpoint.ts | 112 ++++-------------- .../CatalogPage/CatalogPage.test.tsx | 17 ++- .../FilteredTableLayout/FilterContainer.tsx | 3 +- 3 files changed, 36 insertions(+), 96 deletions(-) diff --git a/packages/test-utils/src/testUtils/mockBreakpoint.ts b/packages/test-utils/src/testUtils/mockBreakpoint.ts index 0e04f58f70..3335284f88 100644 --- a/packages/test-utils/src/testUtils/mockBreakpoint.ts +++ b/packages/test-utils/src/testUtils/mockBreakpoint.ts @@ -14,96 +14,30 @@ * limitations under the License. */ -import { act } from '@testing-library/react'; - -type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; - -const defaultBreakpoint: Breakpoint = 'xl'; - -const queryToBreakpoint = { - '(min-width:1920px)': 'xl', - '(min-width:1280px)': 'lg', - '(min-width:960px)': 'md', - '(min-width:600px)': 'sm', - '(min-width:0px)': 'xs', -} as Record; - /** - * Converts media query string to Breakpoint. - * Chooses the default breakpoint if no breakpoint is set in the media query. + * This is a mocking method suggested in the Jest Doc's, as it is not implemented in JSDOM yet. + * It can be used to mock values when the MUI `useMediaQuery` hook if it is used in a tested component. * - * @param query media query string - * @returns Breakpoint + * For issues checkout the documentation: + * https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom + * + * If there are any updates from MUI React on testing `useMediaQuery` this mock should be replaced + * https://material-ui.com/components/use-media-query/#testing + * + * @param matchMediaOptions */ -function toBreakpoint(query: string): Breakpoint { - return queryToBreakpoint[query] - ? queryToBreakpoint[query] - : defaultBreakpoint; -} - -type Listener = (event: { matches: boolean }) => void; - -interface QueryList { - addListener(listener: Listener): void; - removeListener(listener: Listener): void; - addEventListener(listener: Listener): void; - removeEventListener(listener: Listener): void; - matches: boolean; -} - -interface Query { - query: string; - queryList: QueryList; - listeners: Set; -} - -export default function mockBreakpoint( - initialBreakpoint: Breakpoint = defaultBreakpoint, -) { - let currentBreakpoint = initialBreakpoint; - const queries = Array(); - - const previousMatchMedia: any = (window as any).matchMedia; - - // https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom - (window as any).matchMedia = (query: string): QueryList => { - const listeners = new Set(); - - const queryList: QueryList = { - addListener(listener) { - listeners.add(listener); - }, - removeListener(listener) { - listeners.delete(listener); - }, - addEventListener(listener) { - listeners.add(listener); - }, - removeEventListener(listener) { - listeners.delete(listener); - }, - matches: toBreakpoint(query) === currentBreakpoint, - }; - - queries.push({ query, queryList, listeners }); - - return queryList; - }; - - return { - set(breakpoint: Breakpoint) { - currentBreakpoint = breakpoint; - - act(() => { - queries.forEach(({ query, queryList, listeners }) => { - const matches = toBreakpoint(query) === breakpoint; - queryList.matches = matches; - listeners.forEach(listener => listener({ matches })); - }); - }); - }, - remove() { - (window as any).matchMedia = previousMatchMedia; - }, - }; +export default function mockBreakpoint({ matches = false }) { + Object.defineProperty(window, 'matchMedia', { + writable: true, + value: jest.fn().mockImplementation(query => ({ + matches: matches, + media: query, + onchange: null, + addListener: jest.fn(), // deprecated + removeListener: jest.fn(), // deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), + })), + }); } diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index d5e31a16a7..db0613dc47 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -112,8 +112,6 @@ describe('CatalogPage', () => { getProfile: () => testProfile, }; - const { set: setBreakpoint } = mockBreakpoint(); - const renderWrapped = (children: React.ReactNode) => renderWithEffects( wrapInTestApp( @@ -248,9 +246,16 @@ describe('CatalogPage', () => { ).resolves.toBeInTheDocument(); }); - it('should wrap filter in accordion on smaller screens', async () => { - setBreakpoint('sm'); - const { findByText } = await renderWrapped(); - await expect(findByText(/Filters/)).resolves.toBeInTheDocument(); + it('should wrap filter in drawer on smaller screens', async () => { + mockBreakpoint({ matches: true }); + const { findByText, getByTestId } = await renderWrapped(); + expect(getByTestId('entity-filters-drawer')).toBeInTheDocument(); + await expect(findByText('Filters')).resolves.toBeInTheDocument(); + }); + + it('should wrap filter in grid on larger screens', async () => { + mockBreakpoint({ matches: false }); + const { getByTestId } = await renderWrapped(); + expect(getByTestId('entity-filters-grid')).toBeInTheDocument(); }); }); diff --git a/plugins/catalog/src/components/FilteredTableLayout/FilterContainer.tsx b/plugins/catalog/src/components/FilteredTableLayout/FilterContainer.tsx index a394393f64..0fa26f6c66 100644 --- a/plugins/catalog/src/components/FilteredTableLayout/FilterContainer.tsx +++ b/plugins/catalog/src/components/FilteredTableLayout/FilterContainer.tsx @@ -27,6 +27,7 @@ export const FilterContainer = ({ children }: React.PropsWithChildren<{}>) => { return isMidSizeScreen ? ( { toggleFiltersDrawer(false); @@ -43,7 +44,7 @@ export const FilterContainer = ({ children }: React.PropsWithChildren<{}>) => { {children} ) : ( - + {children} ); From 3b7ac8c9caab981a72d30447d1b6827cbd54cbee Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 15 Jul 2021 19:13:56 +0200 Subject: [PATCH 042/101] Fix styles to align text Signed-off-by: Philipp Hugenroth --- packages/core-components/src/layout/Header/Header.tsx | 1 - packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core-components/src/layout/Header/Header.tsx b/packages/core-components/src/layout/Header/Header.tsx index 572f1f8c32..41729f682b 100644 --- a/packages/core-components/src/layout/Header/Header.tsx +++ b/packages/core-components/src/layout/Header/Header.tsx @@ -56,7 +56,6 @@ const useStyles = makeStyles(theme => ({ }, title: { color: theme.palette.bursts.fontColor, - lineHeight: '1.0em', wordBreak: 'break-all', fontSize: 'calc(24px + 6 * ((100vw - 320px) / 680))', marginBottom: theme.spacing(1), diff --git a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx index c7adf23204..8c3df0ba72 100644 --- a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx +++ b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx @@ -29,7 +29,7 @@ const useStyles = makeStyles(theme => ({ letterSpacing: 0, fontSize: 14, height: '16px', - marginBottom: 2, + marginBottom: 4, }, value: { color: 'rgba(255, 255, 255, 0.8)', From 3ee8e758929a3b9b66f83ace341a7144eb3fff6d Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Thu, 15 Jul 2021 19:39:20 +0200 Subject: [PATCH 043/101] Updated test-utils API report Signed-off-by: Philipp Hugenroth --- packages/test-utils/api-report.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/test-utils/api-report.md b/packages/test-utils/api-report.md index d85db1feb7..187867d24f 100644 --- a/packages/test-utils/api-report.md +++ b/packages/test-utils/api-report.md @@ -15,16 +15,15 @@ import { RouteRef } from '@backstage/core-plugin-api'; import { StorageApi } from '@backstage/core-plugin-api'; import { StorageValueChange } from '@backstage/core-plugin-api'; -// Warning: (ae-forgotten-export) The symbol "Breakpoint" needs to be exported by the entry point index.d.ts +// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (ae-missing-release-tag) "mockBreakpoint" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // -// @public (undocumented) -export function mockBreakpoint( - initialBreakpoint?: Breakpoint, -): { - set(breakpoint: Breakpoint): void; - remove(): void; -}; +// @public +export function mockBreakpoint({ + matches, +}: { + matches?: boolean | undefined; +}): void; // Warning: (ae-missing-release-tag) "MockErrorApi" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // From 0e7fccb58bebae985fb2d8792d1a30e8c49f99a0 Mon Sep 17 00:00:00 2001 From: Jeff Feng Date: Thu, 15 Jul 2021 20:36:18 -0400 Subject: [PATCH 044/101] Updated footer with two links Added links to backstage.spotify.com and Community Sessions. Signed-off-by: Jeff Feng --- microsite/core/Footer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/microsite/core/Footer.js b/microsite/core/Footer.js index 8e69b7ff6f..1ea591b1d5 100644 --- a/microsite/core/Footer.js +++ b/microsite/core/Footer.js @@ -44,6 +44,10 @@ class Footer extends React.Component { Contributing + Adopting + + Community Sessions + Subscribe to our newsletter From 0aafc6d1557ebeb2ce3e21273ff6dd4624cac540 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 04:11:46 +0000 Subject: [PATCH 045/101] chore(deps): bump kafkajs from 1.16.0-beta.6 to 1.16.0-beta.21 Bumps [kafkajs](https://github.com/tulios/kafkajs) from 1.16.0-beta.6 to 1.16.0-beta.21. - [Release notes](https://github.com/tulios/kafkajs/releases) - [Changelog](https://github.com/tulios/kafkajs/blob/master/CHANGELOG.md) - [Commits](https://github.com/tulios/kafkajs/commits) --- updated-dependencies: - dependency-name: kafkajs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bc34978977..f8ebdf7e5a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16814,9 +16814,9 @@ jwt-decode@*, jwt-decode@^3.1.0: integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A== kafkajs@^1.16.0-beta.6: - version "1.16.0-beta.6" - resolved "https://registry.npmjs.org/kafkajs/-/kafkajs-1.16.0-beta.6.tgz#650f4d16abd60516aa0c375be613368391216df1" - integrity sha512-R4DT3s7oCAoxdq3tN8w2WkUxLXcZgLQSjQVSmEZpEmT6hVdZ5AUZWqyLYr1IRbQowsJK4Z7eWJAk68J0JiRlUw== + version "1.16.0-beta.21" + resolved "https://registry.npmjs.org/kafkajs/-/kafkajs-1.16.0-beta.21.tgz#5736bcef7b505714642a82d6dc0d1507fc0ae817" + integrity sha512-6iarOOnKTaei0EK+a+K2V/bBA7YgvpA69tZwnVF85PxGlvoG/wqKpfRNh2Mb04uiNTEwBYNEIO7hAFElEM6/AA== keytar@^5.4.0: version "5.6.0" From 2cabea24dcb7074c2f2214acd3fb7f7f2430f9e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 04:12:36 +0000 Subject: [PATCH 046/101] chore(deps): bump @typescript-eslint/eslint-plugin from 4.27.0 to 4.28.3 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.27.0 to 4.28.3. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.28.3/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/cli/package.json | 2 +- yarn.lock | 61 ++++++++++++++++++++++++++++++--------- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 81d7316dfb..ba4ce0b139 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -53,7 +53,7 @@ "@types/start-server-webpack-plugin": "^2.2.0", "@types/webpack-env": "^1.15.2", "@types/webpack-node-externals": "^2.5.0", - "@typescript-eslint/eslint-plugin": "^v4.27.0", + "@typescript-eslint/eslint-plugin": "^v4.28.3", "@typescript-eslint/parser": "^v4.27.0", "@yarnpkg/lockfile": "^1.1.0", "babel-plugin-dynamic-import-node": "^2.3.3", diff --git a/yarn.lock b/yarn.lock index bc34978977..e1d02ebd5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6733,29 +6733,28 @@ resolved "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== -"@typescript-eslint/eslint-plugin@^v4.27.0": - version "4.27.0" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.27.0.tgz#0b7fc974e8bc9b2b5eb98ed51427b0be529b4ad0" - integrity sha512-DsLqxeUfLVNp3AO7PC3JyaddmEHTtI9qTSAs+RB6ja27QvIM0TA8Cizn1qcS6vOu+WDLFJzkwkgweiyFhssDdQ== +"@typescript-eslint/eslint-plugin@^v4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.3.tgz#36cdcd9ca6f9e5cb49b9f61b970b1976708d084b" + integrity sha512-jW8sEFu1ZeaV8xzwsfi6Vgtty2jf7/lJmQmDkDruBjYAbx5DA8JtbcMnP0rNPUG+oH5GoQBTSp+9613BzuIpYg== dependencies: - "@typescript-eslint/experimental-utils" "4.27.0" - "@typescript-eslint/scope-manager" "4.27.0" + "@typescript-eslint/experimental-utils" "4.28.3" + "@typescript-eslint/scope-manager" "4.28.3" debug "^4.3.1" functional-red-black-tree "^1.0.1" - lodash "^4.17.21" regexpp "^3.1.0" semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/experimental-utils@4.27.0", "@typescript-eslint/experimental-utils@^4.0.1": - version "4.27.0" - resolved "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.27.0.tgz#78192a616472d199f084eab8f10f962c0757cd1c" - integrity sha512-n5NlbnmzT2MXlyT+Y0Jf0gsmAQzCnQSWXKy4RGSXVStjDvS5we9IWbh7qRVKdGcxT0WYlgcCYUK/HRg7xFhvjQ== +"@typescript-eslint/experimental-utils@4.28.3", "@typescript-eslint/experimental-utils@^4.0.1": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.3.tgz#976f8c1191b37105fd06658ed57ddfee4be361ca" + integrity sha512-zZYl9TnrxwEPi3FbyeX0ZnE8Hp7j3OCR+ELoUfbwGHGxWnHg9+OqSmkw2MoCVpZksPCZYpQzC559Ee9pJNHTQw== dependencies: "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.27.0" - "@typescript-eslint/types" "4.27.0" - "@typescript-eslint/typescript-estree" "4.27.0" + "@typescript-eslint/scope-manager" "4.28.3" + "@typescript-eslint/types" "4.28.3" + "@typescript-eslint/typescript-estree" "4.28.3" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -6777,11 +6776,24 @@ "@typescript-eslint/types" "4.27.0" "@typescript-eslint/visitor-keys" "4.27.0" +"@typescript-eslint/scope-manager@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.3.tgz#c32ad4491b3726db1ba34030b59ea922c214e371" + integrity sha512-/8lMisZ5NGIzGtJB+QizQ5eX4Xd8uxedFfMBXOKuJGP0oaBBVEMbJVddQKDXyyB0bPlmt8i6bHV89KbwOelJiQ== + dependencies: + "@typescript-eslint/types" "4.28.3" + "@typescript-eslint/visitor-keys" "4.28.3" + "@typescript-eslint/types@4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.27.0.tgz#712b408519ed699baff69086bc59cd2fc13df8d8" integrity sha512-I4ps3SCPFCKclRcvnsVA/7sWzh7naaM/b4pBO2hVxnM3wrU51Lveybdw5WoIktU/V4KfXrTt94V9b065b/0+wA== +"@typescript-eslint/types@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.28.3.tgz#8fffd436a3bada422c2c1da56060a0566a9506c7" + integrity sha512-kQFaEsQBQVtA9VGVyciyTbIg7S3WoKHNuOp/UF5RG40900KtGqfoiETWD/v0lzRXc+euVE9NXmfer9dLkUJrkA== + "@typescript-eslint/typescript-estree@4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.27.0.tgz#189a7b9f1d0717d5cccdcc17247692dedf7a09da" @@ -6795,6 +6807,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.3.tgz#253d7088100b2a38aefe3c8dd7bd1f8232ec46fb" + integrity sha512-YAb1JED41kJsqCQt1NcnX5ZdTA93vKFCMP4lQYG6CFxd0VzDJcKttRlMrlG+1qiWAw8+zowmHU1H0OzjWJzR2w== + dependencies: + "@typescript-eslint/types" "4.28.3" + "@typescript-eslint/visitor-keys" "4.28.3" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.27.0.tgz#f56138b993ec822793e7ebcfac6ffdce0a60cb81" @@ -6803,6 +6828,14 @@ "@typescript-eslint/types" "4.27.0" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.3.tgz#26ac91e84b23529968361045829da80a4e5251c4" + integrity sha512-ri1OzcLnk1HH4gORmr1dllxDzzrN6goUIz/P4MHFV0YZJDCADPR3RvYNp0PW2SetKTThar6wlbFTL00hV2Q+fg== + dependencies: + "@typescript-eslint/types" "4.28.3" + eslint-visitor-keys "^2.0.0" + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" From a4e905d9a5ac0b30858a8a0e56a468e81a5044cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 04:13:22 +0000 Subject: [PATCH 047/101] chore(deps): bump js-base64 from 3.6.0 to 3.6.1 Bumps [js-base64](https://github.com/dankogai/js-base64) from 3.6.0 to 3.6.1. - [Release notes](https://github.com/dankogai/js-base64/releases) - [Commits](https://github.com/dankogai/js-base64/compare/3.6.0...3.6.1) --- updated-dependencies: - dependency-name: js-base64 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index bc34978977..214d7c0fee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16281,9 +16281,9 @@ joycon@^2.2.5: integrity sha512-YqvUxoOcVPnCp0VU1/56f+iKSdvIRJYPznH22BdXV3xMk75SFXhWeJkZ8C9XxUWt1b5x2X1SxuFygW1U0FmkEQ== js-base64@^3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/js-base64/-/js-base64-3.6.0.tgz#773e1de628f4f298d65a7e9842c50244751f5756" - integrity sha512-wVdUBYQeY2gY73RIlPrysvpYx+2vheGo8Y1SNQv/BzHToWpAZzJU7Z6uheKMAe+GLSBig5/Ps2nxg/8tRB73xg== + version "3.6.1" + resolved "https://registry.npmjs.org/js-base64/-/js-base64-3.6.1.tgz#555aae398b74694b4037af1f8a5a6209d170efbe" + integrity sha512-Frdq2+tRRGLQUIQOgsIGSCd1VePCS2fsddTG5dTCqR0JHgltXWfsxnY0gIXPoMeRmdom6Oyq+UMOFg5suduOjQ== js-cookie@^2.2.1: version "2.2.1" From d6a01dc222b1b2bd87fa4b82ce2fef9156e008dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 04:13:59 +0000 Subject: [PATCH 048/101] chore(deps-dev): bump @types/d3-shape from 2.1.0 to 3.0.1 Bumps [@types/d3-shape](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/d3-shape) from 2.1.0 to 3.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/d3-shape) --- updated-dependencies: - dependency-name: "@types/d3-shape" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/core-components/package.json | 2 +- yarn.lock | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/core-components/package.json b/packages/core-components/package.json index b9d514d074..0bd4b95134 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -78,7 +78,7 @@ "@testing-library/user-event": "^13.1.8", "@types/classnames": "^2.2.9", "@types/d3-selection": "^2.0.0", - "@types/d3-shape": "^2.0.0", + "@types/d3-shape": "^3.0.1", "@types/d3-zoom": "^2.0.0", "@types/google-protobuf": "^3.7.2", "@types/jest": "^26.0.7", diff --git a/yarn.lock b/yarn.lock index bc34978977..2eece5dec8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5579,6 +5579,11 @@ dependencies: "@types/d3-color" "*" +"@types/d3-path@*": + version "3.0.0" + resolved "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.0.0.tgz#939e3a784ae4f80b1fde8098b91af1776ff1312b" + integrity sha512-0g/A+mZXgFkQxN3HniRDbXMN79K3CdTpLsevj+PXiTcb2hVyvkZUBg37StmgCQkaD84cUJ4uaDAWq7UJOQy2Tg== + "@types/d3-path@^1": version "1.0.9" resolved "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.9.tgz#73526b150d14cd96e701597cbf346cfd1fd4a58c" @@ -5596,12 +5601,12 @@ dependencies: "@types/d3-path" "^1" -"@types/d3-shape@^2.0.0": - version "2.1.0" - resolved "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-2.1.0.tgz#cc7bbc9fc2c25f092bd457887a3224a21a55ca55" - integrity sha512-xTMEs8eITRksXclcVxMHIONRdyjj2TjDIwO4XFOPTVBNK9/oC4ZOhUbvTz1IpcsEsS/mClwuulP+OoawSAbSGA== +"@types/d3-shape@^3.0.1": + version "3.0.1" + resolved "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.0.1.tgz#8cebf5f3d56dd81674e1822279db58a38848a250" + integrity sha512-HnpwE2zl45cOaXLLo0zR4OfRQM9u9sI/ESb0w41PrrsQfkibj8pVIS8VYMSem2Wf5RuWxcgy3/8Kw2/FcIqAEQ== dependencies: - "@types/d3-path" "^1" + "@types/d3-path" "*" "@types/d3-zoom@^2.0.0": version "2.0.1" From eb740ee24ce54c5501768d43215b990b43729df1 Mon Sep 17 00:00:00 2001 From: Joe Porpeglia Date: Thu, 8 Jul 2021 17:53:10 -0400 Subject: [PATCH 049/101] Use new location for sample software templates Signed-off-by: Joe Porpeglia --- .changeset/wicked-emus-deny.md | 8 ++++++++ .../templates/default-app/app-config.yaml.hbs | 6 +++--- .../sample-templates/all-templates.yaml | 1 - .../sample-templates/local-templates.yaml | 13 ------------- .../sample-templates/remote-templates.yaml | 6 ++++++ 5 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 .changeset/wicked-emus-deny.md delete mode 100644 plugins/scaffolder-backend/sample-templates/local-templates.yaml diff --git a/.changeset/wicked-emus-deny.md b/.changeset/wicked-emus-deny.md new file mode 100644 index 0000000000..2f8fb2a178 --- /dev/null +++ b/.changeset/wicked-emus-deny.md @@ -0,0 +1,8 @@ +--- +'@backstage/create-app': minor +'@backstage/plugin-scaffolder-backend': minor +--- + +Use new location for sample software templates + +See https://github.com/backstage/software-templates diff --git a/packages/create-app/templates/default-app/app-config.yaml.hbs b/packages/create-app/templates/default-app/app-config.yaml.hbs index 9a04f38c14..81e4c3a739 100644 --- a/packages/create-app/templates/default-app/app-config.yaml.hbs +++ b/packages/create-app/templates/default-app/app-config.yaml.hbs @@ -100,11 +100,11 @@ catalog: # Backstage example templates - type: url - target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml + target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/react-ssr-template/template.yaml rules: - allow: [Template] - type: url - target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/template.yaml + target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/springboot-grpc-template/template.yaml rules: - allow: [Template] - type: url @@ -112,6 +112,6 @@ catalog: rules: - allow: [Template] - type: url - target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/docs-template/template.yaml + target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/docs-template/template.yaml rules: - allow: [Template] diff --git a/plugins/scaffolder-backend/sample-templates/all-templates.yaml b/plugins/scaffolder-backend/sample-templates/all-templates.yaml index a5bcd864b1..fdea8dbd7d 100644 --- a/plugins/scaffolder-backend/sample-templates/all-templates.yaml +++ b/plugins/scaffolder-backend/sample-templates/all-templates.yaml @@ -5,5 +5,4 @@ metadata: description: A collection of all Backstage example templates spec: targets: - - ./local-templates.yaml - ./remote-templates.yaml diff --git a/plugins/scaffolder-backend/sample-templates/local-templates.yaml b/plugins/scaffolder-backend/sample-templates/local-templates.yaml deleted file mode 100644 index 3b3acbae7e..0000000000 --- a/plugins/scaffolder-backend/sample-templates/local-templates.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: backstage.io/v1alpha1 -kind: Location -metadata: - name: example-templates-local - description: A collection of locally available Backstage example templates -spec: - targets: - - ./docs-template/template.yaml - - ./react-ssr-template/template.yaml - - ./create-react-app/template.yaml - - ./springboot-grpc-template/template.yaml - - ./v1beta2-demo/template.yaml - - ./pull-request/template.yaml diff --git a/plugins/scaffolder-backend/sample-templates/remote-templates.yaml b/plugins/scaffolder-backend/sample-templates/remote-templates.yaml index 7846a0994e..518a982d69 100644 --- a/plugins/scaffolder-backend/sample-templates/remote-templates.yaml +++ b/plugins/scaffolder-backend/sample-templates/remote-templates.yaml @@ -7,3 +7,9 @@ spec: type: url targets: - https://github.com/spotify/cookiecutter-golang/blob/master/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/create-react-app/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/docs-template/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/pull-request/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/react-ssr-template/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/springboot-grpc-template/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/v1beta2-demo/template.yaml From cb41e2c1ec2499ae4634e283aaac0a3654302d9e Mon Sep 17 00:00:00 2001 From: Joe Porpeglia Date: Fri, 9 Jul 2021 11:17:32 -0400 Subject: [PATCH 050/101] Update .changeset/wicked-emus-deny.md Co-authored-by: Tim Signed-off-by: Joe Porpeglia --- .changeset/wicked-emus-deny.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/wicked-emus-deny.md b/.changeset/wicked-emus-deny.md index 2f8fb2a178..fe28197b58 100644 --- a/.changeset/wicked-emus-deny.md +++ b/.changeset/wicked-emus-deny.md @@ -3,6 +3,6 @@ '@backstage/plugin-scaffolder-backend': minor --- -Use new location for sample software templates +Moved sample software templates to the [backstage/software-templates](https://github.com/backstage/software-templates) repository. If you previously referenced the sample templates straight from `scaffolder-backend` plugin in the main [backstage/backstage](https://github.com/backstage/backstage) repository in your `app-config.yaml`, these references will need to be updated. See https://github.com/backstage/software-templates From 1a8cde90998184437088412b8b84f144fc1e38f9 Mon Sep 17 00:00:00 2001 From: Joe Porpeglia Date: Fri, 9 Jul 2021 11:24:07 -0400 Subject: [PATCH 051/101] Point to specific commit for sample templates Signed-off-by: Joe Porpeglia --- .../templates/default-app/app-config.yaml.hbs | 6 +++--- .../sample-templates/remote-templates.yaml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/create-app/templates/default-app/app-config.yaml.hbs b/packages/create-app/templates/default-app/app-config.yaml.hbs index 81e4c3a739..404de57f01 100644 --- a/packages/create-app/templates/default-app/app-config.yaml.hbs +++ b/packages/create-app/templates/default-app/app-config.yaml.hbs @@ -100,11 +100,11 @@ catalog: # Backstage example templates - type: url - target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/react-ssr-template/template.yaml + target: https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/react-ssr-template/template.yaml rules: - allow: [Template] - type: url - target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/springboot-grpc-template/template.yaml + target: https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/springboot-grpc-template/template.yaml rules: - allow: [Template] - type: url @@ -112,6 +112,6 @@ catalog: rules: - allow: [Template] - type: url - target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/docs-template/template.yaml + target: https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/docs-template/template.yaml rules: - allow: [Template] diff --git a/plugins/scaffolder-backend/sample-templates/remote-templates.yaml b/plugins/scaffolder-backend/sample-templates/remote-templates.yaml index 518a982d69..82a5df134b 100644 --- a/plugins/scaffolder-backend/sample-templates/remote-templates.yaml +++ b/plugins/scaffolder-backend/sample-templates/remote-templates.yaml @@ -7,9 +7,9 @@ spec: type: url targets: - https://github.com/spotify/cookiecutter-golang/blob/master/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/create-react-app/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/docs-template/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/pull-request/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/react-ssr-template/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/springboot-grpc-template/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/v1beta2-demo/template.yaml + - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/create-react-app/template.yaml + - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/docs-template/template.yaml + - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/pull-request/template.yaml + - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/react-ssr-template/template.yaml + - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/springboot-grpc-template/template.yaml + - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/v1beta2-demo/template.yaml From 1165398a9fadc4dbe73c4e0f19af8481c99afb5c Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Fri, 16 Jul 2021 11:07:26 +0200 Subject: [PATCH 052/101] Revert "Point to specific commit for sample templates" Hashes don't work with Scaffolder. Signed-off-by: Himanshu Mishra --- .../templates/default-app/app-config.yaml.hbs | 6 +++--- .../sample-templates/remote-templates.yaml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/create-app/templates/default-app/app-config.yaml.hbs b/packages/create-app/templates/default-app/app-config.yaml.hbs index 404de57f01..81e4c3a739 100644 --- a/packages/create-app/templates/default-app/app-config.yaml.hbs +++ b/packages/create-app/templates/default-app/app-config.yaml.hbs @@ -100,11 +100,11 @@ catalog: # Backstage example templates - type: url - target: https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/react-ssr-template/template.yaml + target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/react-ssr-template/template.yaml rules: - allow: [Template] - type: url - target: https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/springboot-grpc-template/template.yaml + target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/springboot-grpc-template/template.yaml rules: - allow: [Template] - type: url @@ -112,6 +112,6 @@ catalog: rules: - allow: [Template] - type: url - target: https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/docs-template/template.yaml + target: https://github.com/backstage/software-templates/blob/master/scaffolder-templates/docs-template/template.yaml rules: - allow: [Template] diff --git a/plugins/scaffolder-backend/sample-templates/remote-templates.yaml b/plugins/scaffolder-backend/sample-templates/remote-templates.yaml index 82a5df134b..518a982d69 100644 --- a/plugins/scaffolder-backend/sample-templates/remote-templates.yaml +++ b/plugins/scaffolder-backend/sample-templates/remote-templates.yaml @@ -7,9 +7,9 @@ spec: type: url targets: - https://github.com/spotify/cookiecutter-golang/blob/master/template.yaml - - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/create-react-app/template.yaml - - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/docs-template/template.yaml - - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/pull-request/template.yaml - - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/react-ssr-template/template.yaml - - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/springboot-grpc-template/template.yaml - - https://github.com/backstage/software-templates/blob/3bdd183f052f5971379a4bbfe658829de366decb/scaffolder-templates/v1beta2-demo/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/create-react-app/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/docs-template/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/pull-request/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/react-ssr-template/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/springboot-grpc-template/template.yaml + - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/v1beta2-demo/template.yaml From 4ea7cd583b7eb9622683fd6d3922611b7da1ea6a Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Fri, 16 Jul 2021 11:07:26 +0200 Subject: [PATCH 053/101] chore: update changeset to be patch changes Signed-off-by: Himanshu Mishra --- .changeset/wicked-emus-deny.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/wicked-emus-deny.md b/.changeset/wicked-emus-deny.md index fe28197b58..ff6788dbb2 100644 --- a/.changeset/wicked-emus-deny.md +++ b/.changeset/wicked-emus-deny.md @@ -1,6 +1,6 @@ --- -'@backstage/create-app': minor -'@backstage/plugin-scaffolder-backend': minor +'@backstage/create-app': patch +'@backstage/plugin-scaffolder-backend': patch --- Moved sample software templates to the [backstage/software-templates](https://github.com/backstage/software-templates) repository. If you previously referenced the sample templates straight from `scaffolder-backend` plugin in the main [backstage/backstage](https://github.com/backstage/backstage) repository in your `app-config.yaml`, these references will need to be updated. From 8b135fa79b39db8daebabc0307b90f1c893bb5d6 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Fri, 16 Jul 2021 11:07:26 +0200 Subject: [PATCH 054/101] update remote urls to use main branch Signed-off-by: Himanshu Mishra --- .../sample-templates/remote-templates.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/scaffolder-backend/sample-templates/remote-templates.yaml b/plugins/scaffolder-backend/sample-templates/remote-templates.yaml index 518a982d69..81787b4297 100644 --- a/plugins/scaffolder-backend/sample-templates/remote-templates.yaml +++ b/plugins/scaffolder-backend/sample-templates/remote-templates.yaml @@ -7,9 +7,9 @@ spec: type: url targets: - https://github.com/spotify/cookiecutter-golang/blob/master/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/create-react-app/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/docs-template/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/pull-request/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/react-ssr-template/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/springboot-grpc-template/template.yaml - - https://github.com/backstage/software-templates/blob/master/scaffolder-templates/v1beta2-demo/template.yaml + - https://github.com/backstage/software-templates/blob/main/scaffolder-templates/create-react-app/template.yaml + - https://github.com/backstage/software-templates/blob/main/scaffolder-templates/docs-template/template.yaml + - https://github.com/backstage/software-templates/blob/main/scaffolder-templates/pull-request/template.yaml + - https://github.com/backstage/software-templates/blob/main/scaffolder-templates/react-ssr-template/template.yaml + - https://github.com/backstage/software-templates/blob/main/scaffolder-templates/springboot-grpc-template/template.yaml + - https://github.com/backstage/software-templates/blob/main/scaffolder-templates/v1beta2-demo/template.yaml From 529fd3285b5ac2c87c9dcc2541f266f7163f83bb Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Fri, 16 Jul 2021 11:07:26 +0200 Subject: [PATCH 055/101] add an example of working with a local template Signed-off-by: Himanshu Mishra --- .../scaffolder-backend/sample-templates/all-templates.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/scaffolder-backend/sample-templates/all-templates.yaml b/plugins/scaffolder-backend/sample-templates/all-templates.yaml index fdea8dbd7d..2d5adb8e3b 100644 --- a/plugins/scaffolder-backend/sample-templates/all-templates.yaml +++ b/plugins/scaffolder-backend/sample-templates/all-templates.yaml @@ -6,3 +6,9 @@ metadata: spec: targets: - ./remote-templates.yaml + +# For local development of a template, you can reference your local templates here. +# Examples: +# +# - ./local-template/template.yaml +# - ../all-templates/local/template.yaml From ea249c6e6334916faab4ee4afa7c0b6f63a2e9af Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 16 Jul 2021 12:00:44 +0200 Subject: [PATCH 056/101] core-app-api: fix root route handling in FlatRoutes Signed-off-by: Patrik Oldsberg --- .changeset/forty-singers-look.md | 5 +++++ packages/core-app-api/src/routing/FlatRoutes.test.tsx | 5 ++++- packages/core-app-api/src/routing/FlatRoutes.tsx | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/forty-singers-look.md diff --git a/.changeset/forty-singers-look.md b/.changeset/forty-singers-look.md new file mode 100644 index 0000000000..1b3919e214 --- /dev/null +++ b/.changeset/forty-singers-look.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-app-api': patch +--- + +Fix a bug in `FlatRoutes` that prevented outlets from working with the root route, as well as matching root routes too broadly. diff --git a/packages/core-app-api/src/routing/FlatRoutes.test.tsx b/packages/core-app-api/src/routing/FlatRoutes.test.tsx index a73534a272..d5201a6f57 100644 --- a/packages/core-app-api/src/routing/FlatRoutes.test.tsx +++ b/packages/core-app-api/src/routing/FlatRoutes.test.tsx @@ -100,7 +100,6 @@ describe('FlatRoutes', () => { return <>Outlet: {useOutlet()}; }; - // The '/*' suffixes here are intentional and will be ignored by FlatRoutes const routes = ( <> }> @@ -112,11 +111,15 @@ describe('FlatRoutes', () => { }> b + }> + c + ); const renderRoute = makeRouteRenderer({routes}); expect(renderRoute('/a').getByText('Outlet: a')).toBeInTheDocument(); expect(renderRoute('/a/b').getByText('Outlet: a-b')).toBeInTheDocument(); expect(renderRoute('/b').getByText('Outlet: b')).toBeInTheDocument(); + expect(renderRoute('/').getByText('Outlet: c')).toBeInTheDocument(); }); }); diff --git a/packages/core-app-api/src/routing/FlatRoutes.tsx b/packages/core-app-api/src/routing/FlatRoutes.tsx index 6ba82203fd..315ec91cdb 100644 --- a/packages/core-app-api/src/routing/FlatRoutes.tsx +++ b/packages/core-app-api/src/routing/FlatRoutes.tsx @@ -49,8 +49,10 @@ export const FlatRoutes = (props: FlatRoutesProps): JSX.Element | null => { element: child, children: child.props.children ? [ + // These are the children of each route, which we all add in under a catch-all + // subroute in order to make them available to `useOutlet` { - path: '/*', + path: path === '/' ? '/' : '/*', // The root path must require an exact match element: child.props.children, }, ] From 920bcce5b31a4feeebaf91973884f89c9dc41e10 Mon Sep 17 00:00:00 2001 From: irma12 Date: Fri, 16 Jul 2021 11:59:18 +0200 Subject: [PATCH 057/101] Update dependecies from roadie Signed-off-by: irma12 --- packages/app/package.json | 8 +- yarn.lock | 557 +++++++++++++++++++++++++++++++++----- 2 files changed, 498 insertions(+), 67 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index d86e0f27e9..69c4c9475b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -43,10 +43,10 @@ "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@octokit/rest": "^18.5.3", - "@roadiehq/backstage-plugin-buildkite": "^1.0.4", - "@roadiehq/backstage-plugin-github-insights": "^1.1.15", - "@roadiehq/backstage-plugin-github-pull-requests": "^1.0.8", - "@roadiehq/backstage-plugin-travis-ci": "^1.0.4", + "@roadiehq/backstage-plugin-buildkite": "^1.0.5", + "@roadiehq/backstage-plugin-github-insights": "^1.1.16", + "@roadiehq/backstage-plugin-github-pull-requests": "^1.0.9", + "@roadiehq/backstage-plugin-travis-ci": "^1.0.5", "history": "^5.0.0", "prop-types": "^15.7.2", "react": "^16.12.0", diff --git a/yarn.lock b/yarn.lock index 8924ac8e73..651598d0fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1348,7 +1348,7 @@ "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" -"@backstage/catalog-model@^0.8.4": +"@backstage/catalog-model@^0.8.0": version "0.9.0" dependencies: "@backstage/config" "^0.1.5" @@ -1361,6 +1361,113 @@ uuid "^8.0.0" yup "^0.29.3" +"@backstage/catalog-model@^0.8.1": + version "0.9.0" + dependencies: + "@backstage/config" "^0.1.5" + "@backstage/errors" "^0.1.1" + "@types/json-schema" "^7.0.5" + "@types/yup" "^0.29.8" + ajv "^7.0.3" + json-schema "^0.3.0" + lodash "^4.17.15" + uuid "^8.0.0" + yup "^0.29.3" + +"@backstage/cli@^0.6.12": + version "0.6.14" + resolved "https://registry.npmjs.org/@backstage/cli/-/cli-0.6.14.tgz#4ca8df63eecdd0f1d3c09b8d89c9616401d6f2e0" + integrity sha512-MfLn/haoViq9hLCny/pa8qUlDZzuaIhWvkYuDEGSnNTz5AwKSBwPD0QVa6OQCTaU4XAX5nUXVpm7hIWuUQSM5Q== + dependencies: + "@babel/core" "^7.4.4" + "@babel/plugin-transform-modules-commonjs" "^7.4.4" + "@backstage/cli-common" "^0.1.1" + "@backstage/config" "^0.1.5" + "@backstage/config-loader" "^0.6.3" + "@hot-loader/react-dom" "^16.13.0" + "@lerna/package-graph" "^4.0.0" + "@lerna/project" "^4.0.0" + "@octokit/request" "^5.4.12" + "@rollup/plugin-commonjs" "^17.1.0" + "@rollup/plugin-json" "^4.0.2" + "@rollup/plugin-node-resolve" "^11.2.0" + "@rollup/plugin-yaml" "^2.1.1" + "@spotify/eslint-config-base" "^9.0.0" + "@spotify/eslint-config-react" "^10.0.0" + "@spotify/eslint-config-typescript" "^9.0.0" + "@sucrase/webpack-loader" "^2.0.0" + "@svgr/plugin-jsx" "5.5.x" + "@svgr/plugin-svgo" "5.4.x" + "@svgr/rollup" "5.5.x" + "@svgr/webpack" "5.5.x" + "@types/start-server-webpack-plugin" "^2.2.0" + "@types/webpack-env" "^1.15.2" + "@types/webpack-node-externals" "^2.5.0" + "@typescript-eslint/eslint-plugin" "^v4.15.2" + "@typescript-eslint/parser" "^v4.14.0" + "@yarnpkg/lockfile" "^1.1.0" + babel-plugin-dynamic-import-node "^2.3.3" + bfj "^7.0.2" + chalk "^4.0.0" + chokidar "^3.3.1" + commander "^6.1.0" + css-loader "^3.5.3" + dashify "^2.0.0" + diff "^5.0.0" + esbuild "^0.8.56" + eslint "^7.1.0" + eslint-config-prettier "^8.3.0" + eslint-formatter-friendly "^7.0.0" + eslint-plugin-import "^2.20.2" + eslint-plugin-jest "^24.1.0" + eslint-plugin-jsx-a11y "^6.2.1" + eslint-plugin-monorepo "^0.3.2" + eslint-plugin-react "^7.12.4" + eslint-plugin-react-hooks "^4.0.0" + express "^4.17.1" + file-loader "^6.2.0" + fork-ts-checker-webpack-plugin "^6.2.9" + fs-extra "^9.0.0" + handlebars "^4.7.3" + html-webpack-plugin "^4.3.0" + inquirer "^7.0.4" + jest "^26.0.1" + jest-css-modules "^2.1.0" + json-schema "^0.3.0" + lodash "^4.17.19" + mini-css-extract-plugin "^0.9.0" + ora "^5.3.0" + postcss "^8.1.0" + raw-loader "^4.0.1" + react "^16.0.0" + react-dev-utils "^11.0.4" + react-hot-loader "^4.12.21" + recursive-readdir "^2.2.2" + replace-in-file "^6.0.0" + rollup "2.33.x" + rollup-plugin-dts "^2.0.1" + rollup-plugin-esbuild "2.6.x" + rollup-plugin-peer-deps-external "^2.2.2" + rollup-plugin-postcss "^4.0.0" + rollup-pluginutils "^2.8.2" + semver "^7.3.2" + start-server-webpack-plugin "^2.2.5" + style-loader "^1.2.1" + sucrase "^3.17.1" + tar "^6.0.1" + terser-webpack-plugin "^1.4.3" + ts-jest "^26.4.3" + ts-loader "^8.0.17" + typescript "^4.0.3" + url-loader "^4.1.0" + webpack "^4.41.6" + webpack-dev-server "3.11.0" + webpack-node-externals "^3.0.0" + yaml "^1.10.0" + yaml-jest "^1.0.5" + yml-loader "^2.1.0" + yn "^4.0.0" + "@backstage/core-api@^0.2.23": version "0.2.23" resolved "https://registry.npmjs.org/@backstage/core-api/-/core-api-0.2.23.tgz#c0ec13407ff7c78d376eb18e9d8e1490d54d995b" @@ -1379,7 +1486,7 @@ react-use "^17.2.4" zen-observable "^0.8.15" -"@backstage/core@*": +"@backstage/core@*", "@backstage/core@^0.7.11", "@backstage/core@^0.7.12": version "0.7.14" resolved "https://registry.npmjs.org/@backstage/core/-/core-0.7.14.tgz#863844fe40bb6a29bcc2d297e42055633b0e886f" integrity sha512-W7EMspBXrp1GPALK6+qdJjsvkqcaYGFyoh8/bRAXABIkJpGQGiy4xUZUKDoMhd+OdVHv/mzyyv3fH2yc32J07w== @@ -1425,7 +1532,30 @@ remark-gfm "^1.0.0" zen-observable "^0.8.15" -"@backstage/plugin-catalog-react@^0.2.0", "@backstage/plugin-catalog-react@^0.2.4": +"@backstage/dev-utils@^0.1.15": + version "0.1.17" + resolved "https://registry.npmjs.org/@backstage/dev-utils/-/dev-utils-0.1.17.tgz#bbb539048b72f2e0a45d99179a87e9efe0f2de20" + integrity sha512-isXZ8gTCVoKDk0CeAtsCRKRNvFmFfE9gcJuZFl5soCjgdvdW073fZ/+PpWAfP8kfQA/ThJqh5s0IvkhFSr/IYA== + dependencies: + "@backstage/catalog-model" "^0.8.1" + "@backstage/core" "^0.7.12" + "@backstage/integration-react" "^0.1.2" + "@backstage/plugin-catalog-react" "^0.2.1" + "@backstage/test-utils" "^0.1.13" + "@backstage/theme" "^0.2.8" + "@material-ui/core" "^4.11.0" + "@material-ui/icons" "^4.9.1" + "@testing-library/jest-dom" "^5.10.1" + "@testing-library/react" "^11.2.5" + "@testing-library/user-event" "^13.1.8" + "@types/react" "^16.9" + react "^16.12.0" + react-dom "^16.12.0" + react-hot-loader "^4.12.21" + react-router "6.0.0-beta.0" + react-router-dom "6.0.0-beta.0" + +"@backstage/plugin-catalog-react@^0.2.0", "@backstage/plugin-catalog-react@^0.2.1": version "0.2.6" resolved "https://registry.npmjs.org/@backstage/plugin-catalog-react/-/plugin-catalog-react-0.2.6.tgz#4e3a0ea9394f163c95df97b72511f2bd2277f40a" integrity sha512-loSYkm6aZKFn5gJ0xy9A3Ii3czSgA5ZRhCchqcN3ViSsipJLUbQt2TtMc8Tyk2h0e8AyRhyteEkcrnPGQqGXlQ== @@ -3602,7 +3732,7 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" -"@mswjs/cookies@^0.1.5": +"@mswjs/cookies@^0.1.4", "@mswjs/cookies@^0.1.5": version "0.1.6" resolved "https://registry.npmjs.org/@mswjs/cookies/-/cookies-0.1.6.tgz#176f77034ab6d7373ae5c94bcbac36fee8869249" integrity sha512-A53XD5TOfwhpqAmwKdPtg1dva5wrng2gH5xMvklzbd9WLTSVU953eCRa8rtrrm6G7Cy60BOGsBRN89YQK0mlKA== @@ -3621,6 +3751,16 @@ strict-event-emitter "^0.2.0" xmldom "^0.6.0" +"@mswjs/interceptors@^0.8.0": + version "0.8.1" + resolved "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.8.1.tgz#8ef43a8b7b25c7b9a2bac67b3702167e25e5fc07" + integrity sha512-OI9FYmtURESZG3QDNz4Yt3osy3HY4T3FjlRw+AG4QS1UDdTSZ0tuPFAkp23nGR9ojmbSSj4gSMjf5+R8Oi/qtQ== + dependencies: + "@open-draft/until" "^1.0.3" + debug "^4.3.0" + headers-utils "^3.0.2" + strict-event-emitter "^0.2.0" + "@n1ru4l/push-pull-async-iterable-iterator@^2.0.1": version "2.1.2" resolved "https://registry.npmjs.org/@n1ru4l/push-pull-async-iterable-iterator/-/push-pull-async-iterable-iterator-2.1.2.tgz#e486bf86c4c29e78601694a26f31c2dec0c08d9b" @@ -4030,16 +4170,16 @@ resolved "https://registry.npmjs.org/@rjsf/material-ui/-/material-ui-3.0.0.tgz#69ece2cb549f0e860b5f89898db90edcc95b15ba" integrity sha512-T2B8QnrDQphbFNxDz7baAa0zTd5TXJmO9soHBPTKKdniRbMEOQ19AJBbZkA3ED2XZa/xrUY/6XjERQLpNACddw== -"@roadiehq/backstage-plugin-buildkite@^1.0.4": - version "1.0.4" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-buildkite/-/backstage-plugin-buildkite-1.0.4.tgz#8bd89d235c12b0093dd8c35d5397d8332bb62df0" - integrity sha512-SkPJzkLhVo1vMM76EShJRRQegXFKkY1bf1TMVIqR2Cm3E9QXHyN099+dSimFW8f5uyNioEHuRkSh7Iwm7AZekA== +"@roadiehq/backstage-plugin-buildkite@^1.0.5": + version "1.0.5" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-buildkite/-/backstage-plugin-buildkite-1.0.5.tgz#8f321e6190a9fcfe8a38677b3b4d2b4aefad2392" + integrity sha512-bxKBl3KBgrxHVWo1RB6r03ekkt9dGjHsT0b13sxDxccHZvSME4MPN+J/Z+C/pNMrfD1nEKar5G74j6B5ZvKKVQ== dependencies: - "@backstage/catalog-model" "^0.8.4" + "@backstage/catalog-model" "^0.9.0" "@backstage/core-app-api" "^0.1.3" "@backstage/core-components" "^0.1.3" "@backstage/core-plugin-api" "^0.1.3" - "@backstage/plugin-catalog-react" "^0.2.4" + "@backstage/plugin-catalog-react" "^0.3.0" "@backstage/theme" "^0.2.6" "@material-ui/core" "^4.11.3" "@material-ui/icons" "^4.11.2" @@ -4053,16 +4193,16 @@ react-router-dom "6.0.0-beta.0" react-use "^17.2.4" -"@roadiehq/backstage-plugin-github-insights@^1.1.15": - version "1.1.15" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-insights/-/backstage-plugin-github-insights-1.1.15.tgz#ef033f85c54f5203a2bc161290f46e861dc6feca" - integrity sha512-UH8lvDZd1OVP6fX+mF0eTrxqo/QmGWiCWvxumxkyU61sF3XkXzEqhQDKlWWEtpGLPa++yf98p00wfSeXRfjRWA== +"@roadiehq/backstage-plugin-github-insights@^1.1.16": + version "1.1.19" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-insights/-/backstage-plugin-github-insights-1.1.19.tgz#bb16ba014b7b9a474347b0178fc9757b8723e346" + integrity sha512-LM8sSvIXZIciBIPt/7TLCGOmXHmAsAkSzvFJdTeEa54lsHk29FabMgY3cOKuoq04GMq/zJHoGJudFT1g26rX8g== dependencies: - "@backstage/catalog-model" "^0.8.4" + "@backstage/catalog-model" "^0.9.0" "@backstage/core-app-api" "^0.1.3" "@backstage/core-components" "^0.1.3" "@backstage/core-plugin-api" "^0.1.3" - "@backstage/plugin-catalog-react" "^0.2.0" + "@backstage/plugin-catalog-react" "^0.3.0" "@backstage/theme" "^0.2.7" "@date-io/core" "2.10.7" "@material-ui/core" "^4.11.0" @@ -4076,16 +4216,16 @@ react-router "^6.0.0-beta.0" react-use "^17.2.4" -"@roadiehq/backstage-plugin-github-pull-requests@^1.0.8": - version "1.0.8" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-1.0.8.tgz#7d6202ec60808156058bd2d335f7df332934ae56" - integrity sha512-g1CudaKX1NYW0wfbtjcZxFWmDMfw1IvpJD4ymmwZmsogBOHFknlowVmwwSL4W4LwK6IPypIZkOe95Vd2PrjO+Q== +"@roadiehq/backstage-plugin-github-pull-requests@^1.0.9": + version "1.0.9" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-1.0.9.tgz#b34af093aa5cc803a1133b582dea28912ef39e5a" + integrity sha512-3hCUfFFHGxr8WIicPBXW2rVuriH5rlXpRvU1OSvuvWJiEmqkFj/F8wYrB59ahH5Q8vdQg5jCgih0sbPuPZOojw== dependencies: - "@backstage/catalog-model" "^0.8.4" + "@backstage/catalog-model" "^0.9.0" "@backstage/core-app-api" "^0.1.3" "@backstage/core-components" "^0.1.3" "@backstage/core-plugin-api" "^0.1.3" - "@backstage/plugin-catalog-react" "^0.2.0" + "@backstage/plugin-catalog-react" "^0.3.0" "@material-ui/core" "^4.11.0" "@material-ui/icons" "^4.9.1" "@octokit/rest" "^18.5.3" @@ -4099,16 +4239,16 @@ react-router "6.0.0-beta.0" react-use "^17.2.4" -"@roadiehq/backstage-plugin-travis-ci@^1.0.4": - version "1.0.4" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-travis-ci/-/backstage-plugin-travis-ci-1.0.4.tgz#224d17749b6bb33fbc5bf50489d7e7a87b06aa3a" - integrity sha512-rSMB+ZuI9xXIwgqJv7NW/wt3ulZa9rSLsCzkMO30/6/TMbenmsIyfmIP9XI32D9mPew4dVX9spi6KsgEo41WHw== +"@roadiehq/backstage-plugin-travis-ci@^1.0.5": + version "1.0.7" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-travis-ci/-/backstage-plugin-travis-ci-1.0.7.tgz#ab6fd3522cb4293df7ed3045863561a29000a146" + integrity sha512-couVtM6zP+LKwall9f1rST7Y1DcViEl42ZeKxf+uLmJLMMoUVnayw+zPAf5/DdkUA6eThX6gvQRx5O1W87ECrg== dependencies: - "@backstage/catalog-model" "^0.8.4" + "@backstage/catalog-model" "^0.9.0" "@backstage/core-app-api" "^0.1.3" "@backstage/core-components" "^0.1.3" "@backstage/core-plugin-api" "^0.1.3" - "@backstage/plugin-catalog-react" "^0.2.4" + "@backstage/plugin-catalog-react" "^0.3.0" "@backstage/theme" "^0.2.6" "@material-ui/core" "^4.11.3" "@material-ui/icons" "^4.11.2" @@ -4143,6 +4283,18 @@ dependencies: "@rollup/pluginutils" "^3.0.8" +"@rollup/plugin-node-resolve@^11.2.0": + version "11.2.1" + resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" + integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.19.0" + "@rollup/plugin-node-resolve@^13.0.0": version "13.0.0" resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.0.tgz#352f07e430ff377809ec8ec8a6fd636547162dc4" @@ -4155,6 +4307,15 @@ is-module "^1.0.0" resolve "^1.19.0" +"@rollup/plugin-yaml@^2.1.1": + version "2.1.1" + resolved "https://registry.npmjs.org/@rollup/plugin-yaml/-/plugin-yaml-2.1.1.tgz#6c864adee22004eb325d53bc4ee5553828e056d8" + integrity sha512-CnGD3dbDhP+JeKFX7kJuaBOa7jVzXpl3G8lXp1hasB87cDYOz7qNWd4cFPmYbxMsT/8OCVsceIpRtQ+cj9uxBw== + dependencies: + "@rollup/pluginutils" "^3.0.1" + js-yaml "^3.13.1" + tosource "^1.0.0" + "@rollup/plugin-yaml@^3.0.0": version "3.0.0" resolved "https://registry.npmjs.org/@rollup/plugin-yaml/-/plugin-yaml-3.0.0.tgz#632af397a6faaea10c885680c575ae01f4556c1d" @@ -4164,7 +4325,7 @@ js-yaml "^3.14.0" tosource "^1.0.0" -"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": +"@rollup/pluginutils@^3.0.1", "@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== @@ -4277,6 +4438,11 @@ resolved "https://registry.npmjs.org/@spotify/eslint-config-typescript/-/eslint-config-typescript-10.0.0.tgz#4df7074f3f4ef31d76c617e55d335f9a36cfed5b" integrity sha512-qR4WOU3gJrpz26O8BlNbXas4Yj93NeVH7yvULVYO2j9bCAEZJu2sfl1BGfOy4qAsYGutZhJtNwMqK0Rl4DcFHQ== +"@spotify/eslint-config-typescript@^9.0.0": + version "9.0.0" + resolved "https://registry.npmjs.org/@spotify/eslint-config-typescript/-/eslint-config-typescript-9.0.0.tgz#be68cfaf212599f0bfeb6536c7c58ec05d2b6fba" + integrity sha512-ZsXTwMA68ZCz943U4N8XwprdWcc7ErOO/IW8PewLK5lycCZtLnmRkOvAbae7O5qNJPD8b/l0iUMTLaZuwjXWwg== + "@spotify/prettier-config@^10.0.0": version "10.0.0" resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-10.0.0.tgz#fa076d98d2e7e6c53dd3d86a696307a7010bd056" @@ -5291,6 +5457,21 @@ lodash "^4.17.15" redent "^3.0.0" +"@testing-library/jest-dom@^5.12.0": + version "5.14.1" + resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.14.1.tgz#8501e16f1e55a55d675fe73eecee32cdaddb9766" + integrity sha512-dfB7HVIgTNCxH22M1+KU6viG5of2ldoA5ly8Ar8xkezKHKXjRvznCdbMbqjYGgO2xjRbwnR+rR8MLUIqF3kKbQ== + dependencies: + "@babel/runtime" "^7.9.2" + "@types/testing-library__jest-dom" "^5.9.1" + aria-query "^4.2.2" + chalk "^3.0.0" + css "^3.0.0" + css.escape "^1.5.1" + dom-accessibility-api "^0.5.6" + lodash "^4.17.15" + redent "^3.0.0" + "@testing-library/react-hooks@^3.3.0", "@testing-library/react-hooks@^3.4.2": version "3.4.2" resolved "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-3.4.2.tgz#8deb94f7684e0d896edd84a4c90e5b79a0810bc2" @@ -5307,6 +5488,14 @@ "@babel/runtime" "^7.12.5" "@testing-library/dom" "^7.28.1" +"@testing-library/react@^11.2.6": + version "11.2.7" + resolved "https://registry.npmjs.org/@testing-library/react/-/react-11.2.7.tgz#b29e2e95c6765c815786c0bc1d5aed9cb2bf7818" + integrity sha512-tzRNp7pzd5QmbtXNG/mhdcl7Awfu/Iz1RaVHY75zTdOkmHCuzMhRL83gWHSgOAcjS3CCbyfwUHMZgRJb4kAfpA== + dependencies: + "@babel/runtime" "^7.12.5" + "@testing-library/dom" "^7.28.1" + "@testing-library/user-event@^13.1.8": version "13.1.8" resolved "https://registry.npmjs.org/@testing-library/user-event/-/user-event-13.1.8.tgz#9cbf342b88d837ee188f9f9f4df6d1beaaf179c2" @@ -5633,6 +5822,18 @@ dependencies: "@types/node" "*" +"@types/domhandler@2.4.1": + version "2.4.1" + resolved "https://registry.npmjs.org/@types/domhandler/-/domhandler-2.4.1.tgz#7b3b347f7762180fbcb1ece1ce3dd0ebbb8c64cf" + integrity sha512-cfBw6q6tT5sa1gSPFSRKzF/xxYrrmeiut7E0TxNBObiLSBTuFEHibcfEe3waQPEDbqBsq+ql/TOniw65EyDFMA== + +"@types/domutils@*": + version "1.7.4" + resolved "https://registry.npmjs.org/@types/domutils/-/domutils-1.7.4.tgz#bb5f1807673e295782614b0a383b4dc1ecd2af97" + integrity sha512-w542nRQ0vpXQjLYP52LKqrugQtUq580dEDiDIyZ6IBmV8a3LXjGVNxfj/jUQxS0kDsbZAWsSxQOcTfVX3HRdwg== + dependencies: + domhandler "^2.4.0" + "@types/eslint@*": version "6.1.8" resolved "https://registry.npmjs.org/@types/eslint/-/eslint-6.1.8.tgz#7e868f89bc1e520323d405940e49cb912ede5bba" @@ -5776,6 +5977,15 @@ "@types/tapable" "^1" "@types/webpack" "^4" +"@types/htmlparser2@3.10.2": + version "3.10.2" + resolved "https://registry.npmjs.org/@types/htmlparser2/-/htmlparser2-3.10.2.tgz#bd43702eaf2f15c2d26784c8427352a0a4aa75eb" + integrity sha512-81vjuO800UMoHjYbCbqtBmfC3iCsrROKpqndo0acKiN6k/cpW+YOw9FzRP0ghujHeUNCOox2AQPrrMy6+j5UpQ== + dependencies: + "@types/domutils" "*" + "@types/node" "*" + domhandler "^2.4.0" + "@types/http-assert@*": version "1.5.1" resolved "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz#d775e93630c2469c2f980fc27e3143240335db3b" @@ -6430,6 +6640,13 @@ "@types/node" "*" rollup "^0.63.4" +"@types/sanitize-html@^1.27.1": + version "1.27.2" + resolved "https://registry.npmjs.org/@types/sanitize-html/-/sanitize-html-1.27.2.tgz#f7bf16ca4b1408278f97ae737f0377a08a10b35c" + integrity sha512-DrH26m7CV6PB4YVckjbSIx+xloB7HBolr9Ctm0gZBffSu5dDV4yJKFQGPquJlReVW+xmg59gx+b/8/qYHxZEuw== + dependencies: + htmlparser2 "^4.1.0" + "@types/scheduler@*": version "0.16.1" resolved "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" @@ -6627,6 +6844,11 @@ resolved "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz#215c231dff736d5ba92410e6d602050cce7e273f" integrity sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ== +"@types/uuid@^8.3.0": + version "8.3.1" + resolved "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f" + integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg== + "@types/webpack-dev-server@*", "@types/webpack-dev-server@^3.11.0": version "3.11.4" resolved "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.11.4.tgz#90d47dd660b696d409431ab8c1e9fa3615103a07" @@ -6738,6 +6960,19 @@ resolved "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== +"@typescript-eslint/eslint-plugin@^v4.15.2": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.3.tgz#36cdcd9ca6f9e5cb49b9f61b970b1976708d084b" + integrity sha512-jW8sEFu1ZeaV8xzwsfi6Vgtty2jf7/lJmQmDkDruBjYAbx5DA8JtbcMnP0rNPUG+oH5GoQBTSp+9613BzuIpYg== + dependencies: + "@typescript-eslint/experimental-utils" "4.28.3" + "@typescript-eslint/scope-manager" "4.28.3" + debug "^4.3.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.1.0" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/eslint-plugin@^v4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.27.0.tgz#0b7fc974e8bc9b2b5eb98ed51427b0be529b4ad0" @@ -6764,6 +6999,28 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" +"@typescript-eslint/experimental-utils@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.3.tgz#976f8c1191b37105fd06658ed57ddfee4be361ca" + integrity sha512-zZYl9TnrxwEPi3FbyeX0ZnE8Hp7j3OCR+ELoUfbwGHGxWnHg9+OqSmkw2MoCVpZksPCZYpQzC559Ee9pJNHTQw== + dependencies: + "@types/json-schema" "^7.0.7" + "@typescript-eslint/scope-manager" "4.28.3" + "@typescript-eslint/types" "4.28.3" + "@typescript-eslint/typescript-estree" "4.28.3" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + +"@typescript-eslint/parser@^v4.14.0": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.28.3.tgz#95f1d475c08268edffdcb2779993c488b6434b44" + integrity sha512-ZyWEn34bJexn/JNYvLQab0Mo5e+qqQNhknxmc8azgNd4XqspVYR5oHq9O11fLwdZMRcj4by15ghSlIEq+H5ltQ== + dependencies: + "@typescript-eslint/scope-manager" "4.28.3" + "@typescript-eslint/types" "4.28.3" + "@typescript-eslint/typescript-estree" "4.28.3" + debug "^4.3.1" + "@typescript-eslint/parser@^v4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.27.0.tgz#85447e573364bce4c46c7f64abaa4985aadf5a94" @@ -6782,11 +7039,24 @@ "@typescript-eslint/types" "4.27.0" "@typescript-eslint/visitor-keys" "4.27.0" +"@typescript-eslint/scope-manager@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.3.tgz#c32ad4491b3726db1ba34030b59ea922c214e371" + integrity sha512-/8lMisZ5NGIzGtJB+QizQ5eX4Xd8uxedFfMBXOKuJGP0oaBBVEMbJVddQKDXyyB0bPlmt8i6bHV89KbwOelJiQ== + dependencies: + "@typescript-eslint/types" "4.28.3" + "@typescript-eslint/visitor-keys" "4.28.3" + "@typescript-eslint/types@4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.27.0.tgz#712b408519ed699baff69086bc59cd2fc13df8d8" integrity sha512-I4ps3SCPFCKclRcvnsVA/7sWzh7naaM/b4pBO2hVxnM3wrU51Lveybdw5WoIktU/V4KfXrTt94V9b065b/0+wA== +"@typescript-eslint/types@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.28.3.tgz#8fffd436a3bada422c2c1da56060a0566a9506c7" + integrity sha512-kQFaEsQBQVtA9VGVyciyTbIg7S3WoKHNuOp/UF5RG40900KtGqfoiETWD/v0lzRXc+euVE9NXmfer9dLkUJrkA== + "@typescript-eslint/typescript-estree@4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.27.0.tgz#189a7b9f1d0717d5cccdcc17247692dedf7a09da" @@ -6800,6 +7070,19 @@ semver "^7.3.5" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.3.tgz#253d7088100b2a38aefe3c8dd7bd1f8232ec46fb" + integrity sha512-YAb1JED41kJsqCQt1NcnX5ZdTA93vKFCMP4lQYG6CFxd0VzDJcKttRlMrlG+1qiWAw8+zowmHU1H0OzjWJzR2w== + dependencies: + "@typescript-eslint/types" "4.28.3" + "@typescript-eslint/visitor-keys" "4.28.3" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/visitor-keys@4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.27.0.tgz#f56138b993ec822793e7ebcfac6ffdce0a60cb81" @@ -6808,6 +7091,14 @@ "@typescript-eslint/types" "4.27.0" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.3.tgz#26ac91e84b23529968361045829da80a4e5251c4" + integrity sha512-ri1OzcLnk1HH4gORmr1dllxDzzrN6goUIz/P4MHFV0YZJDCADPR3RvYNp0PW2SetKTThar6wlbFTL00hV2Q+fg== + dependencies: + "@typescript-eslint/types" "4.28.3" + eslint-visitor-keys "^2.0.0" + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -8703,6 +8994,13 @@ browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.16.6: escalade "^3.1.1" node-releases "^1.1.71" +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== + dependencies: + fast-json-stable-stringify "2.x" + bser@2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -8730,7 +9028,7 @@ buffer-equal-constant-time@1.0.1: resolved "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= -buffer-from@^1.0.0: +buffer-from@1.x, buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== @@ -10226,7 +10524,7 @@ cross-fetch@3.0.6: dependencies: node-fetch "2.6.1" -cross-fetch@3.1.4, cross-fetch@^3.0.4, cross-fetch@^3.0.6, cross-fetch@^3.1.3: +cross-fetch@3.1.4, cross-fetch@^3.0.4, cross-fetch@^3.0.6, cross-fetch@^3.1.3, cross-fetch@^3.1.4: version "3.1.4" resolved "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== @@ -11362,6 +11660,11 @@ dom-accessibility-api@^0.5.4: resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.4.tgz#b06d059cdd4a4ad9a79275f9d414a5c126241166" integrity sha512-TvrjBckDy2c6v6RLxPv5QXOnU+SmF9nBII5621Ve5fu6Z/BDrENurBEvlC1f44lKEUVqOpK4w9E5Idc5/EgkLQ== +dom-accessibility-api@^0.5.6: + version "0.5.6" + resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.6.tgz#3f5d43b52c7a3bd68b5fb63fa47b4e4c1fdf65a9" + integrity sha512-DplGLZd8L1lN64jlT27N9TVSESFR5STaEJvX+thCby7fuCHonfPpAlodYc3vuUYbDuDec5w8AMP7oCM5TWFsqw== + dom-converter@^0.2: version "0.2.0" resolved "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" @@ -11435,7 +11738,7 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -domhandler@^2.3.0: +domhandler@2.4.2, domhandler@^2.3.0, domhandler@^2.4.0: version "2.4.2" resolved "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== @@ -12693,7 +12996,7 @@ fast-json-patch@^3.0.0-1: resolved "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.0.0-1.tgz#4c68f2e7acfbab6d29d1719c44be51899c93dabb" integrity sha512-6pdFb07cknxvPzCeLsFHStEy+MysPJPgZQ9LbQ/2O67unQF93SNqfdSqnPPl71YMHX+AD8gbl7iuoGFzHEdDuw== -fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -13277,6 +13580,11 @@ fsevents@^2.1.2, fsevents@~2.3.1, fsevents@~2.3.2: resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + fstream@^1.0.0, fstream@^1.0.12: version "1.0.12" resolved "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" @@ -14384,6 +14692,15 @@ html-comment-regex@^1.1.0: resolved "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ== +html-dom-parser@0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/html-dom-parser/-/html-dom-parser-0.3.0.tgz#19864ca42836ec8750b439600633f145ab5409b9" + integrity sha512-WDEYpO5gHGKuJbf0rwndGq7yUHJ4xboNj9l9mRGw5RsKFc3jfRozCsGAMu69zXxt4Ol8UkbqubKxu8ys0BLKtA== + dependencies: + "@types/domhandler" "2.4.1" + domhandler "2.4.2" + htmlparser2 "3.10.1" + html-encoding-sniffer@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" @@ -14421,6 +14738,16 @@ html-minifier-terser@^5.0.1: relateurl "^0.2.7" terser "^4.6.3" +html-react-parser@^0.14.1: + version "0.14.3" + resolved "https://registry.npmjs.org/html-react-parser/-/html-react-parser-0.14.3.tgz#bd126bba11dce88b97168b5c879e031b6c2209e5" + integrity sha512-scZ1DHGbyRv0AjsavBndhTzAOQ5iWxzmD5z74cXU07mMcegt8MtlQoHx3SVGhVAkScqNgk1hgKoE80S3OFUt4A== + dependencies: + "@types/htmlparser2" "3.10.2" + html-dom-parser "0.3.0" + react-property "1.0.1" + style-to-js "1.1.0" + html-to-react@^1.3.4: version "1.4.2" resolved "https://registry.npmjs.org/html-to-react/-/html-to-react-1.4.2.tgz#7b628ab56cd63a52f2d0b79d0fa838a51f088a57" @@ -14453,7 +14780,7 @@ html2canvas@^1.0.0-rc.5: dependencies: css-line-break "1.1.1" -htmlparser2@^3.3.0: +htmlparser2@3.10.1, htmlparser2@^3.3.0: version "3.10.1" resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== @@ -14465,7 +14792,7 @@ htmlparser2@^3.3.0: inherits "^2.0.1" readable-stream "^3.1.1" -htmlparser2@^4.0: +htmlparser2@^4.0, htmlparser2@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz#9a4ef161f2e4625ebf7dfbe6c0a2f52d18a59e78" integrity sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q== @@ -14929,6 +15256,11 @@ init-package-json@^2.0.2: validate-npm-package-license "^3.0.4" validate-npm-package-name "^3.0.0" +inline-style-parser@0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" + integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== + inline-style-prefixer@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-6.0.0.tgz#f73d5dbf2855733d6b153a4d24b7b47a73e9770b" @@ -16182,7 +16514,7 @@ jest-snapshot@^26.6.2: pretty-format "^26.6.2" semver "^7.3.2" -jest-util@^26.6.2: +jest-util@^26.1.0, jest-util@^26.6.2: version "26.6.2" resolved "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== @@ -16589,6 +16921,13 @@ json3@^3.3.2: resolved "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" integrity sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA== +json5@2.x, json5@^2.1.1, json5@^2.1.2, json5@^2.1.3: + version "2.2.0" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== + dependencies: + minimist "^1.2.5" + json5@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" @@ -16596,13 +16935,6 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.1, json5@^2.1.2, json5@^2.1.3: - version "2.2.0" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -17492,7 +17824,7 @@ lodash@4.17.15: resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -lodash@4.17.21, lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@~4.17.0, lodash@~4.17.15, lodash@~4.17.4: +lodash@4.17.21, lodash@4.x, lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@~4.17.0, lodash@~4.17.15, lodash@~4.17.4: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -17692,7 +18024,7 @@ make-dir@^3.0.0, make-dir@^3.0.2: dependencies: semver "^6.0.0" -make-error@^1, make-error@^1.1.1, make-error@^1.3.6: +make-error@1.x, make-error@^1, make-error@^1.1.1, make-error@^1.3.6: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -18431,6 +18763,11 @@ mkdirp@0.5.1: dependencies: minimist "0.0.8" +mkdirp@1.x, mkdirp@^1.0.3, mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5, mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -18438,11 +18775,6 @@ mkdirp@0.5.1: dependencies: minimist "^1.2.5" -mkdirp@^1.0.3, mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - mocha@^2.5.3: version "2.5.3" resolved "https://registry.npmjs.org/mocha/-/mocha-2.5.3.tgz#161be5bdeb496771eb9b35745050b622b5aefc58" @@ -18524,6 +18856,30 @@ msal@^1.0.2: dependencies: tslib "^1.9.3" +msw@^0.28.2: + version "0.28.2" + resolved "https://registry.npmjs.org/msw/-/msw-0.28.2.tgz#5179df2c2f8c65e31b2043b8ec9cbe245ad0bd48" + integrity sha512-WHfRd+Zwfy8yNPAx4PDJ0PnaEqUw5QOjWbCk5MmgpHMl51R3FJ2yIC694RdqR1bInqoaV94wW9Irv9eSyh65lQ== + dependencies: + "@mswjs/cookies" "^0.1.4" + "@mswjs/interceptors" "^0.8.0" + "@open-draft/until" "^1.0.3" + "@types/cookie" "^0.4.0" + "@types/inquirer" "^7.3.1" + "@types/js-levenshtein" "^1.1.0" + chalk "^4.1.0" + chokidar "^3.4.2" + cookie "^0.4.1" + graphql "^15.4.0" + headers-utils "^3.0.2" + inquirer "^7.3.3" + js-levenshtein "^1.1.6" + node-fetch "^2.6.1" + node-match-path "^0.6.1" + statuses "^2.0.0" + strict-event-emitter "^0.2.0" + yargs "^16.2.0" + msw@^0.29.0: version "0.29.0" resolved "https://registry.npmjs.org/msw/-/msw-0.29.0.tgz#7242d575cb01db0c925241587df1fc2b79230d78" @@ -18853,7 +19209,7 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" -node-match-path@^0.6.3: +node-match-path@^0.6.1, node-match-path@^0.6.3: version "0.6.3" resolved "https://registry.npmjs.org/node-match-path/-/node-match-path-0.6.3.tgz#55dd8443d547f066937a0752dce462ea7dc27551" integrity sha512-fB1reOHKLRZCJMAka28hIxCwQLxGmd7WewOCBDYKpyA1KXi68A7vaGgdZAPhY2E6SXoYt3KqYCCvXLJ+O0Fu/Q== @@ -21639,6 +21995,11 @@ react-popper@^2.2.4: react-fast-compare "^3.0.1" warning "^4.0.2" +react-property@1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/react-property/-/react-property-1.0.1.tgz#4ae4211557d0a0ae050a71aa8ad288c074bea4e6" + integrity sha512-1tKOwxFn3dXVomH6pM9IkLkq2Y8oh+fh/lYW3MJ/B03URswUTqttgckOlbxY2XHF3vPG6uanSc4dVsLW/wk3wQ== + react-redux@=4.4.10: version "4.4.10" resolved "https://registry.npmjs.org/react-redux/-/react-redux-4.4.10.tgz#ad57bd1db00c2d0aa7db992b360ce63dd0b80ec5" @@ -22669,6 +23030,15 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rollup-plugin-dts@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-2.0.1.tgz#333f50a637e199a073d490b198746f3c6bd07701" + integrity sha512-y38NSXIY37YExCumbGBTL5dXg7pL7XD+Kbe98iEHWFN9yiKJf7t4kKBOkml5ylUDjQIXBnNClGDeRktc1T5dmA== + dependencies: + magic-string "^0.25.7" + optionalDependencies: + "@babel/code-frame" "^7.10.4" + rollup-plugin-dts@^3.0.1: version "3.0.2" resolved "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-3.0.2.tgz#2b628d88f864d271d6eaec2e4c2a60ae4e944c5c" @@ -22718,6 +23088,13 @@ rollup-pluginutils@^2.8.2: dependencies: estree-walker "^0.6.1" +rollup@2.33.x: + version "2.33.3" + resolved "https://registry.npmjs.org/rollup/-/rollup-2.33.3.tgz#ae72ce31f992b09a580072951bfea76e9df17342" + integrity sha512-RpayhPTe4Gu/uFGCmk7Gp5Z9Qic2VsqZ040G+KZZvsZYdcuWaJg678JeDJJvJeEQXminu24a2au+y92CUWVd+w== + optionalDependencies: + fsevents "~2.1.2" + rollup@2.44.x: version "2.44.0" resolved "https://registry.npmjs.org/rollup/-/rollup-2.44.0.tgz#8da324d1c4fd12beef9ae6e12f4068265b6d95eb" @@ -22823,7 +23200,7 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" -sanitize-html@^2.3.2: +sanitize-html@^2.3.2, sanitize-html@^2.3.3: version "2.4.0" resolved "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.4.0.tgz#8da7524332eb210d968971621b068b53f17ab5a3" integrity sha512-Y1OgkUiTPMqwZNRLPERSEi39iOebn2XJLbeiGOBhaJD/yLqtLGu6GE5w7evx177LeGgSE+4p4e107LMiydOf6A== @@ -22951,18 +23328,18 @@ semver@7.0.0: resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@~7.3.0: +semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@~7.3.0: version "7.3.5" resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@~5.3.0: version "5.3.0" resolved "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -24092,6 +24469,20 @@ style-loader@^1.2.1: loader-utils "^2.0.0" schema-utils "^2.6.6" +style-to-js@1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.0.tgz#631cbb20fce204019b3aa1fcb5b69d951ceac4ac" + integrity sha512-1OqefPDxGrlMwcbfpsTVRyzwdhr4W0uxYQzeA2F1CBc8WG04udg2+ybRnvh3XYL4TdHQrCahLtax2jc8xaE6rA== + dependencies: + style-to-object "0.3.0" + +style-to-object@0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" + integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== + dependencies: + inline-style-parser "0.1.1" + stylehacks@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" @@ -24117,6 +24508,18 @@ subscriptions-transport-ws@^0.9.18, subscriptions-transport-ws@^0.9.19: symbol-observable "^1.0.4" ws "^5.2.0 || ^6.0.0 || ^7.0.0" +sucrase@^3.17.1: + version "3.20.0" + resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.20.0.tgz#a80e865830e27d66a912c938491d474164b06205" + integrity sha512-Rsp+BX7DRuCleJvBAHN7gQ3ddk7U0rJev19XlIBF6dAq9vX4Tr5mHk4E7+ig/I7BM3DLYotCmm20lfBElT2XtQ== + dependencies: + commander "^4.0.0" + glob "7.1.6" + lines-and-columns "^1.1.6" + mz "^2.7.0" + pirates "^4.0.1" + ts-interface-checker "^0.1.9" + sucrase@^3.18.0, sucrase@^3.18.2: version "3.18.2" resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.18.2.tgz#d9f16f1dd4f91e0293ad6f692867772eda301e4b" @@ -24939,6 +25342,22 @@ ts-invariant@^0.4.0: dependencies: tslib "^1.9.3" +ts-jest@^26.4.3: + version "26.5.6" + resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-26.5.6.tgz#c32e0746425274e1dfe333f43cd3c800e014ec35" + integrity sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA== + dependencies: + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + jest-util "^26.1.0" + json5 "2.x" + lodash "4.x" + make-error "1.x" + mkdirp "1.x" + semver "7.x" + yargs-parser "20.x" + ts-loader@^8.0.17: version "8.0.17" resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.17.tgz#98f2ccff9130074f4079fd89b946b4c637b1f2fc" @@ -25663,6 +26082,11 @@ uuid@3.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== +uuid@8.3.2, uuid@^8.0.0, uuid@^8.2.0, uuid@^8.3.0, uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + uuid@^3.1.0, uuid@^3.3.2, uuid@^3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -25673,11 +26097,6 @@ uuid@^7.0.3: resolved "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== -uuid@^8.0.0, uuid@^8.2.0, uuid@^8.3.0, uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - v8-compile-cache@^2.0.3: version "2.1.0" resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" @@ -26382,6 +26801,13 @@ xml-encryption@1.2.1: xmldom "~0.1.15" xpath "0.0.27" +xml-js@^1.6.11: + version "1.6.11" + resolved "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz#927d2f6947f7f1c19a316dd8eea3614e8b18f8e9" + integrity sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g== + dependencies: + sax "^1.2.4" + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" @@ -26513,6 +26939,11 @@ yargs-parser@20.2.4, yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== +yargs-parser@20.x: + version "20.2.9" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" From c0574e207a04d701dd56990ed898ea70ceb41c39 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Fri, 16 Jul 2021 11:07:26 +0200 Subject: [PATCH 058/101] docs: remove unnencessary clause about software catalog Signed-off-by: Himanshu Mishra --- docs/features/software-catalog/index.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/features/software-catalog/index.md b/docs/features/software-catalog/index.md index a502c2aee5..f5296f38e1 100644 --- a/docs/features/software-catalog/index.md +++ b/docs/features/software-catalog/index.md @@ -8,12 +8,11 @@ description: The Backstage Software Catalog ## What is a Software Catalog? -The Backstage Software Catalog — actually, a software catalog, since it includes -more than just services — is a centralized system that keeps track of ownership -and metadata for all the software in your ecosystem (services, websites, -libraries, data pipelines, etc). The catalog is built around the concept of -[metadata YAML files](descriptor-format.md) stored together with the code, which -are then harvested and visualized in Backstage. +The Backstage Software Catalog is a centralized system that keeps track of +ownership and metadata for all the software in your ecosystem (services, +websites, libraries, data pipelines, etc). The catalog is built around the +concept of [metadata YAML files](descriptor-format.md) stored together with the +code, which are then harvested and visualized in Backstage. ![software-catalog](https://backstage.io/blog/assets/6/header.png) From 12b5b69b49c73d9600fdcedf98587b428ec8f609 Mon Sep 17 00:00:00 2001 From: irma12 Date: Fri, 16 Jul 2021 12:49:19 +0200 Subject: [PATCH 059/101] Clean yarn.lock Signed-off-by: irma12 --- yarn.lock | 645 ++++++++++++++++++++---------------------------------- 1 file changed, 236 insertions(+), 409 deletions(-) diff --git a/yarn.lock b/yarn.lock index 651598d0fb..248347ba8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1348,126 +1348,6 @@ "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" -"@backstage/catalog-model@^0.8.0": - version "0.9.0" - dependencies: - "@backstage/config" "^0.1.5" - "@backstage/errors" "^0.1.1" - "@types/json-schema" "^7.0.5" - "@types/yup" "^0.29.8" - ajv "^7.0.3" - json-schema "^0.3.0" - lodash "^4.17.15" - uuid "^8.0.0" - yup "^0.29.3" - -"@backstage/catalog-model@^0.8.1": - version "0.9.0" - dependencies: - "@backstage/config" "^0.1.5" - "@backstage/errors" "^0.1.1" - "@types/json-schema" "^7.0.5" - "@types/yup" "^0.29.8" - ajv "^7.0.3" - json-schema "^0.3.0" - lodash "^4.17.15" - uuid "^8.0.0" - yup "^0.29.3" - -"@backstage/cli@^0.6.12": - version "0.6.14" - resolved "https://registry.npmjs.org/@backstage/cli/-/cli-0.6.14.tgz#4ca8df63eecdd0f1d3c09b8d89c9616401d6f2e0" - integrity sha512-MfLn/haoViq9hLCny/pa8qUlDZzuaIhWvkYuDEGSnNTz5AwKSBwPD0QVa6OQCTaU4XAX5nUXVpm7hIWuUQSM5Q== - dependencies: - "@babel/core" "^7.4.4" - "@babel/plugin-transform-modules-commonjs" "^7.4.4" - "@backstage/cli-common" "^0.1.1" - "@backstage/config" "^0.1.5" - "@backstage/config-loader" "^0.6.3" - "@hot-loader/react-dom" "^16.13.0" - "@lerna/package-graph" "^4.0.0" - "@lerna/project" "^4.0.0" - "@octokit/request" "^5.4.12" - "@rollup/plugin-commonjs" "^17.1.0" - "@rollup/plugin-json" "^4.0.2" - "@rollup/plugin-node-resolve" "^11.2.0" - "@rollup/plugin-yaml" "^2.1.1" - "@spotify/eslint-config-base" "^9.0.0" - "@spotify/eslint-config-react" "^10.0.0" - "@spotify/eslint-config-typescript" "^9.0.0" - "@sucrase/webpack-loader" "^2.0.0" - "@svgr/plugin-jsx" "5.5.x" - "@svgr/plugin-svgo" "5.4.x" - "@svgr/rollup" "5.5.x" - "@svgr/webpack" "5.5.x" - "@types/start-server-webpack-plugin" "^2.2.0" - "@types/webpack-env" "^1.15.2" - "@types/webpack-node-externals" "^2.5.0" - "@typescript-eslint/eslint-plugin" "^v4.15.2" - "@typescript-eslint/parser" "^v4.14.0" - "@yarnpkg/lockfile" "^1.1.0" - babel-plugin-dynamic-import-node "^2.3.3" - bfj "^7.0.2" - chalk "^4.0.0" - chokidar "^3.3.1" - commander "^6.1.0" - css-loader "^3.5.3" - dashify "^2.0.0" - diff "^5.0.0" - esbuild "^0.8.56" - eslint "^7.1.0" - eslint-config-prettier "^8.3.0" - eslint-formatter-friendly "^7.0.0" - eslint-plugin-import "^2.20.2" - eslint-plugin-jest "^24.1.0" - eslint-plugin-jsx-a11y "^6.2.1" - eslint-plugin-monorepo "^0.3.2" - eslint-plugin-react "^7.12.4" - eslint-plugin-react-hooks "^4.0.0" - express "^4.17.1" - file-loader "^6.2.0" - fork-ts-checker-webpack-plugin "^6.2.9" - fs-extra "^9.0.0" - handlebars "^4.7.3" - html-webpack-plugin "^4.3.0" - inquirer "^7.0.4" - jest "^26.0.1" - jest-css-modules "^2.1.0" - json-schema "^0.3.0" - lodash "^4.17.19" - mini-css-extract-plugin "^0.9.0" - ora "^5.3.0" - postcss "^8.1.0" - raw-loader "^4.0.1" - react "^16.0.0" - react-dev-utils "^11.0.4" - react-hot-loader "^4.12.21" - recursive-readdir "^2.2.2" - replace-in-file "^6.0.0" - rollup "2.33.x" - rollup-plugin-dts "^2.0.1" - rollup-plugin-esbuild "2.6.x" - rollup-plugin-peer-deps-external "^2.2.2" - rollup-plugin-postcss "^4.0.0" - rollup-pluginutils "^2.8.2" - semver "^7.3.2" - start-server-webpack-plugin "^2.2.5" - style-loader "^1.2.1" - sucrase "^3.17.1" - tar "^6.0.1" - terser-webpack-plugin "^1.4.3" - ts-jest "^26.4.3" - ts-loader "^8.0.17" - typescript "^4.0.3" - url-loader "^4.1.0" - webpack "^4.41.6" - webpack-dev-server "3.11.0" - webpack-node-externals "^3.0.0" - yaml "^1.10.0" - yaml-jest "^1.0.5" - yml-loader "^2.1.0" - yn "^4.0.0" - "@backstage/core-api@^0.2.23": version "0.2.23" resolved "https://registry.npmjs.org/@backstage/core-api/-/core-api-0.2.23.tgz#c0ec13407ff7c78d376eb18e9d8e1490d54d995b" @@ -1486,7 +1366,7 @@ react-use "^17.2.4" zen-observable "^0.8.15" -"@backstage/core@*", "@backstage/core@^0.7.11", "@backstage/core@^0.7.12": +"@backstage/core@*": version "0.7.14" resolved "https://registry.npmjs.org/@backstage/core/-/core-0.7.14.tgz#863844fe40bb6a29bcc2d297e42055633b0e886f" integrity sha512-W7EMspBXrp1GPALK6+qdJjsvkqcaYGFyoh8/bRAXABIkJpGQGiy4xUZUKDoMhd+OdVHv/mzyyv3fH2yc32J07w== @@ -1532,50 +1412,6 @@ remark-gfm "^1.0.0" zen-observable "^0.8.15" -"@backstage/dev-utils@^0.1.15": - version "0.1.17" - resolved "https://registry.npmjs.org/@backstage/dev-utils/-/dev-utils-0.1.17.tgz#bbb539048b72f2e0a45d99179a87e9efe0f2de20" - integrity sha512-isXZ8gTCVoKDk0CeAtsCRKRNvFmFfE9gcJuZFl5soCjgdvdW073fZ/+PpWAfP8kfQA/ThJqh5s0IvkhFSr/IYA== - dependencies: - "@backstage/catalog-model" "^0.8.1" - "@backstage/core" "^0.7.12" - "@backstage/integration-react" "^0.1.2" - "@backstage/plugin-catalog-react" "^0.2.1" - "@backstage/test-utils" "^0.1.13" - "@backstage/theme" "^0.2.8" - "@material-ui/core" "^4.11.0" - "@material-ui/icons" "^4.9.1" - "@testing-library/jest-dom" "^5.10.1" - "@testing-library/react" "^11.2.5" - "@testing-library/user-event" "^13.1.8" - "@types/react" "^16.9" - react "^16.12.0" - react-dom "^16.12.0" - react-hot-loader "^4.12.21" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - -"@backstage/plugin-catalog-react@^0.2.0", "@backstage/plugin-catalog-react@^0.2.1": - version "0.2.6" - resolved "https://registry.npmjs.org/@backstage/plugin-catalog-react/-/plugin-catalog-react-0.2.6.tgz#4e3a0ea9394f163c95df97b72511f2bd2277f40a" - integrity sha512-loSYkm6aZKFn5gJ0xy9A3Ii3czSgA5ZRhCchqcN3ViSsipJLUbQt2TtMc8Tyk2h0e8AyRhyteEkcrnPGQqGXlQ== - dependencies: - "@backstage/catalog-client" "^0.3.16" - "@backstage/catalog-model" "^0.9.0" - "@backstage/core-app-api" "^0.1.4" - "@backstage/core-components" "^0.1.5" - "@backstage/core-plugin-api" "^0.1.3" - "@backstage/integration" "^0.5.8" - "@material-ui/core" "^4.11.0" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.45" - "@types/react" "^16.9" - lodash "^4.17.15" - react "^16.13.1" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - react-use "^17.2.4" - "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -2568,6 +2404,20 @@ prop-types "^15.6.2" scheduler "^0.19.0" +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" + integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + "@iarna/toml@^2.2.5": version "2.2.5" resolved "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c" @@ -4239,30 +4089,6 @@ react-router "6.0.0-beta.0" react-use "^17.2.4" -"@roadiehq/backstage-plugin-travis-ci@^1.0.5": - version "1.0.7" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-travis-ci/-/backstage-plugin-travis-ci-1.0.7.tgz#ab6fd3522cb4293df7ed3045863561a29000a146" - integrity sha512-couVtM6zP+LKwall9f1rST7Y1DcViEl42ZeKxf+uLmJLMMoUVnayw+zPAf5/DdkUA6eThX6gvQRx5O1W87ECrg== - dependencies: - "@backstage/catalog-model" "^0.9.0" - "@backstage/core-app-api" "^0.1.3" - "@backstage/core-components" "^0.1.3" - "@backstage/core-plugin-api" "^0.1.3" - "@backstage/plugin-catalog-react" "^0.3.0" - "@backstage/theme" "^0.2.6" - "@material-ui/core" "^4.11.3" - "@material-ui/icons" "^4.11.2" - "@material-ui/lab" "4.0.0-alpha.57" - cross-fetch "^3.1.3" - date-fns "^2.18.0" - history "^5.0.0" - moment "^2.29.1" - react "^16.13.1" - react-dom "^16.13.1" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - react-use "^17.2.4" - "@rollup/plugin-commonjs@^17.1.0": version "17.1.0" resolved "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz#757ec88737dffa8aa913eb392fade2e45aef2a2d" @@ -4283,18 +4109,6 @@ dependencies: "@rollup/pluginutils" "^3.0.8" -"@rollup/plugin-node-resolve@^11.2.0": - version "11.2.1" - resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" - integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== - dependencies: - "@rollup/pluginutils" "^3.1.0" - "@types/resolve" "1.17.1" - builtin-modules "^3.1.0" - deepmerge "^4.2.2" - is-module "^1.0.0" - resolve "^1.19.0" - "@rollup/plugin-node-resolve@^13.0.0": version "13.0.0" resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.0.tgz#352f07e430ff377809ec8ec8a6fd636547162dc4" @@ -4307,15 +4121,6 @@ is-module "^1.0.0" resolve "^1.19.0" -"@rollup/plugin-yaml@^2.1.1": - version "2.1.1" - resolved "https://registry.npmjs.org/@rollup/plugin-yaml/-/plugin-yaml-2.1.1.tgz#6c864adee22004eb325d53bc4ee5553828e056d8" - integrity sha512-CnGD3dbDhP+JeKFX7kJuaBOa7jVzXpl3G8lXp1hasB87cDYOz7qNWd4cFPmYbxMsT/8OCVsceIpRtQ+cj9uxBw== - dependencies: - "@rollup/pluginutils" "^3.0.1" - js-yaml "^3.13.1" - tosource "^1.0.0" - "@rollup/plugin-yaml@^3.0.0": version "3.0.0" resolved "https://registry.npmjs.org/@rollup/plugin-yaml/-/plugin-yaml-3.0.0.tgz#632af397a6faaea10c885680c575ae01f4556c1d" @@ -4325,7 +4130,7 @@ js-yaml "^3.14.0" tosource "^1.0.0" -"@rollup/pluginutils@^3.0.1", "@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": +"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== @@ -4438,11 +4243,6 @@ resolved "https://registry.npmjs.org/@spotify/eslint-config-typescript/-/eslint-config-typescript-10.0.0.tgz#4df7074f3f4ef31d76c617e55d335f9a36cfed5b" integrity sha512-qR4WOU3gJrpz26O8BlNbXas4Yj93NeVH7yvULVYO2j9bCAEZJu2sfl1BGfOy4qAsYGutZhJtNwMqK0Rl4DcFHQ== -"@spotify/eslint-config-typescript@^9.0.0": - version "9.0.0" - resolved "https://registry.npmjs.org/@spotify/eslint-config-typescript/-/eslint-config-typescript-9.0.0.tgz#be68cfaf212599f0bfeb6536c7c58ec05d2b6fba" - integrity sha512-ZsXTwMA68ZCz943U4N8XwprdWcc7ErOO/IW8PewLK5lycCZtLnmRkOvAbae7O5qNJPD8b/l0iUMTLaZuwjXWwg== - "@spotify/prettier-config@^10.0.0": version "10.0.0" resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-10.0.0.tgz#fa076d98d2e7e6c53dd3d86a696307a7010bd056" @@ -5822,18 +5622,6 @@ dependencies: "@types/node" "*" -"@types/domhandler@2.4.1": - version "2.4.1" - resolved "https://registry.npmjs.org/@types/domhandler/-/domhandler-2.4.1.tgz#7b3b347f7762180fbcb1ece1ce3dd0ebbb8c64cf" - integrity sha512-cfBw6q6tT5sa1gSPFSRKzF/xxYrrmeiut7E0TxNBObiLSBTuFEHibcfEe3waQPEDbqBsq+ql/TOniw65EyDFMA== - -"@types/domutils@*": - version "1.7.4" - resolved "https://registry.npmjs.org/@types/domutils/-/domutils-1.7.4.tgz#bb5f1807673e295782614b0a383b4dc1ecd2af97" - integrity sha512-w542nRQ0vpXQjLYP52LKqrugQtUq580dEDiDIyZ6IBmV8a3LXjGVNxfj/jUQxS0kDsbZAWsSxQOcTfVX3HRdwg== - dependencies: - domhandler "^2.4.0" - "@types/eslint@*": version "6.1.8" resolved "https://registry.npmjs.org/@types/eslint/-/eslint-6.1.8.tgz#7e868f89bc1e520323d405940e49cb912ede5bba" @@ -5977,15 +5765,6 @@ "@types/tapable" "^1" "@types/webpack" "^4" -"@types/htmlparser2@3.10.2": - version "3.10.2" - resolved "https://registry.npmjs.org/@types/htmlparser2/-/htmlparser2-3.10.2.tgz#bd43702eaf2f15c2d26784c8427352a0a4aa75eb" - integrity sha512-81vjuO800UMoHjYbCbqtBmfC3iCsrROKpqndo0acKiN6k/cpW+YOw9FzRP0ghujHeUNCOox2AQPrrMy6+j5UpQ== - dependencies: - "@types/domutils" "*" - "@types/node" "*" - domhandler "^2.4.0" - "@types/http-assert@*": version "1.5.1" resolved "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz#d775e93630c2469c2f980fc27e3143240335db3b" @@ -6640,13 +6419,6 @@ "@types/node" "*" rollup "^0.63.4" -"@types/sanitize-html@^1.27.1": - version "1.27.2" - resolved "https://registry.npmjs.org/@types/sanitize-html/-/sanitize-html-1.27.2.tgz#f7bf16ca4b1408278f97ae737f0377a08a10b35c" - integrity sha512-DrH26m7CV6PB4YVckjbSIx+xloB7HBolr9Ctm0gZBffSu5dDV4yJKFQGPquJlReVW+xmg59gx+b/8/qYHxZEuw== - dependencies: - htmlparser2 "^4.1.0" - "@types/scheduler@*": version "0.16.1" resolved "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" @@ -6844,11 +6616,6 @@ resolved "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz#215c231dff736d5ba92410e6d602050cce7e273f" integrity sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ== -"@types/uuid@^8.3.0": - version "8.3.1" - resolved "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f" - integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg== - "@types/webpack-dev-server@*", "@types/webpack-dev-server@^3.11.0": version "3.11.4" resolved "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.11.4.tgz#90d47dd660b696d409431ab8c1e9fa3615103a07" @@ -6960,7 +6727,7 @@ resolved "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71" integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg== -"@typescript-eslint/eslint-plugin@^v4.15.2": +"@typescript-eslint/eslint-plugin@^4.15.1": version "4.28.3" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.3.tgz#36cdcd9ca6f9e5cb49b9f61b970b1976708d084b" integrity sha512-jW8sEFu1ZeaV8xzwsfi6Vgtty2jf7/lJmQmDkDruBjYAbx5DA8JtbcMnP0rNPUG+oH5GoQBTSp+9613BzuIpYg== @@ -7011,16 +6778,6 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@^v4.14.0": - version "4.28.3" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.28.3.tgz#95f1d475c08268edffdcb2779993c488b6434b44" - integrity sha512-ZyWEn34bJexn/JNYvLQab0Mo5e+qqQNhknxmc8azgNd4XqspVYR5oHq9O11fLwdZMRcj4by15ghSlIEq+H5ltQ== - dependencies: - "@typescript-eslint/scope-manager" "4.28.3" - "@typescript-eslint/types" "4.28.3" - "@typescript-eslint/typescript-estree" "4.28.3" - debug "^4.3.1" - "@typescript-eslint/parser@^v4.27.0": version "4.27.0" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.27.0.tgz#85447e573364bce4c46c7f64abaa4985aadf5a94" @@ -7920,7 +7677,7 @@ array-ify@^1.0.0: resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= -array-includes@^3.0.3, array-includes@^3.1.1, array-includes@^3.1.2: +array-includes@^3.0.3, array-includes@^3.1.1, array-includes@^3.1.2, array-includes@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== @@ -8994,13 +8751,6 @@ browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.16.6: escalade "^3.1.1" node-releases "^1.1.71" -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - bser@2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -9028,7 +8778,7 @@ buffer-equal-constant-time@1.0.1: resolved "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= -buffer-from@1.x, buffer-from@^1.0.0: +buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== @@ -10524,7 +10274,7 @@ cross-fetch@3.0.6: dependencies: node-fetch "2.6.1" -cross-fetch@3.1.4, cross-fetch@^3.0.4, cross-fetch@^3.0.6, cross-fetch@^3.1.3, cross-fetch@^3.1.4: +cross-fetch@3.1.4, cross-fetch@^3.0.4, cross-fetch@^3.0.6, cross-fetch@^3.1.3: version "3.1.4" resolved "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== @@ -11738,7 +11488,7 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -domhandler@2.4.2, domhandler@^2.3.0, domhandler@^2.4.0: +domhandler@^2.3.0: version "2.4.2" resolved "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== @@ -12144,6 +11894,28 @@ es-abstract@^1.17.0, es-abstract@^1.17.0-next.0, es-abstract@^1.17.0-next.1, es- string.prototype.trimstart "^1.0.4" unbox-primitive "^1.0.0" +es-abstract@^1.18.2: + version "1.18.3" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0" + integrity sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.2" + is-callable "^1.2.3" + is-negative-zero "^2.0.1" + is-regex "^1.1.3" + is-string "^1.0.6" + object-inspect "^1.10.3" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" + es-array-method-boxes-properly@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" @@ -12349,7 +12121,7 @@ eslint-plugin-import@^2.20.2: resolve "^1.17.0" tsconfig-paths "^3.9.0" -eslint-plugin-jest@^24.1.0: +eslint-plugin-jest@^24.1.0, eslint-plugin-jest@^24.3.6: version "24.3.6" resolved "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.3.6.tgz#5f0ca019183c3188c5ad3af8e80b41de6c8e9173" integrity sha512-WOVH4TIaBLIeCX576rLcOgjNXqP+jNlCiEmRgFTfQtJ52DpwnIQKAVGlGPAN7CZ33bW6eNfHD6s8ZbEUTQubJg== @@ -12417,6 +12189,24 @@ eslint-plugin-react@^7.12.4: resolve "^1.18.1" string.prototype.matchall "^4.0.2" +eslint-plugin-react@^7.20.5: + version "7.24.0" + resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.24.0.tgz#eadedfa351a6f36b490aa17f4fa9b14e842b9eb4" + integrity sha512-KJJIx2SYx7PBx3ONe/mEeMz4YE0Lcr7feJTCMyyKb/341NcjuAgim3Acgan89GfPv7nxXK2+0slu0CWXYM4x+Q== + dependencies: + array-includes "^3.1.3" + array.prototype.flatmap "^1.2.4" + doctrine "^2.1.0" + has "^1.0.3" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.0.4" + object.entries "^1.1.4" + object.fromentries "^2.0.4" + object.values "^1.1.4" + prop-types "^15.7.2" + resolve "^2.0.0-next.3" + string.prototype.matchall "^4.0.5" + eslint-scope@^4.0.3: version "4.0.3" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" @@ -12502,6 +12292,52 @@ eslint@^7.1.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" +eslint@^7.6.0: + version "7.30.0" + resolved "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz#6d34ab51aaa56112fd97166226c9a97f505474f8" + integrity sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg== + dependencies: + "@babel/code-frame" "7.12.11" + "@eslint/eslintrc" "^0.4.2" + "@humanwhocodes/config-array" "^0.5.0" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.0.1" + doctrine "^3.0.0" + enquirer "^2.3.5" + escape-string-regexp "^4.0.0" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.1.2" + globals "^13.6.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.9" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + esm@^3.2.25: version "3.2.25" resolved "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10" @@ -12996,7 +12832,7 @@ fast-json-patch@^3.0.0-1: resolved "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.0.0-1.tgz#4c68f2e7acfbab6d29d1719c44be51899c93dabb" integrity sha512-6pdFb07cknxvPzCeLsFHStEy+MysPJPgZQ9LbQ/2O67unQF93SNqfdSqnPPl71YMHX+AD8gbl7iuoGFzHEdDuw== -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: +fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -13580,11 +13416,6 @@ fsevents@^2.1.2, fsevents@~2.3.1, fsevents@~2.3.2: resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -fsevents@~2.1.2: - version "2.1.3" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - fstream@^1.0.0, fstream@^1.0.12: version "1.0.12" resolved "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" @@ -13734,7 +13565,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== @@ -14477,7 +14308,7 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-bigints@^1.0.0: +has-bigints@^1.0.0, has-bigints@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== @@ -14692,15 +14523,6 @@ html-comment-regex@^1.1.0: resolved "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ== -html-dom-parser@0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/html-dom-parser/-/html-dom-parser-0.3.0.tgz#19864ca42836ec8750b439600633f145ab5409b9" - integrity sha512-WDEYpO5gHGKuJbf0rwndGq7yUHJ4xboNj9l9mRGw5RsKFc3jfRozCsGAMu69zXxt4Ol8UkbqubKxu8ys0BLKtA== - dependencies: - "@types/domhandler" "2.4.1" - domhandler "2.4.2" - htmlparser2 "3.10.1" - html-encoding-sniffer@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" @@ -14738,16 +14560,6 @@ html-minifier-terser@^5.0.1: relateurl "^0.2.7" terser "^4.6.3" -html-react-parser@^0.14.1: - version "0.14.3" - resolved "https://registry.npmjs.org/html-react-parser/-/html-react-parser-0.14.3.tgz#bd126bba11dce88b97168b5c879e031b6c2209e5" - integrity sha512-scZ1DHGbyRv0AjsavBndhTzAOQ5iWxzmD5z74cXU07mMcegt8MtlQoHx3SVGhVAkScqNgk1hgKoE80S3OFUt4A== - dependencies: - "@types/htmlparser2" "3.10.2" - html-dom-parser "0.3.0" - react-property "1.0.1" - style-to-js "1.1.0" - html-to-react@^1.3.4: version "1.4.2" resolved "https://registry.npmjs.org/html-to-react/-/html-to-react-1.4.2.tgz#7b628ab56cd63a52f2d0b79d0fa838a51f088a57" @@ -14780,7 +14592,7 @@ html2canvas@^1.0.0-rc.5: dependencies: css-line-break "1.1.1" -htmlparser2@3.10.1, htmlparser2@^3.3.0: +htmlparser2@^3.3.0: version "3.10.1" resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== @@ -14792,7 +14604,7 @@ htmlparser2@3.10.1, htmlparser2@^3.3.0: inherits "^2.0.1" readable-stream "^3.1.1" -htmlparser2@^4.0, htmlparser2@^4.1.0: +htmlparser2@^4.0: version "4.1.0" resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz#9a4ef161f2e4625ebf7dfbe6c0a2f52d18a59e78" integrity sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q== @@ -15256,11 +15068,6 @@ init-package-json@^2.0.2: validate-npm-package-license "^3.0.4" validate-npm-package-name "^3.0.0" -inline-style-parser@0.1.1: - version "0.1.1" - resolved "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" - integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== - inline-style-prefixer@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-6.0.0.tgz#f73d5dbf2855733d6b153a4d24b7b47a73e9770b" @@ -15343,6 +15150,15 @@ internal-slot@^1.0.2: has "^1.0.3" side-channel "^1.0.2" +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + interpret@^1.0.0: version "1.2.0" resolved "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -15844,6 +15660,14 @@ is-regex@^1.0.4, is-regex@^1.1.2: call-bind "^1.0.2" has-symbols "^1.0.1" +is-regex@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" + integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== + dependencies: + call-bind "^1.0.2" + has-symbols "^1.0.2" + is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" @@ -15898,6 +15722,11 @@ is-string@^1.0.4, is-string@^1.0.5: resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== +is-string@^1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" + integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== + is-subdir@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/is-subdir/-/is-subdir-1.1.1.tgz#423e66902f9c5f159b9cc4826c820df083059538" @@ -16514,7 +16343,7 @@ jest-snapshot@^26.6.2: pretty-format "^26.6.2" semver "^7.3.2" -jest-util@^26.1.0, jest-util@^26.6.2: +jest-util@^26.6.2: version "26.6.2" resolved "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== @@ -16921,13 +16750,6 @@ json3@^3.3.2: resolved "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" integrity sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA== -json5@2.x, json5@^2.1.1, json5@^2.1.2, json5@^2.1.3: - version "2.2.0" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - json5@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" @@ -16935,6 +16757,13 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" +json5@^2.1.1, json5@^2.1.2, json5@^2.1.3: + version "2.2.0" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== + dependencies: + minimist "^1.2.5" + jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -17824,7 +17653,7 @@ lodash@4.17.15: resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -lodash@4.17.21, lodash@4.x, lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@~4.17.0, lodash@~4.17.15, lodash@~4.17.4: +lodash@4.17.21, lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@~4.17.0, lodash@~4.17.15, lodash@~4.17.4: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -18024,7 +17853,7 @@ make-dir@^3.0.0, make-dir@^3.0.2: dependencies: semver "^6.0.0" -make-error@1.x, make-error@^1, make-error@^1.1.1, make-error@^1.3.6: +make-error@^1, make-error@^1.1.1, make-error@^1.3.6: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -18763,11 +18592,6 @@ mkdirp@0.5.1: dependencies: minimist "0.0.8" -mkdirp@1.x, mkdirp@^1.0.3, mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5, mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -18775,6 +18599,11 @@ mkdirp@1.x, mkdirp@^1.0.3, mkdirp@^1.0.4: dependencies: minimist "^1.2.5" +mkdirp@^1.0.3, mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + mocha@^2.5.3: version "2.5.3" resolved "https://registry.npmjs.org/mocha/-/mocha-2.5.3.tgz#161be5bdeb496771eb9b35745050b622b5aefc58" @@ -19553,6 +19382,11 @@ object-hash@^2.0.1, object-hash@^2.1.1: resolved "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== +object-inspect@^1.10.3: + version "1.11.0" + resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" + integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== + object-inspect@^1.9.0: version "1.9.0" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" @@ -19599,6 +19433,15 @@ object.entries@^1.1.0, object.entries@^1.1.2: es-abstract "^1.17.5" has "^1.0.3" +object.entries@^1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd" + integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" + "object.fromentries@^2.0.0 || ^1.0.0", object.fromentries@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.2.tgz#4a09c9b9bb3843dd0f89acdb517a794d4f355ac9" @@ -19609,6 +19452,16 @@ object.entries@^1.1.0, object.entries@^1.1.2: function-bind "^1.1.1" has "^1.0.3" +object.fromentries@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" + integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + has "^1.0.3" + object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" @@ -19634,6 +19487,15 @@ object.values@^1.1.0, object.values@^1.1.1: function-bind "^1.1.1" has "^1.0.3" +object.values@^1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" + integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" + objectorarray@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/objectorarray/-/objectorarray-1.0.4.tgz#d69b2f0ff7dc2701903d308bb85882f4ddb49483" @@ -21995,11 +21857,6 @@ react-popper@^2.2.4: react-fast-compare "^3.0.1" warning "^4.0.2" -react-property@1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/react-property/-/react-property-1.0.1.tgz#4ae4211557d0a0ae050a71aa8ad288c074bea4e6" - integrity sha512-1tKOwxFn3dXVomH6pM9IkLkq2Y8oh+fh/lYW3MJ/B03URswUTqttgckOlbxY2XHF3vPG6uanSc4dVsLW/wk3wQ== - react-redux@=4.4.10: version "4.4.10" resolved "https://registry.npmjs.org/react-redux/-/react-redux-4.4.10.tgz#ad57bd1db00c2d0aa7db992b360ce63dd0b80ec5" @@ -22593,6 +22450,14 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.3.0: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" +regexp.prototype.flags@^1.3.1: + version "1.3.1" + resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" + integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + regexpp@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" @@ -22892,6 +22757,14 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14 is-core-module "^2.2.0" path-parse "^1.0.6" +resolve@^2.0.0-next.3: + version "2.0.0-next.3" + resolved "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" + integrity sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + resolve@~1.17.0: version "1.17.0" resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" @@ -23030,15 +22903,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rollup-plugin-dts@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-2.0.1.tgz#333f50a637e199a073d490b198746f3c6bd07701" - integrity sha512-y38NSXIY37YExCumbGBTL5dXg7pL7XD+Kbe98iEHWFN9yiKJf7t4kKBOkml5ylUDjQIXBnNClGDeRktc1T5dmA== - dependencies: - magic-string "^0.25.7" - optionalDependencies: - "@babel/code-frame" "^7.10.4" - rollup-plugin-dts@^3.0.1: version "3.0.2" resolved "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-3.0.2.tgz#2b628d88f864d271d6eaec2e4c2a60ae4e944c5c" @@ -23088,13 +22952,6 @@ rollup-pluginutils@^2.8.2: dependencies: estree-walker "^0.6.1" -rollup@2.33.x: - version "2.33.3" - resolved "https://registry.npmjs.org/rollup/-/rollup-2.33.3.tgz#ae72ce31f992b09a580072951bfea76e9df17342" - integrity sha512-RpayhPTe4Gu/uFGCmk7Gp5Z9Qic2VsqZ040G+KZZvsZYdcuWaJg678JeDJJvJeEQXminu24a2au+y92CUWVd+w== - optionalDependencies: - fsevents "~2.1.2" - rollup@2.44.x: version "2.44.0" resolved "https://registry.npmjs.org/rollup/-/rollup-2.44.0.tgz#8da324d1c4fd12beef9ae6e12f4068265b6d95eb" @@ -23200,7 +23057,7 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" -sanitize-html@^2.3.2, sanitize-html@^2.3.3: +sanitize-html@^2.3.2: version "2.4.0" resolved "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.4.0.tgz#8da7524332eb210d968971621b068b53f17ab5a3" integrity sha512-Y1OgkUiTPMqwZNRLPERSEi39iOebn2XJLbeiGOBhaJD/yLqtLGu6GE5w7evx177LeGgSE+4p4e107LMiydOf6A== @@ -23328,18 +23185,18 @@ semver@7.0.0: resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@~7.3.0: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@~7.3.0: version "7.3.5" resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - semver@~5.3.0: version "5.3.0" resolved "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -24308,6 +24165,20 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: regexp.prototype.flags "^1.3.0" side-channel "^1.0.2" +string.prototype.matchall@^4.0.5: + version "4.0.5" + resolved "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.5.tgz#59370644e1db7e4c0c045277690cf7b01203c4da" + integrity sha512-Z5ZaXO0svs0M2xd/6By3qpeKpLKd9mO4v4q3oMEQrk8Ck4xOD5d5XeBOOjGrmVZZ/AHB1S0CgG4N5r1G9N3E2Q== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.2" + get-intrinsic "^1.1.1" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + regexp.prototype.flags "^1.3.1" + side-channel "^1.0.4" + string.prototype.padend@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.0.tgz#dc08f57a8010dc5c153550318f67e13adbb72ac3" @@ -24469,20 +24340,6 @@ style-loader@^1.2.1: loader-utils "^2.0.0" schema-utils "^2.6.6" -style-to-js@1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.0.tgz#631cbb20fce204019b3aa1fcb5b69d951ceac4ac" - integrity sha512-1OqefPDxGrlMwcbfpsTVRyzwdhr4W0uxYQzeA2F1CBc8WG04udg2+ybRnvh3XYL4TdHQrCahLtax2jc8xaE6rA== - dependencies: - style-to-object "0.3.0" - -style-to-object@0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" - integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== - dependencies: - inline-style-parser "0.1.1" - stylehacks@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" @@ -24508,18 +24365,6 @@ subscriptions-transport-ws@^0.9.18, subscriptions-transport-ws@^0.9.19: symbol-observable "^1.0.4" ws "^5.2.0 || ^6.0.0 || ^7.0.0" -sucrase@^3.17.1: - version "3.20.0" - resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.20.0.tgz#a80e865830e27d66a912c938491d474164b06205" - integrity sha512-Rsp+BX7DRuCleJvBAHN7gQ3ddk7U0rJev19XlIBF6dAq9vX4Tr5mHk4E7+ig/I7BM3DLYotCmm20lfBElT2XtQ== - dependencies: - commander "^4.0.0" - glob "7.1.6" - lines-and-columns "^1.1.6" - mz "^2.7.0" - pirates "^4.0.1" - ts-interface-checker "^0.1.9" - sucrase@^3.18.0, sucrase@^3.18.2: version "3.18.2" resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.18.2.tgz#d9f16f1dd4f91e0293ad6f692867772eda301e4b" @@ -25342,22 +25187,6 @@ ts-invariant@^0.4.0: dependencies: tslib "^1.9.3" -ts-jest@^26.4.3: - version "26.5.6" - resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-26.5.6.tgz#c32e0746425274e1dfe333f43cd3c800e014ec35" - integrity sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA== - dependencies: - bs-logger "0.x" - buffer-from "1.x" - fast-json-stable-stringify "2.x" - jest-util "^26.1.0" - json5 "2.x" - lodash "4.x" - make-error "1.x" - mkdirp "1.x" - semver "7.x" - yargs-parser "20.x" - ts-loader@^8.0.17: version "8.0.17" resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.17.tgz#98f2ccff9130074f4079fd89b946b4c637b1f2fc" @@ -25664,6 +25493,16 @@ unbox-primitive@^1.0.0: has-symbols "^1.0.0" which-boxed-primitive "^1.0.1" +unbox-primitive@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" + unc-path-regex@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" @@ -26082,11 +25921,6 @@ uuid@3.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -uuid@8.3.2, uuid@^8.0.0, uuid@^8.2.0, uuid@^8.3.0, uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - uuid@^3.1.0, uuid@^3.3.2, uuid@^3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -26097,6 +25931,11 @@ uuid@^7.0.3: resolved "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== +uuid@^8.0.0, uuid@^8.2.0, uuid@^8.3.0, uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + v8-compile-cache@^2.0.3: version "2.1.0" resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" @@ -26509,7 +26348,7 @@ whatwg-url@^8.0.0, whatwg-url@^8.4.0: tr46 "^2.0.2" webidl-conversions "^6.1.0" -which-boxed-primitive@^1.0.1: +which-boxed-primitive@^1.0.1, which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== @@ -26801,13 +26640,6 @@ xml-encryption@1.2.1: xmldom "~0.1.15" xpath "0.0.27" -xml-js@^1.6.11: - version "1.6.11" - resolved "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz#927d2f6947f7f1c19a316dd8eea3614e8b18f8e9" - integrity sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g== - dependencies: - sax "^1.2.4" - xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" @@ -26939,11 +26771,6 @@ yargs-parser@20.2.4, yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@20.x: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" From b044fa6f7cc9a1690b8554528706e7f3c08c53c3 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Fri, 16 Jul 2021 13:19:27 +0200 Subject: [PATCH 060/101] Clean up code according to review Signed-off-by: Philipp Hugenroth --- .changeset/green-lies-hammer.md | 4 +- .../software-catalog/catalog-customization.md | 42 +++++----- .../SupportButton/SupportButton.tsx | 5 +- .../layout/ContentHeader/ContentHeader.tsx | 6 +- .../src/layout/Page/PageWithHeader.tsx | 10 +-- .../ApiExplorerPage/ApiExplorerPage.tsx | 17 ++-- .../src/hooks/useEntityListProvider.tsx | 7 -- .../catalog-react/src/testUtils/providers.tsx | 3 - .../CatalogFilter/CatalogFilter.tsx | 78 ------------------- .../components/CatalogPage/CatalogPage.tsx | 14 ++-- .../CreateComponentButton.tsx | 4 +- .../{indext.ts => index.ts} | 0 .../EntityListContainer.tsx} | 4 +- .../FilteredEntityLayout/FilterContainer.tsx | 68 ++++++++++++++++ .../FilteredEntityLayout.tsx} | 11 ++- .../index.ts | 4 +- .../FilteredTableLayout/FilterContainer.tsx | 51 ------------ .../FilteredTableLayout.tsx | 52 ------------- plugins/catalog/src/index.ts | 3 +- 19 files changed, 136 insertions(+), 247 deletions(-) delete mode 100644 plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx rename plugins/catalog/src/components/CreateComponentButton/{indext.ts => index.ts} (100%) rename plugins/catalog/src/components/{FilteredTableLayout/TableContainer.tsx => FilteredEntityLayout/EntityListContainer.tsx} (84%) create mode 100644 plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx rename plugins/catalog/src/components/{CatalogFilter/index.ts => FilteredEntityLayout/FilteredEntityLayout.tsx} (65%) rename plugins/catalog/src/components/{FilteredTableLayout => FilteredEntityLayout}/index.ts (84%) delete mode 100644 plugins/catalog/src/components/FilteredTableLayout/FilterContainer.tsx delete mode 100644 plugins/catalog/src/components/FilteredTableLayout/FilteredTableLayout.tsx diff --git a/.changeset/green-lies-hammer.md b/.changeset/green-lies-hammer.md index bf0a9a3995..fc7f6e301d 100644 --- a/.changeset/green-lies-hammer.md +++ b/.changeset/green-lies-hammer.md @@ -5,4 +5,6 @@ '@backstage/plugin-catalog': patch --- -Build a general TablePage component to enforce a more responsive layout for the Catalog & API page. Filters are now wrapped in an accordion on smaller screens, enabling the user to see & interact better with the table. Additionally, a test was added, to check that the responsive wrapping is working for the Catalog page. +Changing the layout of the Catalog & API page to use responsive wrappers for table & filters. The goal is to enforce a responsive layout & that the Catalog & API page are better useable on smaller screens by showing more of the main content. To apply this changes to your custom catalog page, you can add the wrappers following the updated documentation on catalog customization. + +Additionally, the tests for Material UI breakpoints were adjusted & used to test the responsive wrappers. diff --git a/docs/features/software-catalog/catalog-customization.md b/docs/features/software-catalog/catalog-customization.md index e0228bf7d0..4049b005f1 100644 --- a/docs/features/software-catalog/catalog-customization.md +++ b/docs/features/software-catalog/catalog-customization.md @@ -29,25 +29,27 @@ default catalog page and create a component in a // https://github.com/backstage/backstage/blob/master/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx export const CustomCatalogPage = () => { return ( - + All your software catalog entities -
- -
+ + +
- -
-
+ + + + + +
-
+ ); }; ``` @@ -141,14 +143,18 @@ export const CustomCatalogPage = () => { return ( ... -
-
- + + +
... }; diff --git a/packages/core-components/src/components/SupportButton/SupportButton.tsx b/packages/core-components/src/components/SupportButton/SupportButton.tsx index 53c9b20273..45012e50a4 100644 --- a/packages/core-components/src/components/SupportButton/SupportButton.tsx +++ b/packages/core-components/src/components/SupportButton/SupportButton.tsx @@ -100,8 +100,9 @@ export const SupportButton = ({ title, children }: SupportButtonProps) => { color="primary" onClick={onClickHandler} > - - + + + Support }, })); -type DefaultTitleProps = { +type ContentHeaderTitleProps = { title?: string; className?: string; }; @@ -65,7 +65,7 @@ type DefaultTitleProps = { const ContentHeaderTitle = ({ title = 'Unknown page', className, -}: DefaultTitleProps) => ( +}: ContentHeaderTitleProps) => ( { +type ThemedHeaderProps = ComponentProps & { themeId: string; -} +}; export const PageWithHeader = ({ themeId, children, ...props -}: React.PropsWithChildren) => ( +}: React.PropsWithChildren) => (
{children} diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx index bf62d06b44..361ce7b55b 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx @@ -25,8 +25,8 @@ import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; import { CatalogTable, CatalogTableRow, - FilteredTableLayout, - TableContainer, + FilteredEntityLayout, + EntityListContainer, FilterContainer, } from '@backstage/plugin-catalog'; import { @@ -54,11 +54,8 @@ const defaultColumns: TableColumn[] = [ CatalogTable.columns.createTagsColumn(), ]; -interface IApiExplorerePageFilterProps { +type ApiExplorerPageProps = { initiallySelectedFilter?: UserListFilterKind; -} - -export type ApiExplorerPageProps = IApiExplorerePageFilterProps & { columns?: TableColumn[]; }; @@ -94,7 +91,7 @@ export const ApiExplorerPage = ({ All your APIs - + - + - - + + diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index 7db2205deb..8ca3efd243 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -84,9 +84,6 @@ export type EntityListContextProps< */ queryParameters: Partial>; - showFiltersDrawer: boolean; - toggleFiltersDrawer: (showFiltersDrawer: boolean) => void; - loading: boolean; error?: Error; }; @@ -111,8 +108,6 @@ export const EntityListProvider = ({ const [requestedFilters, setRequestedFilters] = useState( {} as EntityFilters, ); - // Show - const [showFiltersDrawer, toggleFiltersDrawer] = useState(false); const [outputState, setOutputState] = useState>({ appliedFilters: {} as EntityFilters, entities: [], @@ -208,8 +203,6 @@ export const EntityListProvider = ({ updateFilters, queryParameters: outputState.queryParameters, loading, - showFiltersDrawer, - toggleFiltersDrawer, error, }} > diff --git a/plugins/catalog-react/src/testUtils/providers.tsx b/plugins/catalog-react/src/testUtils/providers.tsx index b8fdd3d8fe..1f9e4f40d6 100644 --- a/plugins/catalog-react/src/testUtils/providers.tsx +++ b/plugins/catalog-react/src/testUtils/providers.tsx @@ -32,7 +32,6 @@ export const MockEntityListContextProvider = ({ const [filters, setFilters] = useState( value.filters ?? {}, ); - const [showFiltersDrawer, toggleFiltersDrawer] = useState(false); const updateFilters = useCallback( ( update: @@ -57,8 +56,6 @@ export const MockEntityListContextProvider = ({ filters, loading: false, queryParameters: {}, - showFiltersDrawer, - toggleFiltersDrawer, }; // Extract value.filters to avoid overwriting it; some tests exercise filter updates. The value diff --git a/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx b/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx deleted file mode 100644 index 6704f429ee..0000000000 --- a/plugins/catalog/src/components/CatalogFilter/CatalogFilter.tsx +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - EntityKindPicker, - EntityLifecyclePicker, - EntityOwnerPicker, - EntityTagPicker, - EntityTypePicker, - UserListFilterKind, - UserListPicker, -} from '@backstage/plugin-catalog-react'; -import { - Accordion, - AccordionDetails, - AccordionSummary, - Grid, - isWidthDown, - Typography, - withWidth, -} from '@material-ui/core'; -import { Breakpoint } from '@material-ui/core/styles/createBreakpoints'; -import ExpandMore from '@material-ui/icons/ExpandMore'; -import React, { PropsWithChildren } from 'react'; - -interface IProps { - initiallySelectedFilter?: UserListFilterKind; - initialFilter?: 'component' | 'api'; -} - -const CatalogFilterWrapper = withWidth()( - ({ width, children }: PropsWithChildren<{ width: Breakpoint }>) => - isWidthDown('md', width) ? ( - - }> - Filters - - {children} - - ) : ( - {children} - ), -); - -export const CatalogFilter = ({ - initiallySelectedFilter = 'owned', - initialFilter = 'component', -}: IProps) => ( - - - - - - - - - - - - - - -); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 5da46eec97..0fe3504c6d 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -38,10 +38,10 @@ import { CatalogTable } from '../CatalogTable'; import { EntityRow } from '../CatalogTable/types'; import { CreateComponentButton } from '../CreateComponentButton/CreateComponentButton'; import { - FilteredTableLayout, - TableContainer, + FilteredEntityLayout, + EntityListContainer, FilterContainer, -} from '../FilteredTableLayout'; +} from '../FilteredEntityLayout'; export type CatalogPageProps = { initiallySelectedFilter?: UserListFilterKind; @@ -65,7 +65,7 @@ export const CatalogPage = ({ All your software catalog entities - + - + - - + + diff --git a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx index 4be93c1aa0..ae2fc4b718 100644 --- a/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx +++ b/plugins/catalog/src/components/CreateComponentButton/CreateComponentButton.tsx @@ -23,7 +23,7 @@ import { useRouteRef } from '@backstage/core-plugin-api'; export const CreateComponentButton = () => { const createComponentLink = useRouteRef(createComponentRouteRef); - return !createComponentLink ? null : ( + return createComponentLink ? ( - ); + ) : null; }; diff --git a/plugins/catalog/src/components/CreateComponentButton/indext.ts b/plugins/catalog/src/components/CreateComponentButton/index.ts similarity index 100% rename from plugins/catalog/src/components/CreateComponentButton/indext.ts rename to plugins/catalog/src/components/CreateComponentButton/index.ts diff --git a/plugins/catalog/src/components/FilteredTableLayout/TableContainer.tsx b/plugins/catalog/src/components/FilteredEntityLayout/EntityListContainer.tsx similarity index 84% rename from plugins/catalog/src/components/FilteredTableLayout/TableContainer.tsx rename to plugins/catalog/src/components/FilteredEntityLayout/EntityListContainer.tsx index f5f5ae0de6..a39ef76b87 100644 --- a/plugins/catalog/src/components/FilteredTableLayout/TableContainer.tsx +++ b/plugins/catalog/src/components/FilteredEntityLayout/EntityListContainer.tsx @@ -15,9 +15,9 @@ */ import { Grid } from '@material-ui/core'; -import React from 'react'; +import React, { PropsWithChildren } from 'react'; -export const TableContainer = ({ children }: React.PropsWithChildren<{}>) => ( +export const EntityListContainer = ({ children }: PropsWithChildren<{}>) => ( {children} diff --git a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx new file mode 100644 index 0000000000..6502811332 --- /dev/null +++ b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx @@ -0,0 +1,68 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BackstageTheme } from '@backstage/theme'; +import { + Box, + Button, + Drawer, + Grid, + useMediaQuery, + useTheme, +} from '@material-ui/core'; +import FilterListIcon from '@material-ui/icons/FilterList'; +import React, { useState } from 'react'; + +export const FilterContainer = ({ children }: React.PropsWithChildren<{}>) => { + const isMidSizeScreen = useMediaQuery(theme => + theme.breakpoints.down('md'), + ); + const theme = useTheme(); + const [showFiltersDrawer, toggleFiltersDrawer] = useState(false); + + return isMidSizeScreen ? ( + <> + + { + toggleFiltersDrawer(false); + }} + elevation={0} + anchor="left" + disableAutoFocus + keepMounted + variant="temporary" + > + {children} + + + ) : ( + + {children} + + ); +}; diff --git a/plugins/catalog/src/components/CatalogFilter/index.ts b/plugins/catalog/src/components/FilteredEntityLayout/FilteredEntityLayout.tsx similarity index 65% rename from plugins/catalog/src/components/CatalogFilter/index.ts rename to plugins/catalog/src/components/FilteredEntityLayout/FilteredEntityLayout.tsx index dc57ef02e2..628ad9fee6 100644 --- a/plugins/catalog/src/components/CatalogFilter/index.ts +++ b/plugins/catalog/src/components/FilteredEntityLayout/FilteredEntityLayout.tsx @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,4 +14,11 @@ * limitations under the License. */ -export { CatalogFilter } from './CatalogFilter'; +import { Grid } from '@material-ui/core'; +import React, { PropsWithChildren } from 'react'; + +export const FilteredEntityLayout = ({ children }: PropsWithChildren<{}>) => ( + + {children} + +); diff --git a/plugins/catalog/src/components/FilteredTableLayout/index.ts b/plugins/catalog/src/components/FilteredEntityLayout/index.ts similarity index 84% rename from plugins/catalog/src/components/FilteredTableLayout/index.ts rename to plugins/catalog/src/components/FilteredEntityLayout/index.ts index 9fa89259ab..ded61a4edc 100644 --- a/plugins/catalog/src/components/FilteredTableLayout/index.ts +++ b/plugins/catalog/src/components/FilteredEntityLayout/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export { FilteredTableLayout } from './FilteredTableLayout'; +export { FilteredEntityLayout } from './FilteredEntityLayout'; export { FilterContainer } from './FilterContainer'; -export { TableContainer } from './TableContainer'; +export { EntityListContainer } from './EntityListContainer'; diff --git a/plugins/catalog/src/components/FilteredTableLayout/FilterContainer.tsx b/plugins/catalog/src/components/FilteredTableLayout/FilterContainer.tsx deleted file mode 100644 index 0fa26f6c66..0000000000 --- a/plugins/catalog/src/components/FilteredTableLayout/FilterContainer.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2021 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Box, Drawer, Grid, useMediaQuery } from '@material-ui/core'; -import { useEntityListProvider } from '@backstage/plugin-catalog-react'; -import { BackstageTheme } from '@backstage/theme'; -import React from 'react'; - -export const FilterContainer = ({ children }: React.PropsWithChildren<{}>) => { - const isMidSizeScreen = useMediaQuery(theme => - theme.breakpoints.down('md'), - ); - const { showFiltersDrawer, toggleFiltersDrawer } = useEntityListProvider(); - - return isMidSizeScreen ? ( - { - toggleFiltersDrawer(false); - }} - PaperProps={{ - style: { width: '300px' }, - }} - elevation={0} - anchor="left" - disableAutoFocus - keepMounted - variant="temporary" - > - {children} - - ) : ( - - {children} - - ); -}; diff --git a/plugins/catalog/src/components/FilteredTableLayout/FilteredTableLayout.tsx b/plugins/catalog/src/components/FilteredTableLayout/FilteredTableLayout.tsx deleted file mode 100644 index 0820a4d865..0000000000 --- a/plugins/catalog/src/components/FilteredTableLayout/FilteredTableLayout.tsx +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2021 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { useEntityListProvider } from '@backstage/plugin-catalog-react'; -import { BackstageTheme } from '@backstage/theme'; -import { Box, Button, Grid, useMediaQuery, useTheme } from '@material-ui/core'; -import FilterListIcon from '@material-ui/icons/FilterList'; -import React, { Fragment } from 'react'; - -interface IProps {} - -export const FilteredTableLayout = ({ - children, -}: React.PropsWithChildren) => { - const isMidSizeScreen = useMediaQuery(theme => - theme.breakpoints.down('md'), - ); - const { showFiltersDrawer, toggleFiltersDrawer } = useEntityListProvider(); - const theme = useTheme(); - - return ( - - {isMidSizeScreen && ( - - )} - - {children} - - - ); -}; diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index 8585177cd9..4b348580f7 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -40,5 +40,4 @@ export { EntitySystemDiagramCard, } from './plugin'; export * from './components/CatalogTable/columns'; -export * from './components/CatalogFilter'; -export * from './components/FilteredTableLayout'; +export * from './components/FilteredEntityLayout'; From 5858056f793659f2809913806b34a74240939694 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Fri, 16 Jul 2021 13:53:49 +0200 Subject: [PATCH 061/101] Update API reports Add Title to Filters Drawer Signed-off-by: Philipp Hugenroth --- packages/core-components/api-report.md | 4 +-- .../src/layout/Page/PageWithHeader.tsx | 6 ++-- plugins/api-docs/api-report.md | 6 ++-- plugins/catalog/api-report.md | 30 +++++++------------ .../FilteredEntityLayout/FilterContainer.tsx | 12 +++++++- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index bfc6852a97..e8d3214beb 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -1202,7 +1202,7 @@ export const Page: ({ children, }: PropsWithChildren) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "IProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "ThemedHeaderProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "PageWithHeader" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -1210,7 +1210,7 @@ export const PageWithHeader: ({ themeId, children, ...props -}: React_2.PropsWithChildren) => JSX.Element; +}: React_2.PropsWithChildren) => JSX.Element; // Warning: (ae-missing-release-tag) "Progress" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/packages/core-components/src/layout/Page/PageWithHeader.tsx b/packages/core-components/src/layout/Page/PageWithHeader.tsx index 4155805476..6095b4df16 100644 --- a/packages/core-components/src/layout/Page/PageWithHeader.tsx +++ b/packages/core-components/src/layout/Page/PageWithHeader.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ -import React, { ComponentProps } from 'react'; +import React, { PropsWithChildren, ComponentProps } from 'react'; import { Header } from '../Header'; import { Page } from './Page'; -type ThemedHeaderProps = ComponentProps & { +export type ThemedHeaderProps = ComponentProps & { themeId: string; }; @@ -27,7 +27,7 @@ export const PageWithHeader = ({ themeId, children, ...props -}: React.PropsWithChildren) => ( +}: PropsWithChildren) => (
{children} diff --git a/plugins/api-docs/api-report.md b/plugins/api-docs/api-report.md index a368cf5675..639485a42d 100644 --- a/plugins/api-docs/api-report.md +++ b/plugins/api-docs/api-report.md @@ -52,14 +52,16 @@ const apiDocsPlugin: BackstagePlugin< export { apiDocsPlugin }; export { apiDocsPlugin as plugin }; -// Warning: (ae-forgotten-export) The symbol "ApiExplorerPageProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "ApiExplorerPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) export const ApiExplorerPage: ({ initiallySelectedFilter, columns, -}: ApiExplorerPageProps) => JSX.Element; +}: { + initiallySelectedFilter?: UserListFilterKind | undefined; + columns?: TableColumn[] | undefined; +}) => JSX.Element; // Warning: (ae-missing-release-tag) "ApiTypeTitle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index b3169d5c29..4ed69230ec 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -48,15 +48,6 @@ export const AboutField: ({ // @public (undocumented) export const CatalogEntityPage: () => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "IProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "CatalogFilter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const CatalogFilter: ({ - initiallySelectedFilter, - initialFilter, -}: IProps) => JSX.Element; - // Warning: (ae-forgotten-export) The symbol "CatalogPageProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "CatalogIndexPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -247,6 +238,13 @@ export const EntityLinksCard: ({ variant?: 'gridItem' | undefined; }) => JSX.Element; +// Warning: (ae-missing-release-tag) "EntityListContainer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const EntityListContainer: ({ + children, +}: PropsWithChildren<{}>) => JSX.Element; + // Warning: (ae-missing-release-tag) "EntityOrphanWarning" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public @@ -292,13 +290,12 @@ export const FilterContainer: ({ children, }: React_2.PropsWithChildren<{}>) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "IProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "FilteredTableLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "FilteredEntityLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const FilteredTableLayout: ({ +export const FilteredEntityLayout: ({ children, -}: React_2.PropsWithChildren) => JSX.Element; +}: PropsWithChildren<{}>) => JSX.Element; // Warning: (ae-missing-release-tag) "isComponentType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -329,13 +326,6 @@ export const Router: ({ EntityPage?: React_2.ComponentType<{}> | undefined; }) => JSX.Element; -// Warning: (ae-missing-release-tag) "TableContainer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const TableContainer: ({ - children, -}: React_2.PropsWithChildren<{}>) => JSX.Element; - // Warnings were encountered during analysis: // // src/components/CatalogTable/CatalogTable.d.ts:10:5 - (ae-forgotten-export) The symbol "CatalogTableProps" needs to be exported by the entry point index.d.ts diff --git a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx index 6502811332..693d2f23b3 100644 --- a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx +++ b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx @@ -20,6 +20,7 @@ import { Button, Drawer, Grid, + Typography, useMediaQuery, useTheme, } from '@material-ui/core'; @@ -57,7 +58,16 @@ export const FilterContainer = ({ children }: React.PropsWithChildren<{}>) => { keepMounted variant="temporary" > - {children} + + + Filters + + {children} + ) : ( From 03d23b25255e59af3e113e67926ae5f6d8c9ceea Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 16 Jul 2021 14:02:18 +0200 Subject: [PATCH 062/101] chore: fix dependencies Signed-off-by: blam --- packages/cli/package.json | 2 +- yarn.lock | 48 ++++++--------------------------------- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index ba4ce0b139..725149a823 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -54,7 +54,7 @@ "@types/webpack-env": "^1.15.2", "@types/webpack-node-externals": "^2.5.0", "@typescript-eslint/eslint-plugin": "^v4.28.3", - "@typescript-eslint/parser": "^v4.27.0", + "@typescript-eslint/parser": "^v4.28.3", "@yarnpkg/lockfile": "^1.1.0", "babel-plugin-dynamic-import-node": "^2.3.3", "bfj": "^7.0.2", diff --git a/yarn.lock b/yarn.lock index e1d02ebd5f..7d879ae042 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6758,24 +6758,16 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@^v4.27.0": - version "4.27.0" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.27.0.tgz#85447e573364bce4c46c7f64abaa4985aadf5a94" - integrity sha512-XpbxL+M+gClmJcJ5kHnUpBGmlGdgNvy6cehgR6ufyxkEJMGP25tZKCaKyC0W/JVpuhU3VU1RBn7SYUPKSMqQvQ== +"@typescript-eslint/parser@^v4.28.3": + version "4.28.3" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.28.3.tgz#95f1d475c08268edffdcb2779993c488b6434b44" + integrity sha512-ZyWEn34bJexn/JNYvLQab0Mo5e+qqQNhknxmc8azgNd4XqspVYR5oHq9O11fLwdZMRcj4by15ghSlIEq+H5ltQ== dependencies: - "@typescript-eslint/scope-manager" "4.27.0" - "@typescript-eslint/types" "4.27.0" - "@typescript-eslint/typescript-estree" "4.27.0" + "@typescript-eslint/scope-manager" "4.28.3" + "@typescript-eslint/types" "4.28.3" + "@typescript-eslint/typescript-estree" "4.28.3" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.27.0": - version "4.27.0" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.27.0.tgz#b0b1de2b35aaf7f532e89c8e81d0fa298cae327d" - integrity sha512-DY73jK6SEH6UDdzc6maF19AHQJBFVRf6fgAXHPXCGEmpqD4vYgPEzqpFz1lf/daSbOcMpPPj9tyXXDPW2XReAw== - dependencies: - "@typescript-eslint/types" "4.27.0" - "@typescript-eslint/visitor-keys" "4.27.0" - "@typescript-eslint/scope-manager@4.28.3": version "4.28.3" resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.3.tgz#c32ad4491b3726db1ba34030b59ea922c214e371" @@ -6784,29 +6776,11 @@ "@typescript-eslint/types" "4.28.3" "@typescript-eslint/visitor-keys" "4.28.3" -"@typescript-eslint/types@4.27.0": - version "4.27.0" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.27.0.tgz#712b408519ed699baff69086bc59cd2fc13df8d8" - integrity sha512-I4ps3SCPFCKclRcvnsVA/7sWzh7naaM/b4pBO2hVxnM3wrU51Lveybdw5WoIktU/V4KfXrTt94V9b065b/0+wA== - "@typescript-eslint/types@4.28.3": version "4.28.3" resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.28.3.tgz#8fffd436a3bada422c2c1da56060a0566a9506c7" integrity sha512-kQFaEsQBQVtA9VGVyciyTbIg7S3WoKHNuOp/UF5RG40900KtGqfoiETWD/v0lzRXc+euVE9NXmfer9dLkUJrkA== -"@typescript-eslint/typescript-estree@4.27.0": - version "4.27.0" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.27.0.tgz#189a7b9f1d0717d5cccdcc17247692dedf7a09da" - integrity sha512-KH03GUsUj41sRLLEy2JHstnezgpS5VNhrJouRdmh6yNdQ+yl8w5LrSwBkExM+jWwCJa7Ct2c8yl8NdtNRyQO6g== - dependencies: - "@typescript-eslint/types" "4.27.0" - "@typescript-eslint/visitor-keys" "4.27.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@4.28.3": version "4.28.3" resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.3.tgz#253d7088100b2a38aefe3c8dd7bd1f8232ec46fb" @@ -6820,14 +6794,6 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@4.27.0": - version "4.27.0" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.27.0.tgz#f56138b993ec822793e7ebcfac6ffdce0a60cb81" - integrity sha512-es0GRYNZp0ieckZ938cEANfEhsfHrzuLrePukLKtY3/KPXcq1Xd555Mno9/GOgXhKzn0QfkDLVgqWO3dGY80bg== - dependencies: - "@typescript-eslint/types" "4.27.0" - eslint-visitor-keys "^2.0.0" - "@typescript-eslint/visitor-keys@4.28.3": version "4.28.3" resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.3.tgz#26ac91e84b23529968361045829da80a4e5251c4" From 4e1b7d5cd7a7da1c8f75b4b3aee7cc921302c710 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Fri, 16 Jul 2021 14:13:43 +0200 Subject: [PATCH 063/101] Update API report Signed-off-by: Philipp Hugenroth --- packages/core-components/api-report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index e8d3214beb..7f381deb4b 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -1210,7 +1210,7 @@ export const PageWithHeader: ({ themeId, children, ...props -}: React_2.PropsWithChildren) => JSX.Element; +}: PropsWithChildren) => JSX.Element; // Warning: (ae-missing-release-tag) "Progress" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // From d488326303b353ddfbcf2223c693240154e59745 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Fri, 16 Jul 2021 14:53:25 +0200 Subject: [PATCH 064/101] Fix test Signed-off-by: Philipp Hugenroth --- .../catalog/src/components/CatalogPage/CatalogPage.test.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index db0613dc47..598f534d14 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -248,9 +248,8 @@ describe('CatalogPage', () => { it('should wrap filter in drawer on smaller screens', async () => { mockBreakpoint({ matches: true }); - const { findByText, getByTestId } = await renderWrapped(); + const { getByTestId } = await renderWrapped(); expect(getByTestId('entity-filters-drawer')).toBeInTheDocument(); - await expect(findByText('Filters')).resolves.toBeInTheDocument(); }); it('should wrap filter in grid on larger screens', async () => { From 099f7cf4b6f75eb09bb00cac9cda0b1a36dd06a5 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 16 Jul 2021 15:02:58 +0200 Subject: [PATCH 065/101] chore: bump eslint Signed-off-by: blam --- packages/cli/package.json | 2 +- yarn.lock | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 725149a823..c539b1a382 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -65,7 +65,7 @@ "dashify": "^2.0.0", "diff": "^5.0.0", "esbuild": "^0.8.56", - "eslint": "^7.1.0", + "eslint": "^7.30.0", "eslint-config-prettier": "^8.3.0", "eslint-formatter-friendly": "^7.0.0", "eslint-plugin-import": "^2.20.2", diff --git a/yarn.lock b/yarn.lock index 8fc50e7343..2d1dd0e10b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2438,6 +2438,20 @@ prop-types "^15.6.2" scheduler "^0.19.0" +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" + integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== + "@iarna/toml@^2.2.5": version "2.2.5" resolved "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c" @@ -12153,13 +12167,14 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@^7.1.0: - version "7.28.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz#435aa17a0b82c13bb2be9d51408b617e49c1e820" - integrity sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g== +eslint@^7.30.0: + version "7.30.0" + resolved "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz#6d34ab51aaa56112fd97166226c9a97f505474f8" + integrity sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.2" + "@humanwhocodes/config-array" "^0.5.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" From 9a96b5da7520205aee2e59b119037471d04d1bfe Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 16 Jul 2021 15:05:16 +0200 Subject: [PATCH 066/101] chore: changeset Signed-off-by: blam --- .changeset/honest-ghosts-listen.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/honest-ghosts-listen.md diff --git a/.changeset/honest-ghosts-listen.md b/.changeset/honest-ghosts-listen.md new file mode 100644 index 0000000000..411a7e8908 --- /dev/null +++ b/.changeset/honest-ghosts-listen.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +chore: bump `eslint` to `7.30.0` From aa966c05d7b4915a99782304b272b41a61a03660 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Fri, 16 Jul 2021 15:37:21 +0200 Subject: [PATCH 067/101] Adjust header styles Signed-off-by: Philipp Hugenroth --- .../src/layout/Header/Header.tsx | 12 +++++++--- .../src/layout/HeaderLabel/HeaderLabel.tsx | 24 +++++++++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/packages/core-components/src/layout/Header/Header.tsx b/packages/core-components/src/layout/Header/Header.tsx index 41729f682b..1af1e2cc2f 100644 --- a/packages/core-components/src/layout/Header/Header.tsx +++ b/packages/core-components/src/layout/Header/Header.tsx @@ -22,13 +22,14 @@ import { Helmet } from 'react-helmet'; import { Link } from '../../components/Link'; import { Breadcrumbs } from '../Breadcrumbs'; +const minHeaderHeight = 118; + const useStyles = makeStyles(theme => ({ header: { gridArea: 'pageHeader', padding: theme.spacing(3), height: 'fit-content', - // Where does this number come from? :/ - minHeight: 118, + minHeight: minHeaderHeight, width: '100%', boxShadow: '0 0 8px 3px rgba(20, 20, 20, 0.3)', position: 'relative', @@ -215,7 +216,12 @@ export const Header = ({ /> - + {children}
diff --git a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx index 8c3df0ba72..f9d8b4d345 100644 --- a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx +++ b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx @@ -23,19 +23,15 @@ const useStyles = makeStyles(theme => ({ display: 'inline-block', }, label: { - color: '#FFFFFF', + color: theme.palette.common.white, fontWeight: 'bold', - lineHeight: '16px', letterSpacing: 0, - fontSize: 14, - height: '16px', - marginBottom: 4, + fontSize: theme.typography.fontSize, + marginBottom: theme.spacing(1), }, value: { color: 'rgba(255, 255, 255, 0.8)', - lineHeight: '16px', - fontSize: 14, - height: '16px', + fontSize: theme.typography.fontSize, }, })); @@ -65,8 +61,16 @@ export const HeaderLabel = ({ label, value, url }: HeaderLabelProps) => { return ( - {label} - {url ? {content} : content} + + {label} + + {url ? ( + + {content} + + ) : ( + content + )} ); From 03bf17e9b82ab94d5a4efecb43f35143ff32d9e0 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Fri, 16 Jul 2021 16:19:22 +0200 Subject: [PATCH 068/101] Add changeset Adjust HeaderLabel to use theme properties Signed-off-by: Philipp Hugenroth --- .changeset/poor-jars-sniff.md | 10 ++++++++++ .../src/layout/HeaderLabel/HeaderLabel.tsx | 17 +++++------------ .../app/src/components/catalog/EntityPage.tsx | 7 +++++++ 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 .changeset/poor-jars-sniff.md diff --git a/.changeset/poor-jars-sniff.md b/.changeset/poor-jars-sniff.md new file mode 100644 index 0000000000..c45cd174a0 --- /dev/null +++ b/.changeset/poor-jars-sniff.md @@ -0,0 +1,10 @@ +--- +'example-app': patch +'@backstage/core-components': patch +'@backstage/create-app': patch +'@backstage/plugin-api-docs': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-techdocs': patch +--- + +Improve the responsiveness of the EntityPage UI. With this the Header component should scale with the screen size & wrapping should not cause overflowing/blocking of links. Additionally enforce the Pages using the Grid Layout to use it across all screen sizes & to wrap as intended. diff --git a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx index f9d8b4d345..8557ceddf7 100644 --- a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx +++ b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx @@ -20,18 +20,19 @@ import React from 'react'; const useStyles = makeStyles(theme => ({ root: { textAlign: 'left', - display: 'inline-block', }, label: { color: theme.palette.common.white, fontWeight: 'bold', letterSpacing: 0, fontSize: theme.typography.fontSize, - marginBottom: theme.spacing(1), + marginBottom: theme.spacing(1) / 2, + lineHeight: 1, }, value: { color: 'rgba(255, 255, 255, 0.8)', fontSize: theme.typography.fontSize, + lineHeight: 1, }, })); @@ -61,16 +62,8 @@ export const HeaderLabel = ({ label, value, url }: HeaderLabelProps) => { return ( - - {label} - - {url ? ( - - {content} - - ) : ( - content - )} + {label} + {url ? {content} : content} ); 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 e3dd5be3c7..f7eb7c6349 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 @@ -157,6 +157,13 @@ const websiteEntityPage = ( ); +/** + * TODO: For the MUI Grid to work there have to be "xs" set on every GridItem, + * such that the seperation of space is clear from the smalles screen size upwards + * https://material-ui.com/components/grid/#basic-grid. + */ + + const defaultEntityPage = ( From 6e5aed1c9942e8456167000d49fce51f27cc7230 Mon Sep 17 00:00:00 2001 From: Phil Kuang Date: Fri, 16 Jul 2021 15:04:33 -0400 Subject: [PATCH 069/101] fix(techdocs): properly validate mkdocs docs_dir property Signed-off-by: Phil Kuang --- .changeset/angry-spies-warn.md | 5 +++++ .../generate/__fixtures__/mkdocs_valid_doc_dir.yml | 3 +++ .../src/stages/generate/helpers.test.ts | 10 ++++++++++ .../techdocs-common/src/stages/generate/helpers.ts | 6 +++++- 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .changeset/angry-spies-warn.md create mode 100644 packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml diff --git a/.changeset/angry-spies-warn.md b/.changeset/angry-spies-warn.md new file mode 100644 index 0000000000..171827748a --- /dev/null +++ b/.changeset/angry-spies-warn.md @@ -0,0 +1,5 @@ +--- +'@backstage/techdocs-common': patch +--- + +Fix validation of mkdocs.yml docs_dir diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml b/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml new file mode 100644 index 0000000000..e75b06ada7 --- /dev/null +++ b/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml @@ -0,0 +1,3 @@ +site_name: Test site name +site_description: Test site description +docs_dir: docs/ diff --git a/packages/techdocs-common/src/stages/generate/helpers.test.ts b/packages/techdocs-common/src/stages/generate/helpers.test.ts index b6b71e3e2b..a5a6d99c29 100644 --- a/packages/techdocs-common/src/stages/generate/helpers.test.ts +++ b/packages/techdocs-common/src/stages/generate/helpers.test.ts @@ -47,6 +47,9 @@ const mkdocsYmlWithExtensions = fs.readFileSync( const mkdocsYmlWithRepoUrl = fs.readFileSync( resolvePath(__filename, '../__fixtures__/mkdocs_with_repo_url.yml'), ); +const mkdocsYmlWithValidDocDir = fs.readFileSync( + resolvePath(__filename, '../__fixtures__/mkdocs_valid_doc_dir.yml'), +); const mkdocsYmlWithInvalidDocDir = fs.readFileSync( resolvePath(__filename, '../__fixtures__/mkdocs_invalid_doc_dir.yml'), ); @@ -336,6 +339,7 @@ describe('helpers', () => { mockFs({ '/mkdocs.yml': mkdocsYml, '/mkdocs_with_extensions.yml': mkdocsYmlWithExtensions, + '/mkdocs_valid_doc_dir.yml': mkdocsYmlWithValidDocDir, '/mkdocs_invalid_doc_dir.yml': mkdocsYmlWithInvalidDocDir, }); }); @@ -351,6 +355,12 @@ describe('helpers', () => { ).resolves.toBeUndefined(); }); + it('should return true on when a valid docs_dir is present', async () => { + await expect( + validateMkdocsYaml(inputDir, '/mkdocs_valid_doc_dir.yml'), + ).resolves.toBeUndefined(); + }); + it('should return false on absolute doc_dir path', async () => { await expect( validateMkdocsYaml(inputDir, '/mkdocs_invalid_doc_dir.yml'), diff --git a/packages/techdocs-common/src/stages/generate/helpers.ts b/packages/techdocs-common/src/stages/generate/helpers.ts index 086377b4ef..590e75e7b2 100644 --- a/packages/techdocs-common/src/stages/generate/helpers.ts +++ b/packages/techdocs-common/src/stages/generate/helpers.ts @@ -19,6 +19,7 @@ import { isChildPath } from '@backstage/backend-common'; import { spawn } from 'child_process'; import fs from 'fs-extra'; import yaml, { DEFAULT_SCHEMA, Type } from 'js-yaml'; +import { resolve as resolvePath } from 'path'; import { PassThrough, Writable } from 'stream'; import { Logger } from 'winston'; import { ParsedLocationAnnotation } from '../../helpers'; @@ -178,7 +179,10 @@ export const validateMkdocsYaml = async ( schema: MKDOCS_SCHEMA, }); - if (mkdocsYml.docs_dir && !isChildPath(inputDir, mkdocsYml.docs_dir)) { + if ( + mkdocsYml.docs_dir && + !isChildPath(inputDir, resolvePath(inputDir, mkdocsYml.docs_dir)) + ) { throw new Error( `docs_dir configuration value in mkdocs can't be an absolute directory or start with ../ for security reasons. Use relative paths instead which are resolved relative to your mkdocs.yml file location.`, From 71c936eb626b59b439cb91b5e3c14bfc74a85f30 Mon Sep 17 00:00:00 2001 From: Phil Kuang Date: Fri, 16 Jul 2021 18:05:13 -0400 Subject: [PATCH 070/101] chore(catalog): export CatalogClientWrapper class Signed-off-by: Phil Kuang --- .changeset/clever-pigs-drum.md | 5 ++ .changeset/nasty-worms-approve.md | 5 ++ packages/catalog-client/api-report.md | 9 +++- packages/catalog-client/src/types/index.ts | 1 + plugins/catalog/api-report.md | 56 +++++++++++++++++++++ plugins/catalog/src/CatalogClientWrapper.ts | 7 +-- plugins/catalog/src/index.ts | 1 + 7 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 .changeset/clever-pigs-drum.md create mode 100644 .changeset/nasty-worms-approve.md diff --git a/.changeset/clever-pigs-drum.md b/.changeset/clever-pigs-drum.md new file mode 100644 index 0000000000..bbc8ee5f90 --- /dev/null +++ b/.changeset/clever-pigs-drum.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-client': patch +--- + +Export `CatalogRequestOptions` type diff --git a/.changeset/nasty-worms-approve.md b/.changeset/nasty-worms-approve.md new file mode 100644 index 0000000000..c3ed7c1b35 --- /dev/null +++ b/.changeset/nasty-worms-approve.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Export `CatalogClientWrapper` class diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 52757614a7..c356deed4f 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -34,8 +34,6 @@ export interface CatalogApi { location: AddLocationRequest, options?: CatalogRequestOptions, ): Promise; - // Warning: (ae-forgotten-export) The symbol "CatalogRequestOptions" needs to be exported by the entry point index.d.ts - // // (undocumented) getEntities( request?: CatalogEntitiesRequest, @@ -138,6 +136,13 @@ export type CatalogListResponse = { items: T[]; }; +// Warning: (ae-missing-release-tag) "CatalogRequestOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type CatalogRequestOptions = { + token?: string; +}; + // Warning: (ae-missing-release-tag) "ENTITY_STATUS_CATALOG_PROCESSING_TYPE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public diff --git a/packages/catalog-client/src/types/index.ts b/packages/catalog-client/src/types/index.ts index 842d0393a4..6ec17fbae1 100644 --- a/packages/catalog-client/src/types/index.ts +++ b/packages/catalog-client/src/types/index.ts @@ -20,5 +20,6 @@ export type { CatalogApi, CatalogEntitiesRequest, CatalogListResponse, + CatalogRequestOptions, } from './api'; export { ENTITY_STATUS_CATALOG_PROCESSING_TYPE } from './status'; diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index a85954906a..ec8bd66385 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -5,12 +5,21 @@ ```ts /// +import { AddLocationRequest } from '@backstage/catalog-client'; +import { AddLocationResponse } from '@backstage/catalog-client'; import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { CatalogApi } from '@backstage/catalog-client'; +import { CatalogClient } from '@backstage/catalog-client'; +import { CatalogEntitiesRequest } from '@backstage/catalog-client'; +import { CatalogListResponse } from '@backstage/catalog-client'; +import { CatalogRequestOptions } from '@backstage/catalog-client'; import { Entity } from '@backstage/catalog-model'; import { EntityName } from '@backstage/catalog-model'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { IconComponent } from '@backstage/core-plugin-api'; +import { IdentityApi } from '@backstage/core-plugin-api'; import { InfoCardVariants } from '@backstage/core-components'; +import { Location as Location_2 } from '@backstage/catalog-model'; import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; import { ReactNode } from 'react'; @@ -43,6 +52,53 @@ export const AboutField: ({ children, }: Props_3) => JSX.Element; +// Warning: (ae-missing-release-tag) "CatalogClientWrapper" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export class CatalogClientWrapper implements CatalogApi { + constructor(options: { client: CatalogClient; identityApi: IdentityApi }); + // (undocumented) + addLocation( + request: AddLocationRequest, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getEntities( + request?: CatalogEntitiesRequest, + options?: CatalogRequestOptions, + ): Promise>; + // (undocumented) + getEntityByName( + compoundName: EntityName, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getLocationByEntity( + entity: Entity, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getLocationById( + id: string, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + getOriginLocationByEntity( + entity: Entity, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + removeEntityByUid( + uid: string, + options?: CatalogRequestOptions, + ): Promise; + // (undocumented) + removeLocationById( + id: string, + options?: CatalogRequestOptions, + ): Promise; +} + // Warning: (ae-missing-release-tag) "CatalogEntityPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/catalog/src/CatalogClientWrapper.ts b/plugins/catalog/src/CatalogClientWrapper.ts index a10b968216..a46edb56b7 100644 --- a/plugins/catalog/src/CatalogClientWrapper.ts +++ b/plugins/catalog/src/CatalogClientWrapper.ts @@ -19,16 +19,13 @@ import { AddLocationRequest, AddLocationResponse, CatalogApi, + CatalogClient, CatalogEntitiesRequest, CatalogListResponse, - CatalogClient, + CatalogRequestOptions, } from '@backstage/catalog-client'; import { IdentityApi } from '@backstage/core-plugin-api'; -type CatalogRequestOptions = { - token?: string; -}; - /** * CatalogClient wrapper that injects identity token for all requests */ diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index f2f28679a5..4bef0950a2 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -15,6 +15,7 @@ */ export * from './components/AboutCard'; +export { CatalogClientWrapper } from './CatalogClientWrapper'; export { CatalogLayout } from './components/CatalogPage'; export { CatalogResultListItem } from './components/CatalogResultListItem'; export { CatalogTable } from './components/CatalogTable'; From 2a6674c529ecde1cc1ac6d32f68a113aaffbd07b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 04:46:05 +0000 Subject: [PATCH 071/101] chore(deps): bump @testing-library/jest-dom from 5.11.9 to 5.14.1 Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.11.9 to 5.14.1. - [Release notes](https://github.com/testing-library/jest-dom/releases) - [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/jest-dom/compare/v5.11.9...v5.14.1) --- updated-dependencies: - dependency-name: "@testing-library/jest-dom" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index 55e546fb12..d107739311 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5258,9 +5258,9 @@ pretty-format "^26.6.2" "@testing-library/jest-dom@^5.10.1": - version "5.11.9" - resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.11.9.tgz#e6b3cd687021f89f261bd53cbe367041fbd3e975" - integrity sha512-Mn2gnA9d1wStlAIT2NU8J15LNob0YFBVjs2aEQ3j8rsfRQo+lAs7/ui1i2TGaJjapLmuNPLTsrm+nPjmZDwpcQ== + version "5.14.1" + resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.14.1.tgz#8501e16f1e55a55d675fe73eecee32cdaddb9766" + integrity sha512-dfB7HVIgTNCxH22M1+KU6viG5of2ldoA5ly8Ar8xkezKHKXjRvznCdbMbqjYGgO2xjRbwnR+rR8MLUIqF3kKbQ== dependencies: "@babel/runtime" "^7.9.2" "@types/testing-library__jest-dom" "^5.9.1" @@ -5268,6 +5268,7 @@ chalk "^3.0.0" css "^3.0.0" css.escape "^1.5.1" + dom-accessibility-api "^0.5.6" lodash "^4.17.15" redent "^3.0.0" @@ -11336,10 +11337,10 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-accessibility-api@^0.5.4: - version "0.5.4" - resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.4.tgz#b06d059cdd4a4ad9a79275f9d414a5c126241166" - integrity sha512-TvrjBckDy2c6v6RLxPv5QXOnU+SmF9nBII5621Ve5fu6Z/BDrENurBEvlC1f44lKEUVqOpK4w9E5Idc5/EgkLQ== +dom-accessibility-api@^0.5.4, dom-accessibility-api@^0.5.6: + version "0.5.6" + resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.6.tgz#3f5d43b52c7a3bd68b5fb63fa47b4e4c1fdf65a9" + integrity sha512-DplGLZd8L1lN64jlT27N9TVSESFR5STaEJvX+thCby7fuCHonfPpAlodYc3vuUYbDuDec5w8AMP7oCM5TWFsqw== dom-converter@^0.2: version "0.2.0" From 5bd64da42a29b919a37169973f1ee60a9b98c0af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 04:46:33 +0000 Subject: [PATCH 072/101] chore(deps-dev): bump @storybook/addon-links from 6.1.11 to 6.3.4 Bumps [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/addons/links) from 6.1.11 to 6.3.4. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.3.4/addons/links) --- updated-dependencies: - dependency-name: "@storybook/addon-links" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 213 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 109 insertions(+), 104 deletions(-) diff --git a/yarn.lock b/yarn.lock index 55e546fb12..ddf68e7725 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4286,20 +4286,20 @@ uuid-browser "^3.1.0" "@storybook/addon-links@^6.1.11": - version "6.1.11" - resolved "https://registry.npmjs.org/@storybook/addon-links/-/addon-links-6.1.11.tgz#84b20b0c13bbfc8270cdf52389ce52f98c415b6a" - integrity sha512-OIBeOdTHNr/egIuyOUEtEBtZJXVp9PEPQ4MDxvKsCgpnXruPhjenPNW+mQKxm4SefpePW7zkx6k1ubpYVJUeag== + version "6.3.4" + resolved "https://registry.npmjs.org/@storybook/addon-links/-/addon-links-6.3.4.tgz#2ec5b7532e67303b7ec693ecc22a6c4feac93cb3" + integrity sha512-qIey6kNcrg43vsmMmEGXGMbO1Wjqc6hbcMaLstUn3xN29vZnjUcv7PVPFlJsBBYIxW7gXBtRmqjdxN5UD0bvZA== dependencies: - "@storybook/addons" "6.1.11" - "@storybook/client-logger" "6.1.11" - "@storybook/core-events" "6.1.11" + "@storybook/addons" "6.3.4" + "@storybook/client-logger" "6.3.4" + "@storybook/core-events" "6.3.4" "@storybook/csf" "0.0.1" - "@storybook/router" "6.1.11" - "@types/qs" "^6.9.0" - core-js "^3.0.1" - global "^4.3.2" + "@storybook/router" "6.3.4" + "@types/qs" "^6.9.5" + core-js "^3.8.2" + global "^4.4.0" prop-types "^15.7.2" - qs "^6.6.0" + qs "^6.10.0" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" @@ -4323,21 +4323,6 @@ react-syntax-highlighter "^13.5.3" regenerator-runtime "^0.13.7" -"@storybook/addons@6.1.11": - version "6.1.11" - resolved "https://registry.npmjs.org/@storybook/addons/-/addons-6.1.11.tgz#cb4578411ca00ccb206b484df5a171ccaca34719" - integrity sha512-OZXsdmn60dVe482l9zWxzOqqJApD2jggk/8QJKn3/Ub9posmqdqg712bW6v71BBe0UXXG/QfkZA7gcyiyEENbw== - dependencies: - "@storybook/api" "6.1.11" - "@storybook/channels" "6.1.11" - "@storybook/client-logger" "6.1.11" - "@storybook/core-events" "6.1.11" - "@storybook/router" "6.1.11" - "@storybook/theming" "6.1.11" - core-js "^3.0.1" - global "^4.3.2" - regenerator-runtime "^0.13.7" - "@storybook/addons@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/addons/-/addons-6.1.15.tgz#09eb8d962f58bd20b4ac2f83b515831c83226352" @@ -4368,7 +4353,7 @@ global "^4.4.0" regenerator-runtime "^0.13.7" -"@storybook/addons@6.3.0", "@storybook/addons@^6.1.11": +"@storybook/addons@6.3.0": version "6.3.0" resolved "https://registry.npmjs.org/@storybook/addons/-/addons-6.3.0.tgz#a86849f46a654d2d78b91fad0088264a32d4e58e" integrity sha512-/dcq20HtdSw5+cG8znR59Y/uv2zCR2VjRK3N52IkGWk162b/UbSjjL0PhNnnQFGpH9Fruft6mqvjTAKT41kmJw== @@ -4383,30 +4368,20 @@ global "^4.4.0" regenerator-runtime "^0.13.7" -"@storybook/api@6.1.11": - version "6.1.11" - resolved "https://registry.npmjs.org/@storybook/api/-/api-6.1.11.tgz#1e0b798203df823ac21184386258cf8b5f17f440" - integrity sha512-/p4QW/p3uWO0AKVveNezX3I/CotyBKaJ5ui8PuvSPsl7yvqcsK41qI4evKOw7GMQn6oP+2enRbzHpGuCUgQSjA== +"@storybook/addons@6.3.4", "@storybook/addons@^6.1.11": + version "6.3.4" + resolved "https://registry.npmjs.org/@storybook/addons/-/addons-6.3.4.tgz#016c5c3e36c78a320eb8b022cf7fe556d81577c2" + integrity sha512-rf8K8X3JrB43gq5nw5SYgfucQkFg2QgUMWdByf7dQ4MyIl5zet+2MYiSXJ9lfbhGKJZ8orc81rmMtiocW4oBjg== dependencies: - "@reach/router" "^1.3.3" - "@storybook/channels" "6.1.11" - "@storybook/client-logger" "6.1.11" - "@storybook/core-events" "6.1.11" - "@storybook/csf" "0.0.1" - "@storybook/router" "6.1.11" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.1.11" - "@types/reach__router" "^1.3.5" - core-js "^3.0.1" - fast-deep-equal "^3.1.1" - global "^4.3.2" - lodash "^4.17.15" - memoizerific "^1.11.3" + "@storybook/api" "6.3.4" + "@storybook/channels" "6.3.4" + "@storybook/client-logger" "6.3.4" + "@storybook/core-events" "6.3.4" + "@storybook/router" "6.3.4" + "@storybook/theming" "6.3.4" + core-js "^3.8.2" + global "^4.4.0" regenerator-runtime "^0.13.7" - store2 "^2.7.1" - telejson "^5.0.2" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" "@storybook/api@6.1.15": version "6.1.15" @@ -4485,6 +4460,32 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/api@6.3.4": + version "6.3.4" + resolved "https://registry.npmjs.org/@storybook/api/-/api-6.3.4.tgz#25b8b842104693000b018b3f64986e95fa032b45" + integrity sha512-12q6dvSR4AtyuZbKAy3Xt+ZHzZ4ePPRV1q20xtgYBoiFEgB9vbh4XKEeeZD0yIeTamQ2x1Hn87R79Rs1GIdKRQ== + dependencies: + "@reach/router" "^1.3.4" + "@storybook/channels" "6.3.4" + "@storybook/client-logger" "6.3.4" + "@storybook/core-events" "6.3.4" + "@storybook/csf" "0.0.1" + "@storybook/router" "6.3.4" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.3.4" + "@types/reach__router" "^1.3.7" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.20" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^5.3.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/channel-postmessage@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/channel-postmessage/-/channel-postmessage-6.1.15.tgz#80ea2346d18496f9710dd7f87fd2a9eca46ef36f" @@ -4511,15 +4512,6 @@ qs "^6.10.0" telejson "^5.3.2" -"@storybook/channels@6.1.11": - version "6.1.11" - resolved "https://registry.npmjs.org/@storybook/channels/-/channels-6.1.11.tgz#a93a83746ad78dd40e1c056029f6d93b17bb66bc" - integrity sha512-NvjWzQ95TSV1e18jaQBCOGoe+vptKH2NOKZ7QRQ7I0O5OoHKr47IXoh+MQ5C8CRD9FTdLE/xWdn1sVVEPRyHEw== - dependencies: - core-js "^3.0.1" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/channels@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/channels/-/channels-6.1.15.tgz#22bb06a671a5ae09d2537bcf63aaf90d7f6b9f6b" @@ -4547,6 +4539,15 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/channels@6.3.4": + version "6.3.4" + resolved "https://registry.npmjs.org/@storybook/channels/-/channels-6.3.4.tgz#425b31a67e42ac66ccb03465e4ba2e2ef9c8344b" + integrity sha512-zdZzBbIu9JHEe+uw8FqKsNUiFY+iqI9QdHH/pM3DTTQpBN/JM1Xwfo3CkqA8c5PkhSGqpW0YjXoPash4lawr1Q== + dependencies: + core-js "^3.8.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-api@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/client-api/-/client-api-6.1.15.tgz#8f8ead111459b94621571bdb2276f8a0aace17b1" @@ -4595,14 +4596,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/client-logger@6.1.11": - version "6.1.11" - resolved "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-6.1.11.tgz#5dd092e4293e5f58f7e89ddbc6eb2511b7d60954" - integrity sha512-dSc+VKLW1UaiMPMhlZYRqhynrrHdHFiBEgU28+8LcmoZ1yhZBwLkcKdSD4YTT0CbMJAG1/+NUW5kRI8Geeg+rA== - dependencies: - core-js "^3.0.1" - global "^4.3.2" - "@storybook/client-logger@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-6.1.15.tgz#b558d6ecbee82c038d684717d8c598eaa4a9324d" @@ -4627,6 +4620,14 @@ core-js "^3.8.2" global "^4.4.0" +"@storybook/client-logger@6.3.4": + version "6.3.4" + resolved "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-6.3.4.tgz#c7ee70463c48bb3af704165d5456351ebb667fc2" + integrity sha512-Gu4M5bBHHQznsdoj8uzYymeojwWq+CRNsUUH41BQIND/RJYSX1IYGIj0yNBP449nv2pjHcTGlN8NJDd+PcELCQ== + dependencies: + core-js "^3.8.2" + global "^4.4.0" + "@storybook/components@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/components/-/components-6.1.15.tgz#b4a2af23ee6b9cba4c255191eae3d3463e29bfb7" @@ -4713,13 +4714,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/core-events@6.1.11": - version "6.1.11" - resolved "https://registry.npmjs.org/@storybook/core-events/-/core-events-6.1.11.tgz#d50e8ec90490f9a7180a8c8a83afb6dcfe47ed66" - integrity sha512-hTib81W8PxepM7iXVvl3pBXSaGpChl5LTzaLCoIRO9sSB8dy0/x2DLAHzbQvShk/l1wqUc3TtOLIxq+eC9l3wg== - dependencies: - core-js "^3.0.1" - "@storybook/core-events@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/core-events/-/core-events-6.1.15.tgz#f66e30cbed8afdb8df2254d2aa47fe139e641c60" @@ -4741,6 +4735,13 @@ dependencies: core-js "^3.8.2" +"@storybook/core-events@6.3.4": + version "6.3.4" + resolved "https://registry.npmjs.org/@storybook/core-events/-/core-events-6.3.4.tgz#f841b8659a8729d334acd9a6dcfc470c88a2be8f" + integrity sha512-6qI5bU5VcAoRfxkvpdRqO16eYrX5M0P2E3TakqUUDcgDo5Rfcwd1wTTcwiXslMIh7oiVGiisA+msKTlfzyKf9Q== + dependencies: + core-js "^3.8.2" + "@storybook/core@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/core/-/core-6.1.15.tgz#7ff8c314d3857497bf2e26c69a1fa93ef37301aa" @@ -4893,18 +4894,6 @@ ts-dedent "^2.0.0" webpack "^4.44.2" -"@storybook/router@6.1.11": - version "6.1.11" - resolved "https://registry.npmjs.org/@storybook/router/-/router-6.1.11.tgz#d58e0c8324d8b16d71e09c017a4e3c844b1a4139" - integrity sha512-YEYOoKMo/WI13MZCkdqI9X3H1G0Oj5OUxi7So4qd3khX3zcCjSr3LjiMDBcmIVZpFo5VAvzjhIY4KqpgvzTG0A== - dependencies: - "@reach/router" "^1.3.3" - "@types/reach__router" "^1.3.5" - core-js "^3.0.1" - global "^4.3.2" - memoizerific "^1.11.3" - qs "^6.6.0" - "@storybook/router@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/router/-/router-6.1.15.tgz#e0cd7440a2ddc9b265e506b1cb590d3eeab56476" @@ -4949,6 +4938,22 @@ qs "^6.10.0" ts-dedent "^2.0.0" +"@storybook/router@6.3.4": + version "6.3.4" + resolved "https://registry.npmjs.org/@storybook/router/-/router-6.3.4.tgz#f38ec8064a9d1811a68558390727c30220fe7d72" + integrity sha512-cNG2bT0BBfqJyaW6xKUnEB/XXSdMkYeI9ShwJ2gh/2Bnidm7eZ/RKUOZ4q5equMm+SxxyZgpBulqnFN+TqPbOA== + dependencies: + "@reach/router" "^1.3.4" + "@storybook/client-logger" "6.3.4" + "@types/reach__router" "^1.3.7" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.20" + memoizerific "^1.11.3" + qs "^6.10.0" + ts-dedent "^2.0.0" + "@storybook/semver@^7.3.2": version "7.3.2" resolved "https://registry.npmjs.org/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" @@ -4973,24 +4978,6 @@ prettier "~2.2.1" regenerator-runtime "^0.13.7" -"@storybook/theming@6.1.11": - version "6.1.11" - resolved "https://registry.npmjs.org/@storybook/theming/-/theming-6.1.11.tgz#0e757e0562aedefc96bd1d12714d4c8e92823467" - integrity sha512-zRChacVgKoU2BmpvwK1ntiF3KIpc8QblJT7IGiKfP/BNpy9gNeXbLPLk3g/tkHszOvVYtkaZhEXni4Od8tqy1A== - dependencies: - "@emotion/core" "^10.1.1" - "@emotion/is-prop-valid" "^0.8.6" - "@emotion/styled" "^10.0.23" - "@storybook/client-logger" "6.1.11" - core-js "^3.0.1" - deep-object-diff "^1.1.0" - emotion-theming "^10.0.19" - global "^4.3.2" - memoizerific "^1.11.3" - polished "^3.4.4" - resolve-from "^5.0.0" - ts-dedent "^2.0.0" - "@storybook/theming@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/theming/-/theming-6.1.15.tgz#01083ab89904dd959429b0b3fd1c76bd0ecc59ef" @@ -5045,6 +5032,24 @@ resolve-from "^5.0.0" ts-dedent "^2.0.0" +"@storybook/theming@6.3.4": + version "6.3.4" + resolved "https://registry.npmjs.org/@storybook/theming/-/theming-6.3.4.tgz#69d3f912c74a7b6ba78c1c95fac3315356468bdd" + integrity sha512-L0lJcwUi7mse+U7EBAv5NVt81mH1MtUzk9paik8hMAc68vDtR/X0Cq4+zPsgykCROOTtEGrQ/JUUrpcEqeprTQ== + dependencies: + "@emotion/core" "^10.1.1" + "@emotion/is-prop-valid" "^0.8.6" + "@emotion/styled" "^10.0.27" + "@storybook/client-logger" "6.3.4" + core-js "^3.8.2" + deep-object-diff "^1.1.0" + emotion-theming "^10.0.27" + global "^4.4.0" + memoizerific "^1.11.3" + polished "^4.0.5" + resolve-from "^5.0.0" + ts-dedent "^2.0.0" + "@storybook/ui@6.1.15": version "6.1.15" resolved "https://registry.npmjs.org/@storybook/ui/-/ui-6.1.15.tgz#a0f6c49fcf81cf172cd2de4c8dba2be1296891f6" @@ -6224,7 +6229,7 @@ resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== -"@types/reach__router@^1.3.5", "@types/reach__router@^1.3.7": +"@types/reach__router@^1.3.7": version "1.3.7" resolved "https://registry.npmjs.org/@types/reach__router/-/reach__router-1.3.7.tgz#de8ab374259ae7f7499fc1373b9697a5f3cd6428" integrity sha512-cyBEb8Ef3SJNH5NYEIDGPoMMmYUxROatuxbICusVRQIqZUB85UCt6R2Ok60tKS/TABJsJYaHyNTW3kqbpxlMjg== From c642324708b3e71e175adf2a6bea7d7f052749e3 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 19 Jul 2021 11:06:28 +0200 Subject: [PATCH 073/101] Legacy option for overflow wrap & update changeset bump Signed-off-by: Philipp Hugenroth --- .changeset/poor-jars-sniff.md | 1 - packages/app/src/components/catalog/EntityPage.tsx | 2 +- .../packages/app/src/components/catalog/EntityPage.tsx | 2 +- plugins/techdocs/src/reader/components/Reader.tsx | 3 +++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.changeset/poor-jars-sniff.md b/.changeset/poor-jars-sniff.md index c45cd174a0..4c0c5d8133 100644 --- a/.changeset/poor-jars-sniff.md +++ b/.changeset/poor-jars-sniff.md @@ -1,5 +1,4 @@ --- -'example-app': patch '@backstage/core-components': patch '@backstage/create-app': patch '@backstage/plugin-api-docs': patch diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index 7965561516..137b359afd 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -137,7 +137,7 @@ const EntityLayoutWrapper = (props: { children?: ReactNode }) => { /** * TODO: For the MUI Grid to work there have to be "xs" set on every GridItem, - * such that the seperation of space is clear from the smalles screen size upwards + * such that the seperation of space is clear from the smallest screen size upwards * https://material-ui.com/components/grid/#basic-grid. */ 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 f7eb7c6349..7ebbe53aa0 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 @@ -159,7 +159,7 @@ const websiteEntityPage = ( /** * TODO: For the MUI Grid to work there have to be "xs" set on every GridItem, - * such that the seperation of space is clear from the smalles screen size upwards + * such that the seperation of space is clear from the smallest screen size upwards * https://material-ui.com/components/grid/#basic-grid. */ diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index 9dd8a2d656..3cecf4babe 100644 --- a/plugins/techdocs/src/reader/components/Reader.tsx +++ b/plugins/techdocs/src/reader/components/Reader.tsx @@ -52,6 +52,9 @@ type Props = { const useStyles = makeStyles(() => ({ message: { + // `word-break: break-word` is deprecated, but gives legacy support to browsers not supporting `overflow-wrap` yet + // https://developer.mozilla.org/en-US/docs/Web/CSS/word-break + wordBreak: 'break-word', overflowWrap: 'anywhere', }, })); From f39ee49343286c9221bb2819e385b914208da130 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 19 Jul 2021 12:23:05 +0200 Subject: [PATCH 074/101] Adjust props to fit general conventions Signed-off-by: Philipp Hugenroth --- packages/core-components/api-report.md | 4 ++-- packages/core-components/src/layout/Page/PageWithHeader.tsx | 4 ++-- plugins/catalog/api-report.md | 2 +- .../src/components/FilteredEntityLayout/FilterContainer.tsx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index 7f381deb4b..ccafa4cfa7 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -1202,7 +1202,7 @@ export const Page: ({ children, }: PropsWithChildren) => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "ThemedHeaderProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "PageWithHeaderProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "PageWithHeader" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -1210,7 +1210,7 @@ export const PageWithHeader: ({ themeId, children, ...props -}: PropsWithChildren) => JSX.Element; +}: PropsWithChildren) => JSX.Element; // Warning: (ae-missing-release-tag) "Progress" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/packages/core-components/src/layout/Page/PageWithHeader.tsx b/packages/core-components/src/layout/Page/PageWithHeader.tsx index 6095b4df16..70a6c1f693 100644 --- a/packages/core-components/src/layout/Page/PageWithHeader.tsx +++ b/packages/core-components/src/layout/Page/PageWithHeader.tsx @@ -19,7 +19,7 @@ import React, { PropsWithChildren, ComponentProps } from 'react'; import { Header } from '../Header'; import { Page } from './Page'; -export type ThemedHeaderProps = ComponentProps & { +type PageWithHeaderProps = ComponentProps & { themeId: string; }; @@ -27,7 +27,7 @@ export const PageWithHeader = ({ themeId, children, ...props -}: PropsWithChildren) => ( +}: PropsWithChildren) => (
{children} diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 4ed69230ec..5a4ddefaca 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -288,7 +288,7 @@ export const EntitySystemDiagramCard: SystemDiagramCard; // @public (undocumented) export const FilterContainer: ({ children, -}: React_2.PropsWithChildren<{}>) => JSX.Element; +}: PropsWithChildren<{}>) => JSX.Element; // Warning: (ae-missing-release-tag) "FilteredEntityLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx index 693d2f23b3..d38e800f46 100644 --- a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx +++ b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx @@ -25,9 +25,9 @@ import { useTheme, } from '@material-ui/core'; import FilterListIcon from '@material-ui/icons/FilterList'; -import React, { useState } from 'react'; +import React, { useState, PropsWithChildren } from 'react'; -export const FilterContainer = ({ children }: React.PropsWithChildren<{}>) => { +export const FilterContainer = ({ children }: PropsWithChildren<{}>) => { const isMidSizeScreen = useMediaQuery(theme => theme.breakpoints.down('md'), ); From 525a8c696acb25b6b7c8c8a3f7b9d12bc7c218da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 04:10:29 +0000 Subject: [PATCH 075/101] chore(deps-dev): bump @spotify/prettier-config in /microsite Bumps [@spotify/prettier-config](https://github.com/spotify/web-scripts) from 10.0.0 to 11.0.0. - [Release notes](https://github.com/spotify/web-scripts/releases) - [Changelog](https://github.com/spotify/web-scripts/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotify/web-scripts/compare/v10.0.0...v11.0.0) --- updated-dependencies: - dependency-name: "@spotify/prettier-config" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- microsite/package.json | 2 +- microsite/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/microsite/package.json b/microsite/package.json index eee549fb70..532bb62d15 100644 --- a/microsite/package.json +++ b/microsite/package.json @@ -16,7 +16,7 @@ "lock:check": "yarn-lock-check" }, "devDependencies": { - "@spotify/prettier-config": "^10.0.0", + "@spotify/prettier-config": "^11.0.0", "docusaurus": "^2.0.0-alpha.70", "js-yaml": "^4.1.0", "prettier": "^2.3.2", diff --git a/microsite/yarn.lock b/microsite/yarn.lock index 1da9288808..fd492787ee 100644 --- a/microsite/yarn.lock +++ b/microsite/yarn.lock @@ -909,10 +909,10 @@ resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" integrity sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow== -"@spotify/prettier-config@^10.0.0": - version "10.0.0" - resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-10.0.0.tgz#fa076d98d2e7e6c53dd3d86a696307a7010bd056" - integrity sha512-VYOdo8P7lIScAkl02nB9KpUAuOYMManryBIBuKJkAw5D3aVtLobfmdIKvdV6MqEmGMEQPbn7w/UpnjJYhUH+IA== +"@spotify/prettier-config@^11.0.0": + version "11.0.0" + resolved "https://registry.yarnpkg.com/@spotify/prettier-config/-/prettier-config-11.0.0.tgz#d91e0546a8c1c0f7299e2edc7e44306e9be210f6" + integrity sha512-dOI13j1uHMZkRxhZuge/ugOE7Aqcg7Nxki932lDZuXyY4G8CGxkc/66PeQ8pR4PCzThHORXo7Ptvau6bh101lQ== "@types/cheerio@^0.22.8": version "0.22.23" From c87bed34bc3b3500007853367fb0ae06c9cc23d7 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 19 Jul 2021 15:48:42 +0200 Subject: [PATCH 076/101] chore: fix yarn.lock for microsite Signed-off-by: blam --- microsite/yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsite/yarn.lock b/microsite/yarn.lock index fd492787ee..0f7ddb9c60 100644 --- a/microsite/yarn.lock +++ b/microsite/yarn.lock @@ -911,7 +911,7 @@ "@spotify/prettier-config@^11.0.0": version "11.0.0" - resolved "https://registry.yarnpkg.com/@spotify/prettier-config/-/prettier-config-11.0.0.tgz#d91e0546a8c1c0f7299e2edc7e44306e9be210f6" + resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-11.0.0.tgz#d91e0546a8c1c0f7299e2edc7e44306e9be210f6" integrity sha512-dOI13j1uHMZkRxhZuge/ugOE7Aqcg7Nxki932lDZuXyY4G8CGxkc/66PeQ8pR4PCzThHORXo7Ptvau6bh101lQ== "@types/cheerio@^0.22.8": From eee05803ae9aee3c093d6ab3d39cb6953b8d3609 Mon Sep 17 00:00:00 2001 From: Dominik Henneke Date: Mon, 19 Jul 2021 17:47:03 +0200 Subject: [PATCH 077/101] Update @backstage/backend-common to `^0.8.6` Signed-off-by: Dominik Henneke --- .changeset/fifty-panthers-play.md | 5 +++++ plugins/jenkins-backend/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/fifty-panthers-play.md diff --git a/.changeset/fifty-panthers-play.md b/.changeset/fifty-panthers-play.md new file mode 100644 index 0000000000..1ea00ef223 --- /dev/null +++ b/.changeset/fifty-panthers-play.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-jenkins-backend': patch +--- + +Update `@backstage/backend-common` to `^0.8.6` diff --git a/plugins/jenkins-backend/package.json b/plugins/jenkins-backend/package.json index 408d714aaa..11c6c3cc0a 100644 --- a/plugins/jenkins-backend/package.json +++ b/plugins/jenkins-backend/package.json @@ -21,7 +21,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.8.5s", + "@backstage/backend-common": "^0.8.6", "@backstage/catalog-client": "^0.3.16", "@backstage/catalog-model": "^0.9.0", "@backstage/config": "^0.1.5", From 249cbfc893d7f96cd948d39e7e5e33158ecaef83 Mon Sep 17 00:00:00 2001 From: Tim Hansen Date: Mon, 19 Jul 2021 12:18:29 -0600 Subject: [PATCH 078/101] Minor tweaks, button fixes Signed-off-by: Tim Hansen --- .changeset/green-lies-hammer.md | 4 +- .../software-catalog/catalog-customization.md | 40 +++++++++++-------- .../SupportButton/SupportButton.tsx | 26 ++++++------ .../layout/ContentHeader/ContentHeader.tsx | 6 +-- plugins/catalog/api-report.md | 5 +++ .../components/CatalogPage/CatalogPage.tsx | 2 +- .../FilteredEntityLayout/FilterContainer.tsx | 18 +++------ plugins/catalog/src/index.ts | 11 ++--- 8 files changed, 59 insertions(+), 53 deletions(-) diff --git a/.changeset/green-lies-hammer.md b/.changeset/green-lies-hammer.md index fc7f6e301d..af1c2e6e92 100644 --- a/.changeset/green-lies-hammer.md +++ b/.changeset/green-lies-hammer.md @@ -5,6 +5,4 @@ '@backstage/plugin-catalog': patch --- -Changing the layout of the Catalog & API page to use responsive wrappers for table & filters. The goal is to enforce a responsive layout & that the Catalog & API page are better useable on smaller screens by showing more of the main content. To apply this changes to your custom catalog page, you can add the wrappers following the updated documentation on catalog customization. - -Additionally, the tests for Material UI breakpoints were adjusted & used to test the responsive wrappers. +Updated the layout of catalog and API index pages to handle smaller screen sizes. This adds responsive wrappers to the entity tables, and switches filters to a drawer when width-constrained. If you have created a custom catalog or API index page, you will need to update the page structure to match the updated [catalog customization](https://backstage.io/docs/features/software-catalog/catalog-customization) documentation. diff --git a/docs/features/software-catalog/catalog-customization.md b/docs/features/software-catalog/catalog-customization.md index 4049b005f1..0c11d8f476 100644 --- a/docs/features/software-catalog/catalog-customization.md +++ b/docs/features/software-catalog/catalog-customization.md @@ -27,7 +27,11 @@ default catalog page and create a component in a ```tsx // imports, etc omitted for brevity. for full source see: // https://github.com/backstage/backstage/blob/master/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx -export const CustomCatalogPage = () => { +export const CustomCatalogPage = ({ + columns, + actions, + initiallySelectedFilter = 'owned', +}: CatalogPageProps) => { return ( @@ -139,23 +143,27 @@ export const EntitySecurityTierPicker = () => { Now we can add the component to `CustomCatalogPage`: ```diff -export const CustomCatalogPage = () => { +export const CustomCatalogPage = ({ + columns, + actions, + initiallySelectedFilter = 'owned', +}: CatalogPageProps) => { return ( ... - - - - - + + + + + ... }; ``` diff --git a/packages/core-components/src/components/SupportButton/SupportButton.tsx b/packages/core-components/src/components/SupportButton/SupportButton.tsx index 45012e50a4..3e719acb95 100644 --- a/packages/core-components/src/components/SupportButton/SupportButton.tsx +++ b/packages/core-components/src/components/SupportButton/SupportButton.tsx @@ -28,7 +28,7 @@ import { makeStyles, Popover, } from '@material-ui/core'; -import React, { Fragment, MouseEventHandler, useState } from 'react'; +import React, { MouseEventHandler, useState } from 'react'; import { SupportItem, SupportItemLink, useSupportConfig } from '../../hooks'; import { Link } from '../Link'; @@ -94,17 +94,17 @@ export const SupportButton = ({ title, children }: SupportButtonProps) => { }; return ( - - + <> + + + { - + ); }; diff --git a/packages/core-components/src/layout/ContentHeader/ContentHeader.tsx b/packages/core-components/src/layout/ContentHeader/ContentHeader.tsx index 0bd377e5af..62cb80cffa 100644 --- a/packages/core-components/src/layout/ContentHeader/ContentHeader.tsx +++ b/packages/core-components/src/layout/ContentHeader/ContentHeader.tsx @@ -18,7 +18,7 @@ * TODO favoriteable capability */ -import React, { ComponentType, Fragment, PropsWithChildren } from 'react'; +import React, { ComponentType, PropsWithChildren } from 'react'; import { Typography, makeStyles } from '@material-ui/core'; import { Helmet } from 'react-helmet'; @@ -98,7 +98,7 @@ export const ContentHeader = ({ ); return ( - + <>
@@ -111,6 +111,6 @@ export const ContentHeader = ({
{children}
-
+ ); }; diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 5a4ddefaca..1b6e2cd4d0 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -104,6 +104,11 @@ export type CatalogTableRow = { }; }; +// Warning: (ae-missing-release-tag) "CreateComponentButton" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const CreateComponentButton: () => JSX.Element | null; + // Warning: (ae-missing-release-tag) "createMetadataDescriptionColumn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 0fe3504c6d..963e04e5e2 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -36,7 +36,7 @@ import { import React from 'react'; import { CatalogTable } from '../CatalogTable'; import { EntityRow } from '../CatalogTable/types'; -import { CreateComponentButton } from '../CreateComponentButton/CreateComponentButton'; +import { CreateComponentButton } from '../CreateComponentButton'; import { FilteredEntityLayout, EntityListContainer, diff --git a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx index d38e800f46..f21f9c77a3 100644 --- a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx +++ b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx @@ -32,27 +32,21 @@ export const FilterContainer = ({ children }: PropsWithChildren<{}>) => { theme.breakpoints.down('md'), ); const theme = useTheme(); - const [showFiltersDrawer, toggleFiltersDrawer] = useState(false); + const [filterDrawerOpen, setFilterDrawerOpen] = useState(false); return isMidSizeScreen ? ( <> { - toggleFiltersDrawer(false); - }} - elevation={0} + open={filterDrawerOpen} + onClose={() => setFilterDrawerOpen(false)} anchor="left" disableAutoFocus keepMounted diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index 4b348580f7..2ac7f10227 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -15,13 +15,16 @@ */ export * from './components/AboutCard'; -export { CatalogResultListItem } from './components/CatalogResultListItem'; +export * from './components/CatalogResultListItem'; export { CatalogTable } from './components/CatalogTable'; export type { EntityRow as CatalogTableRow } from './components/CatalogTable'; -export { EntityLayout } from './components/EntityLayout'; +export * from './components/CatalogTable/columns'; +export * from './components/CreateComponentButton'; +export * from './components/EntityLayout'; export * from './components/EntityOrphanWarning'; -export { EntityPageLayout } from './components/EntityPageLayout'; +export * from './components/EntityPageLayout'; export * from './components/EntitySwitch'; +export * from './components/FilteredEntityLayout'; export { Router } from './components/Router'; export { CatalogEntityPage, @@ -39,5 +42,3 @@ export { EntityLinksCard, EntitySystemDiagramCard, } from './plugin'; -export * from './components/CatalogTable/columns'; -export * from './components/FilteredEntityLayout'; From 8d6408d05cbc26862fa82fcb524f252acee724ee Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Mon, 19 Jul 2021 21:57:18 +0200 Subject: [PATCH 079/101] Adjust tests to use only text & test drawer visibility Signed-off-by: Philipp Hugenroth --- .../src/components/CatalogPage/CatalogPage.test.tsx | 12 ++++++++---- .../FilteredEntityLayout/FilterContainer.tsx | 3 +-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index 598f534d14..b462cfb6b6 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -248,13 +248,17 @@ describe('CatalogPage', () => { it('should wrap filter in drawer on smaller screens', async () => { mockBreakpoint({ matches: true }); - const { getByTestId } = await renderWrapped(); - expect(getByTestId('entity-filters-drawer')).toBeInTheDocument(); + const { getAllByText } = await renderWrapped(); + const elems = getAllByText('Filters'); + expect(elems[0]).toBeVisible(); + expect(elems[1]).not.toBeVisible(); + fireEvent.click(elems[0]); + expect(elems[1]).toBeVisible(); }); it('should wrap filter in grid on larger screens', async () => { mockBreakpoint({ matches: false }); - const { getByTestId } = await renderWrapped(); - expect(getByTestId('entity-filters-grid')).toBeInTheDocument(); + const { queryAllByText } = await renderWrapped(); + expect(queryAllByText('Filters').length).toBe(0); }); }); diff --git a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx index f21f9c77a3..683dbf8b40 100644 --- a/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx +++ b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx @@ -44,7 +44,6 @@ export const FilterContainer = ({ children }: PropsWithChildren<{}>) => { Filters setFilterDrawerOpen(false)} anchor="left" @@ -65,7 +64,7 @@ export const FilterContainer = ({ children }: PropsWithChildren<{}>) => { ) : ( - + {children} ); From cedb602a42c1dba62dbebba3384de953c3b37ff6 Mon Sep 17 00:00:00 2001 From: Fidel Coria Date: Mon, 19 Jul 2021 16:29:30 -0500 Subject: [PATCH 080/101] custom theme on devApp for single plugin Signed-off-by: Fidel Coria --- packages/dev-utils/src/devApp/render.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/dev-utils/src/devApp/render.tsx b/packages/dev-utils/src/devApp/render.tsx index 508eb105f1..e6338cd467 100644 --- a/packages/dev-utils/src/devApp/render.tsx +++ b/packages/dev-utils/src/devApp/render.tsx @@ -37,6 +37,7 @@ import { import { AnyApiFactory, ApiFactory, + AppTheme, attachComponentData, configApiRef, createApiFactory, @@ -79,6 +80,7 @@ class DevAppBuilder { private readonly sidebarItems = new Array(); private defaultPage?: string; + private themes?: Array; /** * Register one or more plugins to render in the dev app @@ -144,6 +146,14 @@ class DevAppBuilder { return this; } + /** + * Adds an array of themes to overide the default theme. + */ + addThemes(themes: AppTheme[]) { + this.themes = themes; + return this; + } + /** * Build a DevApp component using the resources registered so far */ @@ -166,6 +176,7 @@ class DevAppBuilder { const app = createApp({ apis, plugins: this.plugins, + themes: this.themes, bindRoutes: ({ bind }) => { for (const plugin of this.plugins ?? []) { const targets: Record> = {}; From 01001a32425db56c39239f94dcf2fee55bddf203 Mon Sep 17 00:00:00 2001 From: Fidel Coria Date: Mon, 19 Jul 2021 17:39:07 -0500 Subject: [PATCH 081/101] add changeset Signed-off-by: Fidel Coria --- .changeset/wild-fishes-suffer.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wild-fishes-suffer.md diff --git a/.changeset/wild-fishes-suffer.md b/.changeset/wild-fishes-suffer.md new file mode 100644 index 0000000000..5b914860b2 --- /dev/null +++ b/.changeset/wild-fishes-suffer.md @@ -0,0 +1,5 @@ +--- +'@backstage/dev-utils': patch +--- + +Allow custom theme for dev app. From b0750ca4fb04256cc8b68fd06f48c7b6420161b1 Mon Sep 17 00:00:00 2001 From: Fidel Coria Date: Mon, 19 Jul 2021 18:01:22 -0500 Subject: [PATCH 082/101] add api-report.md for dev-utils Signed-off-by: Fidel Coria --- packages/dev-utils/api-report.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/dev-utils/api-report.md b/packages/dev-utils/api-report.md index 6790992ecf..5f58b297d5 100644 --- a/packages/dev-utils/api-report.md +++ b/packages/dev-utils/api-report.md @@ -6,6 +6,7 @@ /// import { ApiFactory } from '@backstage/core-plugin-api'; +import { AppTheme } from '@backstage/core-plugin-api'; import { ComponentType } from 'react'; import { createPlugin } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; From 2f732b832036e0dc7a34c88fe965edc35e9246d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jul 2021 04:09:52 +0000 Subject: [PATCH 083/101] chore(deps): bump webpack from 4.44.2 to 4.46.0 Bumps [webpack](https://github.com/webpack/webpack) from 4.44.2 to 4.46.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v4.44.2...v4.46.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8cd71b039e..1a88200c58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11727,10 +11727,10 @@ endent@^2.0.1: fast-json-parse "^1.0.3" objectorarray "^1.0.4" -enhanced-resolve@^4.0.0, enhanced-resolve@^4.3.0: - version "4.3.0" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz#3b806f3bfafc1ec7de69551ef93cca46c1704126" - integrity sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ== +enhanced-resolve@^4.0.0, enhanced-resolve@^4.5.0: + version "4.5.0" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz#2f3cfd84dbe3b487f18f2db2ef1e064a571ca5ec" + integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg== dependencies: graceful-fs "^4.1.2" memory-fs "^0.5.0" @@ -25978,9 +25978,9 @@ webpack-virtual-modules@^0.2.2: debug "^3.0.0" webpack@^4.41.6, webpack@^4.44.2: - version "4.44.2" - resolved "https://registry.npmjs.org/webpack/-/webpack-4.44.2.tgz#6bfe2b0af055c8b2d1e90ed2cd9363f841266b72" - integrity sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q== + version "4.46.0" + resolved "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz#bf9b4404ea20a073605e0a011d188d77cb6ad542" + integrity sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q== dependencies: "@webassemblyjs/ast" "1.9.0" "@webassemblyjs/helper-module-context" "1.9.0" @@ -25990,7 +25990,7 @@ webpack@^4.41.6, webpack@^4.44.2: ajv "^6.10.2" ajv-keywords "^3.4.1" chrome-trace-event "^1.0.2" - enhanced-resolve "^4.3.0" + enhanced-resolve "^4.5.0" eslint-scope "^4.0.3" json-parse-better-errors "^1.0.2" loader-runner "^2.4.0" From b16daa790791663ed40044364be3a3dc301eb108 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jul 2021 04:17:06 +0000 Subject: [PATCH 084/101] chore(deps): bump isomorphic-git from 1.8.0 to 1.9.2 Bumps [isomorphic-git](https://github.com/isomorphic-git/isomorphic-git) from 1.8.0 to 1.9.2. - [Release notes](https://github.com/isomorphic-git/isomorphic-git/releases) - [Changelog](https://github.com/isomorphic-git/isomorphic-git/blob/main/docs/in-the-news.md) - [Commits](https://github.com/isomorphic-git/isomorphic-git/compare/v1.8.0...v1.9.2) --- updated-dependencies: - dependency-name: isomorphic-git dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8cd71b039e..922a24a97b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15689,9 +15689,9 @@ isomorphic-form-data@~2.0.0: form-data "^2.3.2" isomorphic-git@^1.8.0: - version "1.8.0" - resolved "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.8.0.tgz#50440650a64706a321cbea1af955c1cf1110b238" - integrity sha512-TWJvQh+++eFrEG0IFS/jLhMwsBoCOX1/Dsw9q8no59Mp1K0jEjSHXFWv2P04PwkxcIpePkXVBI5YFcFT2nkuQg== + version "1.9.2" + resolved "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.9.2.tgz#0e492dbcd9873070b2a57eef257a45b90020ed72" + integrity sha512-puCXcGgtkDXdMYLZlAEGbpkbmHn/Q4Lsl2uMFwMLOKmmr8Qe7Fe3+c6k2+aHW3rMdJYg9xTv95BJ+PRzR8Ydww== dependencies: async-lock "^1.1.0" clean-git-ref "^2.0.1" From 93be473b54baadffe523895ba7d03a1385980bdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jul 2021 04:20:27 +0000 Subject: [PATCH 085/101] chore(deps): bump @azure/msal-node from 1.1.0 to 1.2.0 Bumps [@azure/msal-node](https://github.com/AzureAD/microsoft-authentication-library-for-js) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/AzureAD/microsoft-authentication-library-for-js/releases) - [Commits](https://github.com/AzureAD/microsoft-authentication-library-for-js/compare/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: "@azure/msal-node" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8cd71b039e..2b87b35f06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -211,10 +211,10 @@ dependencies: debug "^4.1.1" -"@azure/msal-common@^4.3.0": - version "4.3.0" - resolved "https://registry.npmjs.org/@azure/msal-common/-/msal-common-4.3.0.tgz#b540e92748656724088bf77192e59943a93135bc" - integrity sha512-jFqUWe83wVb6O8cNGGBFg2QlKvqM1ezUgJTEV7kIsAPX0RXhGFE4B1DLNt6hCnkTXDbw+KGW0zgxOEr4MJQwLw== +"@azure/msal-common@^4.4.0": + version "4.4.0" + resolved "https://registry.npmjs.org/@azure/msal-common/-/msal-common-4.4.0.tgz#818526042f78838ebc332fb735e7de64d8bccb45" + integrity sha512-Qrs33Ctt2KM7NxArFPIUKc8UbIcm7zYxJFdJeQ9k7HKBhVk3e88CUz1Mw33cS/Jr+YA1H02OAzHg++bJ+4SFyQ== dependencies: debug "^4.1.1" @@ -229,11 +229,11 @@ uuid "^8.3.0" "@azure/msal-node@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.1.0.tgz#e472cfadead169f8832066ae6c2d6b8eef4e89e4" - integrity sha512-gMO9aZdWOzufp1PcdD5ID25DdS9eInxgeCqx4Tk8PVU6Z7RxJQhoMzS64cJhGdpYgeIQwKljtF0CLCcPFxew/w== + version "1.2.0" + resolved "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.2.0.tgz#d08a5fb3391436715cb37c6eb44816013bdfa11e" + integrity sha512-79o5n483vslc7Qegh9+0BsxODRmlk6YYjVdl9jvwmAuF+i+oylq57e7RVhTVocKCbLCIMOKARI14JyKdDbW0WA== dependencies: - "@azure/msal-common" "^4.3.0" + "@azure/msal-common" "^4.4.0" axios "^0.21.1" jsonwebtoken "^8.5.1" uuid "^8.3.0" From bdd6ab5f192ee4b56352783cff94042284284334 Mon Sep 17 00:00:00 2001 From: Carlo Colombo Date: Mon, 19 Jul 2021 15:16:09 +0200 Subject: [PATCH 086/101] Adds configuration for request logging handler when creating the backend express app Signed-off-by: Carlo Colombo --- .changeset/fuzzy-pots-whisper.md | 15 +++++++++++++++ packages/backend-common/api-report.md | 11 +++++++++++ packages/backend-common/src/service/index.ts | 2 +- .../src/service/lib/ServiceBuilderImpl.ts | 16 +++++++++++++--- packages/backend-common/src/service/types.ts | 13 +++++++++++++ 5 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 .changeset/fuzzy-pots-whisper.md diff --git a/.changeset/fuzzy-pots-whisper.md b/.changeset/fuzzy-pots-whisper.md new file mode 100644 index 0000000000..772ba1fb43 --- /dev/null +++ b/.changeset/fuzzy-pots-whisper.md @@ -0,0 +1,15 @@ +--- +'@backstage/backend-common': patch +--- + +It's possible to customize the request logging handler when building the service. For example in your `backend` + +``` + const service = createServiceBuilder(module) + .loadConfig(config) + .setRequestLoggingHandler((logger?: Logger): RequestHandler => { + const actualLogger = (logger || getRootLogger()).child({ + type: 'incomingRequest', + }); + return expressWinston.logger({ ... +``` diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 571a26e5dc..2652dad122 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -439,6 +439,13 @@ export type ReadTreeResponseFile = { // @public export function requestLoggingHandler(logger?: Logger_2): RequestHandler; +// Warning: (ae-missing-release-tag) "RequestLoggingHandlerFactory" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type RequestLoggingHandlerFactory = ( + logger?: Logger_2, +) => RequestHandler; + // Warning: (ae-missing-release-tag) "resolvePackagePath" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public @@ -492,6 +499,9 @@ export type ServiceBuilder = { enableCors(options: cors.CorsOptions): ServiceBuilder; setHttpsSettings(settings: HttpsSettings): ServiceBuilder; addRouter(root: string, router: Router | RequestHandler): ServiceBuilder; + setRequestLoggingHandler( + requestLoggingHandler: RequestLoggingHandlerFactory, + ): ServiceBuilder; start(): Promise; }; @@ -593,6 +603,7 @@ export function useHotMemoize(_module: NodeModule, valueFactory: () => T): T; // src/service/types.d.ts:57:5 - (ae-forgotten-export) The symbol "HttpsSettings" needs to be exported by the entry point index.d.ts // src/service/types.d.ts:61:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/service/types.d.ts:62:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/service/types.d.ts:70:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-common/src/service/index.ts b/packages/backend-common/src/service/index.ts index 4eb0bf4a5a..d01f25fad3 100644 --- a/packages/backend-common/src/service/index.ts +++ b/packages/backend-common/src/service/index.ts @@ -16,4 +16,4 @@ export { createServiceBuilder } from './createServiceBuilder'; export { createStatusCheckRouter } from './createStatusCheckRouter'; -export type { ServiceBuilder } from './types'; +export type { ServiceBuilder, RequestLoggingHandlerFactory } from './types'; diff --git a/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts b/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts index 380d61abc8..7a3ebfed70 100644 --- a/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts +++ b/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts @@ -27,9 +27,9 @@ import { getRootLogger } from '../../logging'; import { errorHandler, notFoundHandler, - requestLoggingHandler, + requestLoggingHandler as defaultRequestLoggingHandler, } from '../../middleware'; -import { ServiceBuilder } from '../types'; +import { RequestLoggingHandlerFactory, ServiceBuilder } from '../types'; import { CspOptions, HttpsSettings, @@ -65,6 +65,7 @@ export class ServiceBuilderImpl implements ServiceBuilder { private cspOptions: Record | undefined; private httpsSettings: HttpsSettings | undefined; private routers: [string, Router][]; + private requestLoggingHandler: RequestLoggingHandlerFactory | undefined; // Reference to the module where builder is created - needed for hot module // reloading private module: NodeModule; @@ -144,6 +145,13 @@ export class ServiceBuilderImpl implements ServiceBuilder { return this; } + setRequestLoggingHandler( + requestLoggingHandler: RequestLoggingHandlerFactory, + ) { + this.requestLoggingHandler = requestLoggingHandler; + return this; + } + async start(): Promise { const app = express(); const { @@ -160,7 +168,9 @@ export class ServiceBuilderImpl implements ServiceBuilder { app.use(cors(corsOptions)); } app.use(compression()); - app.use(requestLoggingHandler(logger)); + app.use( + (this.requestLoggingHandler ?? defaultRequestLoggingHandler)(logger), + ); for (const [root, route] of this.routers) { app.use(root, route); } diff --git a/packages/backend-common/src/service/types.ts b/packages/backend-common/src/service/types.ts index 70f62acfca..f845397ca2 100644 --- a/packages/backend-common/src/service/types.ts +++ b/packages/backend-common/src/service/types.ts @@ -85,8 +85,21 @@ export type ServiceBuilder = { */ addRouter(root: string, router: Router | RequestHandler): ServiceBuilder; + /** + * Set the request logging handler + * + * If no handler is given the default one is used + * + * @param requestLoggingHandler a factory function that given a logger returns an handler + */ + setRequestLoggingHandler( + requestLoggingHandler: RequestLoggingHandlerFactory, + ): ServiceBuilder; + /** * Starts the server using the given settings. */ start(): Promise; }; + +export type RequestLoggingHandlerFactory = (logger?: Logger) => RequestHandler; From f5067d16609e7690d6fe9e5abb957d8048f47232 Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Tue, 20 Jul 2021 11:02:28 +0200 Subject: [PATCH 087/101] Adjust test to be more specific Signed-off-by: Philipp Hugenroth --- .../components/CatalogPage/CatalogPage.test.tsx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index b462cfb6b6..e09aec55e7 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -248,17 +248,10 @@ describe('CatalogPage', () => { it('should wrap filter in drawer on smaller screens', async () => { mockBreakpoint({ matches: true }); - const { getAllByText } = await renderWrapped(); - const elems = getAllByText('Filters'); - expect(elems[0]).toBeVisible(); - expect(elems[1]).not.toBeVisible(); - fireEvent.click(elems[0]); - expect(elems[1]).toBeVisible(); - }); - - it('should wrap filter in grid on larger screens', async () => { - mockBreakpoint({ matches: false }); - const { queryAllByText } = await renderWrapped(); - expect(queryAllByText('Filters').length).toBe(0); + const { getByRole } = await renderWrapped(); + const button = getByRole('button', { name: 'Filters' }); + expect(getByRole('presentation', { hidden: true })).toBeInTheDocument(); + fireEvent.click(button); + expect(getByRole('presentation')).toBeVisible(); }); }); From dfcf5dbc1eee5f822083c14e9502c07f9b8846ec Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Tue, 20 Jul 2021 12:09:52 +0200 Subject: [PATCH 088/101] Improve documentation of change to enable a better responsive implementation by tusers Clean up according to review Signed-off-by: Philipp Hugenroth --- .changeset/poor-jars-sniff.md | 8 +++++++- .../app/src/components/catalog/EntityPage.tsx | 5 +++-- .../src/layout/Header/Header.tsx | 20 +++++-------------- .../app/src/components/catalog/EntityPage.tsx | 6 +++--- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.changeset/poor-jars-sniff.md b/.changeset/poor-jars-sniff.md index 4c0c5d8133..b2be713a93 100644 --- a/.changeset/poor-jars-sniff.md +++ b/.changeset/poor-jars-sniff.md @@ -1,9 +1,15 @@ --- '@backstage/core-components': patch '@backstage/create-app': patch -'@backstage/plugin-api-docs': patch '@backstage/plugin-catalog': patch '@backstage/plugin-techdocs': patch --- Improve the responsiveness of the EntityPage UI. With this the Header component should scale with the screen size & wrapping should not cause overflowing/blocking of links. Additionally enforce the Pages using the Grid Layout to use it across all screen sizes & to wrap as intended. + +To benefit from the improved responsive layout, the `EntityPage` in existing Backstage applications should be updated to set the `xs` column size on each grid item in the page, as this does not default. For example: + +```diff +- ++ +``` diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index 137b359afd..4e2e32cc86 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -136,8 +136,9 @@ const EntityLayoutWrapper = (props: { children?: ReactNode }) => { }; /** - * TODO: For the MUI Grid to work there have to be "xs" set on every GridItem, - * such that the seperation of space is clear from the smallest screen size upwards + * NOTE: This page is designed to work on small screens such as mobile devices. + * This is based on Material UI Grid. If breakpoints are used, each grid item must set the `xs` prop to a column size or to `true`, + * since this does not default. If no breakpoints are used, the items will equitably share the asvailable space. * https://material-ui.com/components/grid/#basic-grid. */ diff --git a/packages/core-components/src/layout/Header/Header.tsx b/packages/core-components/src/layout/Header/Header.tsx index 1af1e2cc2f..227c6d1a60 100644 --- a/packages/core-components/src/layout/Header/Header.tsx +++ b/packages/core-components/src/layout/Header/Header.tsx @@ -16,7 +16,7 @@ import { useApi, configApiRef } from '@backstage/core-plugin-api'; import { BackstageTheme } from '@backstage/theme'; -import { makeStyles, Tooltip, Typography, Grid } from '@material-ui/core'; +import { Box, Grid, makeStyles, Tooltip, Typography } from '@material-ui/core'; import React, { CSSProperties, PropsWithChildren, ReactNode } from 'react'; import { Helmet } from 'react-helmet'; import { Link } from '../../components/Link'; @@ -44,15 +44,10 @@ const useStyles = makeStyles(theme => ({ }, leftItemsBox: { maxWidth: '100%', - flex: '1 1 auto', + flexGrow: 1, marginBottom: theme.spacing(1), }, rightItemsBox: { - flex: '0 1 auto', - display: 'flex', - flexDirection: 'row', - flexWrap: 'wrap', - alignItems: 'center', width: 'auto', }, title: { @@ -202,7 +197,7 @@ export const Header = ({ <>
-
+ -
- + + {children}
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 7ebbe53aa0..2074a2712c 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 @@ -158,12 +158,12 @@ const websiteEntityPage = ( ); /** - * TODO: For the MUI Grid to work there have to be "xs" set on every GridItem, - * such that the seperation of space is clear from the smallest screen size upwards + * NOTE: This page is designed to work on small screens such as mobile devices. + * This is based on Material UI Grid. If breakpoints are used, each grid item must set the `xs` prop to a column size or to `true`, + * since this does not default. If no breakpoints are used, the items will equitably share the asvailable space. * https://material-ui.com/components/grid/#basic-grid. */ - const defaultEntityPage = ( From c8dbc9aaa1294db252cccfacee93800d10e79e50 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Tue, 20 Jul 2021 12:42:04 +0200 Subject: [PATCH 089/101] techdocs: add a helpful link to docs page for warning Signed-off-by: Himanshu Mishra --- packages/techdocs-common/src/stages/generate/techdocs.test.ts | 3 ++- packages/techdocs-common/src/stages/generate/techdocs.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/techdocs-common/src/stages/generate/techdocs.test.ts b/packages/techdocs-common/src/stages/generate/techdocs.test.ts index f8d5128adc..f3a91657e1 100644 --- a/packages/techdocs-common/src/stages/generate/techdocs.test.ts +++ b/packages/techdocs-common/src/stages/generate/techdocs.test.ts @@ -132,7 +132,8 @@ describe('readGeneratorConfig', () => { runIn: 'local', }); expect(logger.warn).toHaveBeenCalledWith( - `The 'techdocs.generators.techdocs' configuration key is deprecated and will be removed in the future. Please use 'techdocs.generator' instead.`, + `The 'techdocs.generators.techdocs' configuration key is deprecated and will be removed in the future. Please use 'techdocs.generator' instead. ` + + `See here https://backstage.io/docs/features/techdocs/configuration`, ); }); }); diff --git a/packages/techdocs-common/src/stages/generate/techdocs.ts b/packages/techdocs-common/src/stages/generate/techdocs.ts index 6847a74300..9d6bf38c54 100644 --- a/packages/techdocs-common/src/stages/generate/techdocs.ts +++ b/packages/techdocs-common/src/stages/generate/techdocs.ts @@ -168,7 +168,8 @@ export function readGeneratorConfig( if (legacyGeneratorType) { logger.warn( - `The 'techdocs.generators.techdocs' configuration key is deprecated and will be removed in the future. Please use 'techdocs.generator' instead.`, + `The 'techdocs.generators.techdocs' configuration key is deprecated and will be removed in the future. Please use 'techdocs.generator' instead. ` + + `See here https://backstage.io/docs/features/techdocs/configuration`, ); } From 250984333e8356db2daaca56424390a4a804f123 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Tue, 20 Jul 2021 12:44:24 +0200 Subject: [PATCH 090/101] techdocs: add changeset Signed-off-by: Himanshu Mishra --- .changeset/techdocs-proud-apples-wonder.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/techdocs-proud-apples-wonder.md diff --git a/.changeset/techdocs-proud-apples-wonder.md b/.changeset/techdocs-proud-apples-wonder.md new file mode 100644 index 0000000000..901ee26472 --- /dev/null +++ b/.changeset/techdocs-proud-apples-wonder.md @@ -0,0 +1,5 @@ +--- +'@backstage/techdocs-common': patch +--- + +Add link to https://backstage.io/docs/features/techdocs/configuration in the log warning message about updating techdocs.generate key. From 1b056f8ee2d11873364411f53837c158a1b14137 Mon Sep 17 00:00:00 2001 From: Francesco Corti Date: Tue, 20 Jul 2021 12:10:14 +0200 Subject: [PATCH 091/101] Updated roadmap. Signed-off-by: blam --- docs/overview/roadmap.md | 152 ++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 84 deletions(-) diff --git a/docs/overview/roadmap.md b/docs/overview/roadmap.md index 0013c99c6b..dbd60be6af 100644 --- a/docs/overview/roadmap.md +++ b/docs/overview/roadmap.md @@ -1,116 +1,102 @@ + --- id: roadmap -title: Project roadmap -description: Roadmap of Backstage Project +title: Roadmap +description: Roadmap of Backstage --- -## Current status +## The Backstage Roadmap -> Backstage is currently under rapid development. This means that you can expect -> APIs and features to evolve. It is also recommended that teams who adopt -> Backstage today [upgrade their installation](../cli/commands.md#versionsbump) -> as new [releases](https://github.com/backstage/backstage/releases) become -> available, as Backwards compatibility is not yet guaranteed. +Backstage is currently under rapid development. This page details the project’s public roadmap, the result of ongoing collaboration between the core maintainers and the broader Backstage community. Treat the roadmap as an ever-evolving guide to keep us aligned as a community on: -## Phases + - Upcoming enhancements and benefits, + - Planning contributions and support, + - Planning the project’s adoption, + - Understanding what things are coming soon, + - Avoiding duplication of work -We have divided the project into three high-level _phases_: +### How to influence the roadmap -- 🐣 **Phase 1:** Extensible frontend platform (Done ✅) - You will be able to - easily create a single consistent UI layer for your internal infrastructure - and tools. A set of reusable - [UX patterns and components](https://backstage.io/storybook) help ensure a - consistent experience between tools. +As we evolve Backstage, we want you to contribute actively in the journey to define the most effective developer experience in the world. -- 🐢 **Phase 2:** Software Catalog - ([alpha released](https://backstage.io/blog/2020/06/22/backstage-service-catalog-alpha)) - - With a single catalog, Backstage makes it easy for a team to manage ten - services — and makes it possible for your company to manage thousands of them. +A roadmap is only useful if it captures real needs. If you have success stories, feedback, or ideas, we want to hear from you! If you plan to work (or are already working) on a new or existing feature, please let us know, so that we can update the roadmap accordingly. We are also happy to share knowledge and context that will help your feature land successfully. -- 🐇 **Phase 3:** Ecosystem (ongoing, see - [Plugin Marketplace](https://backstage.io/plugins)) - Everyone's - infrastructure stack is different. By fostering a vibrant community of - contributors we hope to provide an ecosystem of Open Source - plugins/integrations that allows you to pick the tools that match your stack. +You can also head over to the [CONTRIBUTING](https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md) guidelines to get started. -## Detailed roadmap +If you have specific questions about the roadmap, please create an [issue](https://github.com/backstage/backstage/issues/new/choose), ping us on [Discord](https://discord.gg/awD6SxgQ), or [book time](http://calendly.com/spotify-backstage) with the Spotify team. -If you have questions about the roadmap or want to provide feedback, we would -love to hear from you! Please create an -[Issue](https://github.com/backstage/backstage/issues/new/choose), ping us on -[Discord](https://discord.gg/EBHEGzX) or reach out directly at -[backstage-interest@spotify.com](mailto:backstage-interest@spotify.com). +### How to read the roadmap -Want to help out? Awesome ❤️ Head over to -[CONTRIBUTING](https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md) -guidelines to get started. +The Backstage roadmap lays out both [“what’s next”](#What’s-next) and [“future work”](#Future-work). With "next" we mean features planned for release within the ongoing quarter starting in July until September 2021 included. With "future" we mean features in the radar, but not yet scheduled. -### Ongoing work 🚧 +The long-term roadmap (12 - 36 months) is not detailed in the public roadmap. Third-party contributions are also not currently included in the roadmap. Let us know about any ongoing developments and we’re happy to include it here as well. -- **[Platform stabilization](https://github.com/backstage/backstage/milestone/19)** - - Stabilize the core of Backstage, including its core features, so that the - platform can be depended on for production use. After this, plugins will - require little-to-no maintenance. +### Roadmap evolution -- **[Kubernetes plugin for service owners](https://github.com/backstage/backstage/issues/2857)** - - Improve native support for Kubernetes, making it easier for service owners to - see and manage their services running in K8s, regardless if that's locally, in - AWS, GCS, Azure, or elsewhere. +Will this roadmap change? Obviously! -- **[Search platform](../features/search/README.md)** - Evolve the basic search - functionality currently available into a platform that **a)** enables search - across the software catalog, TechDocs, and any other information exposed by - plugins, and **b)** supports a variety of search engine technologies. +Roadmaps are always evolving and ours is no different; you can expect to see this updated roughly every month. -- **[Software Templates V2](https://github.com/backstage/backstage/issues/2771)** - - Expand the templates to make the steps more composable by adding the ability - to add more steps for custom logic, including webhooks and using authorization - from integrations. +## What’s next -### Future work 🔮 +The feature set below is planned for the ongoing quarter, and grouped by theme. The list order doesn’t necessarily reflect priority, and the development/release cycle will vary based on maintainer schedules. -- **Golden Path for Plugin Development** - Create an easy, standardized way for - developers to build plugins that will encourage contributions and lead to a - richer ecosystem for everyone. +### Backstage Core -- **[GraphQL API](https://github.com/backstage/backstage/milestone/13)** - A - GraphQL API will open up the rich metadata provided by Backstage in a single - query. Plugins can easily query this API as well as extend the model where - needed. +The following features are planned for release: -- **Inter-Plugin Communication** - **[Under consideration]** Establish more - clearly defined patterns for plugins to communicate. +* **Composable homepage:** We’re seeing lots of interest from the community in reusable components to build a homepage experience where users can easily surface what they might find useful to start their tasks. Check out the [milestone](https://github.com/backstage/backstage/milestone/34) for further details. +* **Improved responsiveness:** Check out the [RFC here](https://github.com/backstage/backstage/issues/6318) for further details on how to improve the responsiveness for Backstage's UI. -- **Improved Access Control** - **[Under consideration]** Provide finer grained - access controls and management for better control of the platform user - experience. +### Software Templates -### Plugins +The following features are planned for release:: -Building and maintaining [plugins](https://backstage.io/plugins) is the work of -the entire Backstage community. +* **Re-creation/resubmission in case of failure:** Speed up productivity by allowing developers to relaunch a project after a failure or any unexpected problem. In the current version, this task requires retyping and a full re-creation from scratch. +* **Performance and usability improvements for contributors:** Reach a relevant improvement in templating's performance through the replacement of [handlebars](https://handlebarsjs.com/). Other replacements will be considered as part of this task (possibly [cookiecutter](https://cookiecutter.readthedocs.io/)) for easier software template creation, allowing more contributors to reach their goals without having to learn new tooling. +* **Improved extensibility through inclusion:** Make software templates more maintainable and extensible by adding `$include` support for parameters. +* **Authenticated job creation:** Created jobs will be able to run with an authenticated user with all actions tracked for future consumption and evidence. Track users creating jobs and make “jobs created by me” reporting available. -A list of plugins that are in development is -[available here](https://github.com/backstage/backstage/issues?q=is%3Aissue+is%3Aopen+label%3Aplugin+sort%3Areactions-%2B1-desc). -We strongly recommend to upvote 👍 plugins you are interested in. This helps us -and the community prioritize what plugins to build. +### Software Catalog -Are you missing a plugin for your favorite tool? Please -[suggest a new one](https://github.com/backstage/backstage/issues/new?labels=plugin&template=plugin_template.md&title=%5BPlugin%5D+THE+PLUGIN+NAME). -Chances are that someone will jump in and help build it. +The following features are planned for release: -### Community Initiatives 🧑‍🤝‍🧑 +* **Request For Comments (RFC) for composability improvements (routing):** Enable plugins to be auto-added and make plugin installation and upgrades easier for all Backstage users. This includes information card layouts, entity pages containing content and hooking the external header, considering the support of a separate deployment, and configuration for plugins. +* **Removing duplicated entities in catalog:** As any adopter knows, a software catalog can contain thousands or more entities and it is very important to avoid duplications in naming to prevent failures. With this development task, two entities with the same name won't be allowed as described [here](https://github.com/backstage/backstage/issues/4760). +* **Connecting identity to ownership to prepare for role-based access control ([RBAC](https://en.wikipedia.org/wiki/Role-based_access_control)):** This is a first step to supporting RBAC for the software catalog (see the [future work section](#Future-work) for further details). Provide each entity within the software catalog with a recognized owner. +* **Catalog performance improvements through improved caching:** Fix the performance gaps in the catalog processor, which currently doesn’t have a strong caching mechanism. The current version often requires fetching a relevant amount of data, especially at scale. -- [**Backstage Community Sessions**](https://github.com/backstage/community#meetups) - - A monthly meetup for the community to come together to share and learn about - the latest happenings in Backstage. +### Search -- **Backstage Hackathons** - (Coming soon) Open to everyone in our Backstage - community, a celebration of you, the project and building awesome things - together +The following features are planned for release: -### Completed milestones ✅ +* ElasticSearch integration: Add ElasticSearch to the Search Platform as the underlying search engine. Check out the [milestone here](https://github.com/backstage/backstage/milestone/27) for further details. +### TechDocs + +The following features are planned for release: + +* **TechDocs beta release:** Fix remaining bugs to get TechDocs to Beta. Check out the [milestone here](https://github.com/backstage/backstage/milestone/29) for further details. + +## Future work + +The following feature list doesn’t represent a commitment to develop and the list order doesn’t reflect any priority or importance. But these features are on the maintainers’ radar, with clear interest expressed by the community. + +* **Improved UX design:** Provide a better Backstage user experience through visual guidelines and templates, especially navigation across plug-ins and portal functionalities. +* **Catalog composability (routing):** Follow up development after the RFC planned for the ongoing quarter (see [what’s next](#What’s-next) for further details). +* **Catalog-import improvements:** Provide a faster (scalability) and better (more features like move/rename) way to import entities into the Software Catalog. Importing items in the Software Catalog is crucial for creating a Backstage proof-of-concept or testing/planning for broader organizational adoption. This enhancement better supports getting developers to use Backstage with less effort and customization. +* **Catalog improvements:** Add pagination and sourcing to Software Catalog. +* **[GraphQL](https://graphql.org/) support:** Introduce the ability to query Backstage backend services with a standard query language for APIs. +* **Software templates performance improvements through decoupling a separate worker:** Improve performance through decoupling resource-consuming services and making them asynchronous. In the current version, project auto-creation through the Software Templating system can consume a lot of resources and bottleneck many concurrent projects created simultaneously. +* **API discovery and documentation:** Add better support for the [gRPC](https://grpc.io/). +* **Adding TechDocs search to the Search Platform:** Having this capability in place will provide a better and new major version of the Search Platform (v3.0). You can refer to the [milestone here](https://github.com/backstage/backstage/milestone/28) for further details. +* **TechDocs GA release:** Work toward enhancements necessary to get TechDocs to general availability. Check out the [milestone here](https://github.com/backstage/backstage/milestone/30) for further details. + +## Completed milestones + +Read more about the completed (and released) features for reference. + +- [[Search] Out-of-the-Box Implementation (Alpha)](https://github.com/backstage/backstage/milestone/26) - [Deploy a product demo at `demo.backstage.io`](https://demo.backstage.io) - [Kubernetes plugin - v1](https://github.com/backstage/backstage/tree/master/plugins/kubernetes) - [Helm charts](https://github.com/backstage/backstage/tree/master/contrib/chart/backstage) @@ -128,6 +114,4 @@ Chances are that someone will jump in and help build it. - [Service API documentation](https://github.com/backstage/backstage/pull/1737) - Backstage Software Catalog can read from: GitHub, GitLab, [Bitbucket](https://github.com/backstage/backstage/pull/1938) -- Support auth providers: Google, Okta, GitHub, GitLab, - [auth0](https://github.com/backstage/backstage/pull/1611), - [AWS](https://github.com/backstage/backstage/pull/1990) +- Support auth providers: Google, Okta, GitHub, GitLab, [auth0](https://github.com/backstage/backstage/pull/1611), [AWS](https://github.com/backstage/backstage/pull/1990) From b17407c9d1a9e0dcd316776db67c3522bd1973f3 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 20 Jul 2021 14:55:20 +0200 Subject: [PATCH 092/101] chore: run prettier and fix PR Signed-off-by: blam --- .github/styles/vocab.txt | 1 + docs/overview/roadmap.md | 185 ++++++++++++++++++++++++++++----------- 2 files changed, 136 insertions(+), 50 deletions(-) diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index e6af881f1e..186207041e 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -212,6 +212,7 @@ repos rerender Reusability reusability +roadmaps rollbar Rollbar Rollup diff --git a/docs/overview/roadmap.md b/docs/overview/roadmap.md index dbd60be6af..e1ff8c13bc 100644 --- a/docs/overview/roadmap.md +++ b/docs/overview/roadmap.md @@ -1,4 +1,3 @@ - --- id: roadmap title: Roadmap @@ -7,94 +6,178 @@ description: Roadmap of Backstage ## The Backstage Roadmap -Backstage is currently under rapid development. This page details the project’s public roadmap, the result of ongoing collaboration between the core maintainers and the broader Backstage community. Treat the roadmap as an ever-evolving guide to keep us aligned as a community on: +Backstage is currently under rapid development. This page details the project’s +public roadmap, the result of ongoing collaboration between the core maintainers +and the broader Backstage community. Treat the roadmap as an ever-evolving guide +to keep us aligned as a community on: - - Upcoming enhancements and benefits, - - Planning contributions and support, - - Planning the project’s adoption, - - Understanding what things are coming soon, - - Avoiding duplication of work +- Upcoming enhancements and benefits, +- Planning contributions and support, +- Planning the project’s adoption, +- Understanding what things are coming soon, +- Avoiding duplication of work ### How to influence the roadmap -As we evolve Backstage, we want you to contribute actively in the journey to define the most effective developer experience in the world. +As we evolve Backstage, we want you to contribute actively in the journey to +define the most effective developer experience in the world. -A roadmap is only useful if it captures real needs. If you have success stories, feedback, or ideas, we want to hear from you! If you plan to work (or are already working) on a new or existing feature, please let us know, so that we can update the roadmap accordingly. We are also happy to share knowledge and context that will help your feature land successfully. +A roadmap is only useful if it captures real needs. If you have success stories, +feedback, or ideas, we want to hear from you! If you plan to work (or are +already working) on a new or existing feature, please let us know, so that we +can update the roadmap accordingly. We are also happy to share knowledge and +context that will help your feature land successfully. -You can also head over to the [CONTRIBUTING](https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md) guidelines to get started. +You can also head over to the +[CONTRIBUTING](https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md) +guidelines to get started. -If you have specific questions about the roadmap, please create an [issue](https://github.com/backstage/backstage/issues/new/choose), ping us on [Discord](https://discord.gg/awD6SxgQ), or [book time](http://calendly.com/spotify-backstage) with the Spotify team. +If you have specific questions about the roadmap, please create an +[issue](https://github.com/backstage/backstage/issues/new/choose), ping us on +[Discord](https://discord.gg/awD6SxgQ), or +[book time](http://calendly.com/spotify-backstage) with the Spotify team. -### How to read the roadmap +### How to read the roadmap -The Backstage roadmap lays out both [“what’s next”](#What’s-next) and [“future work”](#Future-work). With "next" we mean features planned for release within the ongoing quarter starting in July until September 2021 included. With "future" we mean features in the radar, but not yet scheduled. +The Backstage roadmap lays out both [“what’s next”](#What’s-next) and +[“future work”](#Future-work). With "next" we mean features planned for release +within the ongoing quarter starting in July until September 2021 included. With +"future" we mean features in the radar, but not yet scheduled. -The long-term roadmap (12 - 36 months) is not detailed in the public roadmap. Third-party contributions are also not currently included in the roadmap. Let us know about any ongoing developments and we’re happy to include it here as well. +The long-term roadmap (12 - 36 months) is not detailed in the public roadmap. +Third-party contributions are also not currently included in the roadmap. Let us +know about any ongoing developments and we’re happy to include it here as well. ### Roadmap evolution Will this roadmap change? Obviously! -Roadmaps are always evolving and ours is no different; you can expect to see this updated roughly every month. +Roadmap are always evolving and ours is no different; you can expect to see this +updated roughly every month. ## What’s next -The feature set below is planned for the ongoing quarter, and grouped by theme. The list order doesn’t necessarily reflect priority, and the development/release cycle will vary based on maintainer schedules. +The feature set below is planned for the ongoing quarter, and grouped by theme. +The list order doesn’t necessarily reflect priority, and the development/release +cycle will vary based on maintainer schedules. -### Backstage Core +### Backstage Core -The following features are planned for release: +The following features are planned for release: -* **Composable homepage:** We’re seeing lots of interest from the community in reusable components to build a homepage experience where users can easily surface what they might find useful to start their tasks. Check out the [milestone](https://github.com/backstage/backstage/milestone/34) for further details. -* **Improved responsiveness:** Check out the [RFC here](https://github.com/backstage/backstage/issues/6318) for further details on how to improve the responsiveness for Backstage's UI. +- **Composable homepage:** We’re seeing lots of interest from the community in + reusable components to build a homepage experience where users can easily + surface what they might find useful to start their tasks. Check out the + [milestone](https://github.com/backstage/backstage/milestone/34) for further + details. +- **Improved responsiveness:** Check out the + [RFC here](https://github.com/backstage/backstage/issues/6318) for further + details on how to improve the responsiveness for Backstage's UI. ### Software Templates -The following features are planned for release:: +The following features are planned for release:: -* **Re-creation/resubmission in case of failure:** Speed up productivity by allowing developers to relaunch a project after a failure or any unexpected problem. In the current version, this task requires retyping and a full re-creation from scratch. -* **Performance and usability improvements for contributors:** Reach a relevant improvement in templating's performance through the replacement of [handlebars](https://handlebarsjs.com/). Other replacements will be considered as part of this task (possibly [cookiecutter](https://cookiecutter.readthedocs.io/)) for easier software template creation, allowing more contributors to reach their goals without having to learn new tooling. -* **Improved extensibility through inclusion:** Make software templates more maintainable and extensible by adding `$include` support for parameters. -* **Authenticated job creation:** Created jobs will be able to run with an authenticated user with all actions tracked for future consumption and evidence. Track users creating jobs and make “jobs created by me” reporting available. +- **Re-creation/resubmission in case of failure:** Speed up productivity by + allowing developers to relaunch a project after a failure or any unexpected + problem. In the current version, this task requires retyping and a full + re-creation from scratch. +- **Performance and usability improvements for contributors:** Reach a relevant + improvement in templating's performance through the replacement of + [handlebars](https://handlebarsjs.com/). Other replacements will be considered + as part of this task (possibly + [cookiecutter](https://cookiecutter.readthedocs.io/)) for easier software + template creation, allowing more contributors to reach their goals without + having to learn new tooling. +- **Improved extensibility through inclusion:** Make software templates more + maintainable and extensible by adding `$include` support for parameters. +- **Authenticated job creation:** Created jobs will be able to run with an + authenticated user with all actions tracked for future consumption and + evidence. Track users creating jobs and make “jobs created by me” reporting + available. -### Software Catalog +### Software Catalog -The following features are planned for release: +The following features are planned for release: -* **Request For Comments (RFC) for composability improvements (routing):** Enable plugins to be auto-added and make plugin installation and upgrades easier for all Backstage users. This includes information card layouts, entity pages containing content and hooking the external header, considering the support of a separate deployment, and configuration for plugins. -* **Removing duplicated entities in catalog:** As any adopter knows, a software catalog can contain thousands or more entities and it is very important to avoid duplications in naming to prevent failures. With this development task, two entities with the same name won't be allowed as described [here](https://github.com/backstage/backstage/issues/4760). -* **Connecting identity to ownership to prepare for role-based access control ([RBAC](https://en.wikipedia.org/wiki/Role-based_access_control)):** This is a first step to supporting RBAC for the software catalog (see the [future work section](#Future-work) for further details). Provide each entity within the software catalog with a recognized owner. -* **Catalog performance improvements through improved caching:** Fix the performance gaps in the catalog processor, which currently doesn’t have a strong caching mechanism. The current version often requires fetching a relevant amount of data, especially at scale. +- **Request For Comments (RFC) for composability improvements (routing):** + Enable plugins to be auto-added and make plugin installation and upgrades + easier for all Backstage users. This includes information card layouts, entity + pages containing content and hooking the external header, considering the + support of a separate deployment, and configuration for plugins. +- **Removing duplicated entities in catalog:** As any adopter knows, a software + catalog can contain thousands or more entities and it is very important to + avoid duplications in naming to prevent failures. With this development task, + two entities with the same name won't be allowed as described + [here](https://github.com/backstage/backstage/issues/4760). +- **Connecting identity to ownership to prepare for role-based access control + ([RBAC](https://en.wikipedia.org/wiki/Role-based_access_control)):** This is a + first step to supporting RBAC for the software catalog (see the + [future work section](#Future-work) for further details). Provide each entity + within the software catalog with a recognized owner. +- **Catalog performance improvements through improved caching:** Fix the + performance gaps in the catalog processor, which currently doesn’t have a + strong caching mechanism. The current version often requires fetching a + relevant amount of data, especially at scale. -### Search +### Search -The following features are planned for release: +The following features are planned for release: -* ElasticSearch integration: Add ElasticSearch to the Search Platform as the underlying search engine. Check out the [milestone here](https://github.com/backstage/backstage/milestone/27) for further details. +- ElasticSearch integration: Add ElasticSearch to the Search Platform as the + underlying search engine. Check out the + [milestone here](https://github.com/backstage/backstage/milestone/27) for + further details. -### TechDocs +### TechDocs -The following features are planned for release: +The following features are planned for release: -* **TechDocs beta release:** Fix remaining bugs to get TechDocs to Beta. Check out the [milestone here](https://github.com/backstage/backstage/milestone/29) for further details. +- **TechDocs beta release:** Fix remaining bugs to get TechDocs to Beta. Check + out the [milestone here](https://github.com/backstage/backstage/milestone/29) + for further details. -## Future work +## Future work -The following feature list doesn’t represent a commitment to develop and the list order doesn’t reflect any priority or importance. But these features are on the maintainers’ radar, with clear interest expressed by the community. +The following feature list doesn’t represent a commitment to develop and the +list order doesn’t reflect any priority or importance. But these features are on +the maintainers’ radar, with clear interest expressed by the community. -* **Improved UX design:** Provide a better Backstage user experience through visual guidelines and templates, especially navigation across plug-ins and portal functionalities. -* **Catalog composability (routing):** Follow up development after the RFC planned for the ongoing quarter (see [what’s next](#What’s-next) for further details). -* **Catalog-import improvements:** Provide a faster (scalability) and better (more features like move/rename) way to import entities into the Software Catalog. Importing items in the Software Catalog is crucial for creating a Backstage proof-of-concept or testing/planning for broader organizational adoption. This enhancement better supports getting developers to use Backstage with less effort and customization. -* **Catalog improvements:** Add pagination and sourcing to Software Catalog. -* **[GraphQL](https://graphql.org/) support:** Introduce the ability to query Backstage backend services with a standard query language for APIs. -* **Software templates performance improvements through decoupling a separate worker:** Improve performance through decoupling resource-consuming services and making them asynchronous. In the current version, project auto-creation through the Software Templating system can consume a lot of resources and bottleneck many concurrent projects created simultaneously. -* **API discovery and documentation:** Add better support for the [gRPC](https://grpc.io/). -* **Adding TechDocs search to the Search Platform:** Having this capability in place will provide a better and new major version of the Search Platform (v3.0). You can refer to the [milestone here](https://github.com/backstage/backstage/milestone/28) for further details. -* **TechDocs GA release:** Work toward enhancements necessary to get TechDocs to general availability. Check out the [milestone here](https://github.com/backstage/backstage/milestone/30) for further details. +- **Improved UX design:** Provide a better Backstage user experience through + visual guidelines and templates, especially navigation across plug-ins and + portal functionalities. +- **Catalog composability (routing):** Follow up development after the RFC + planned for the ongoing quarter (see [what’s next](#What’s-next) for further + details). +- **Catalog-import improvements:** Provide a faster (scalability) and better + (more features like move/rename) way to import entities into the Software + Catalog. Importing items in the Software Catalog is crucial for creating a + Backstage proof-of-concept or testing/planning for broader organizational + adoption. This enhancement better supports getting developers to use Backstage + with less effort and customization. +- **Catalog improvements:** Add pagination and sourcing to Software Catalog. +- **[GraphQL](https://graphql.org/) support:** Introduce the ability to query + Backstage backend services with a standard query language for APIs. +- **Software templates performance improvements through decoupling a separate + worker:** Improve performance through decoupling resource-consuming services + and making them asynchronous. In the current version, project auto-creation + through the Software Templating system can consume a lot of resources and + bottleneck many concurrent projects created simultaneously. +- **API discovery and documentation:** Add better support for the + [gRPC](https://grpc.io/). +- **Adding TechDocs search to the Search Platform:** Having this capability in + place will provide a better and new major version of the Search Platform + (v3.0). You can refer to the + [milestone here](https://github.com/backstage/backstage/milestone/28) for + further details. +- **TechDocs GA release:** Work toward enhancements necessary to get TechDocs to + general availability. Check out the + [milestone here](https://github.com/backstage/backstage/milestone/30) for + further details. ## Completed milestones -Read more about the completed (and released) features for reference. +Read more about the completed (and released) features for reference. - [[Search] Out-of-the-Box Implementation (Alpha)](https://github.com/backstage/backstage/milestone/26) - [Deploy a product demo at `demo.backstage.io`](https://demo.backstage.io) @@ -114,4 +197,6 @@ Read more about the completed (and released) features for reference. - [Service API documentation](https://github.com/backstage/backstage/pull/1737) - Backstage Software Catalog can read from: GitHub, GitLab, [Bitbucket](https://github.com/backstage/backstage/pull/1938) -- Support auth providers: Google, Okta, GitHub, GitLab, [auth0](https://github.com/backstage/backstage/pull/1611), [AWS](https://github.com/backstage/backstage/pull/1990) +- Support auth providers: Google, Okta, GitHub, GitLab, + [auth0](https://github.com/backstage/backstage/pull/1611), + [AWS](https://github.com/backstage/backstage/pull/1990) From 2567c066d5b67b60cec69b57818beb08475ba7b4 Mon Sep 17 00:00:00 2001 From: Roy Jacobs Date: Tue, 20 Jul 2021 16:56:28 +0200 Subject: [PATCH 093/101] Export TokenIssuer so that it may be used by non-native auth providers Signed-off-by: Roy Jacobs --- .changeset/eighty-jokes-roll.md | 5 +++++ plugins/auth-backend/api-report.md | 13 ++++++++++++- plugins/auth-backend/src/index.ts | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .changeset/eighty-jokes-roll.md diff --git a/.changeset/eighty-jokes-roll.md b/.changeset/eighty-jokes-roll.md new file mode 100644 index 0000000000..d51cd3a6dc --- /dev/null +++ b/.changeset/eighty-jokes-roll.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +TokenIssuer is now exported so it may be used by auth providers that are not bundled with Backstage diff --git a/plugins/auth-backend/api-report.md b/plugins/auth-backend/api-report.md index 174d640031..1ada822262 100644 --- a/plugins/auth-backend/api-report.md +++ b/plugins/auth-backend/api-report.md @@ -346,6 +346,16 @@ export interface RouterOptions { providerFactories?: ProviderFactories; } +// Warning: (ae-missing-release-tag) "TokenIssuer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type TokenIssuer = { + issueToken(params: TokenParams): Promise; + listPublicKeys(): Promise<{ + keys: AnyJWK[]; + }>; +}; + // Warning: (ae-missing-release-tag) "verifyNonce" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -366,9 +376,10 @@ export type WebMessageResponse = // Warnings were encountered during analysis: // +// src/identity/types.d.ts:25:5 - (ae-forgotten-export) The symbol "TokenParams" needs to be exported by the entry point index.d.ts +// src/identity/types.d.ts:31:9 - (ae-forgotten-export) The symbol "AnyJWK" needs to be exported by the entry point index.d.ts // src/providers/google/provider.d.ts:36:5 - (ae-forgotten-export) The symbol "AuthHandler" needs to be exported by the entry point index.d.ts // src/providers/types.d.ts:105:5 - (ae-forgotten-export) The symbol "AuthProviderConfig" needs to be exported by the entry point index.d.ts -// src/providers/types.d.ts:108:5 - (ae-forgotten-export) The symbol "TokenIssuer" needs to be exported by the entry point index.d.ts // src/providers/types.d.ts:111:5 - (ae-forgotten-export) The symbol "ExperimentalIdentityResolver" needs to be exported by the entry point index.d.ts // src/providers/types.d.ts:128:8 - (tsdoc-missing-deprecation-message) The @deprecated block must include a deprecation message, e.g. describing the recommended alternative diff --git a/plugins/auth-backend/src/index.ts b/plugins/auth-backend/src/index.ts index d3ea83efd6..6b15b1fc81 100644 --- a/plugins/auth-backend/src/index.ts +++ b/plugins/auth-backend/src/index.ts @@ -16,6 +16,7 @@ export * from './service/router'; export { IdentityClient } from './identity'; +export type { TokenIssuer } from './identity'; export * from './providers'; // flow package provides 2 functions From 1b994b4b6ecae8865d165d7aba50ca1a869ac3a6 Mon Sep 17 00:00:00 2001 From: Francesco Corti Date: Tue, 20 Jul 2021 18:07:13 +0200 Subject: [PATCH 094/101] Roadmap review for breaking links. Signed-off-by: Francesco Corti --- docs/overview/roadmap.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/overview/roadmap.md b/docs/overview/roadmap.md index e1ff8c13bc..fa34ca3d9a 100644 --- a/docs/overview/roadmap.md +++ b/docs/overview/roadmap.md @@ -39,8 +39,8 @@ If you have specific questions about the roadmap, please create an ### How to read the roadmap -The Backstage roadmap lays out both [“what’s next”](#What’s-next) and -[“future work”](#Future-work). With "next" we mean features planned for release +The Backstage roadmap lays out both [“what’s next”](#whats-next) and +[“future work”](#future-work). With "next" we mean features planned for release within the ongoing quarter starting in July until September 2021 included. With "future" we mean features in the radar, but not yet scheduled. @@ -113,7 +113,7 @@ The following features are planned for release: - **Connecting identity to ownership to prepare for role-based access control ([RBAC](https://en.wikipedia.org/wiki/Role-based_access_control)):** This is a first step to supporting RBAC for the software catalog (see the - [future work section](#Future-work) for further details). Provide each entity + [future work section](#future-work) for further details). Provide each entity within the software catalog with a recognized owner. - **Catalog performance improvements through improved caching:** Fix the performance gaps in the catalog processor, which currently doesn’t have a @@ -147,7 +147,7 @@ the maintainers’ radar, with clear interest expressed by the community. visual guidelines and templates, especially navigation across plug-ins and portal functionalities. - **Catalog composability (routing):** Follow up development after the RFC - planned for the ongoing quarter (see [what’s next](#What’s-next) for further + planned for the ongoing quarter (see [what’s next](#whats-next) for further details). - **Catalog-import improvements:** Provide a faster (scalability) and better (more features like move/rename) way to import entities into the Software From 442e1a52b8977c5b458331c4e05e05c4852d80ca Mon Sep 17 00:00:00 2001 From: daftgopher Date: Tue, 20 Jul 2021 23:10:12 -0400 Subject: [PATCH 095/101] Minor text agreement correction Signed-off-by: daftgopher --- docs/plugins/structure-of-a-plugin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins/structure-of-a-plugin.md b/docs/plugins/structure-of-a-plugin.md index beffcdb313..147f916a0d 100644 --- a/docs/plugins/structure-of-a-plugin.md +++ b/docs/plugins/structure-of-a-plugin.md @@ -99,14 +99,14 @@ You may tweak these components, rename them and/or replace them completely. ## Connecting the plugin to the Backstage app -There are three things needed for a Backstage app to start making use of a +There are two things needed for a Backstage app to start making use of a plugin. 1. Add plugin as dependency in `app/package.json` 2. Import and use one or more plugin extensions, for example in `app/src/App.tsx`. -Luckily these three steps happen automatically when you create a plugin with the +Luckily both of these steps happen automatically when you create a plugin with the Backstage CLI. ## Talking to the outside world From 903f3323c29def19f25f4b9b13bb626fe5e2c177 Mon Sep 17 00:00:00 2001 From: Tim Hansen Date: Tue, 20 Jul 2021 21:18:31 -0600 Subject: [PATCH 096/101] Fix misleading catalog-import heading Signed-off-by: Tim Hansen --- .changeset/funny-moose-tie.md | 5 +++ .../src/components/ImportComponentPage.tsx | 34 +++++-------------- 2 files changed, 14 insertions(+), 25 deletions(-) create mode 100644 .changeset/funny-moose-tie.md diff --git a/.changeset/funny-moose-tie.md b/.changeset/funny-moose-tie.md new file mode 100644 index 0000000000..3d3ab5f632 --- /dev/null +++ b/.changeset/funny-moose-tie.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-import': patch +--- + +Fix heading that wrongly implied catalog-import supports entity discovery for multiple integrations. diff --git a/plugins/catalog-import/src/components/ImportComponentPage.tsx b/plugins/catalog-import/src/components/ImportComponentPage.tsx index 6bf5af24ef..f4ca144165 100644 --- a/plugins/catalog-import/src/components/ImportComponentPage.tsx +++ b/plugins/catalog-import/src/components/ImportComponentPage.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ -import { Grid, Typography } from '@material-ui/core'; +import { Chip, 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 { configApiRef, useApi } from '@backstage/core-plugin-api'; import { Content, ContentHeader, @@ -29,30 +29,12 @@ import { SupportButton, } from '@backstage/core-components'; -function repositories(configApi: ConfigApi): string[] { - const integrations = configApi.getConfig('integrations'); - const repos = []; - if (integrations.has('github')) { - repos.push('GitHub'); - } - if (integrations.has('bitbucket')) { - repos.push('Bitbucket'); - } - if (integrations.has('gitlab')) { - repos.push('GitLab'); - } - if (integrations.has('azure')) { - repos.push('Azure'); - } - return repos; -} - export const ImportComponentPage = (opts: StepperProviderOpts) => { const configApi = useApi(configApiRef); const appTitle = configApi.getOptional('app.title') || 'Backstage'; - const repos = repositories(configApi); - const repositoryString = repos.join(', ').replace(/, (\w*)$/, ' or $1'); + const integrations = configApi.getConfig('integrations'); + const hasGithubIntegration = integrations.has('github'); return ( @@ -76,7 +58,8 @@ export const ImportComponentPage = (opts: StepperProviderOpts) => { }} > - Enter the URL to your SCM repository to add it to {appTitle}. + Enter the URL to your source code repository to add it to{' '} + {appTitle}. Link to an existing entity file @@ -91,10 +74,11 @@ export const ImportComponentPage = (opts: StepperProviderOpts) => { The wizard analyzes the file, previews the entities, and adds them to the {appTitle} catalog. - {repos.length > 0 && ( + {hasGithubIntegration && ( <> - Link to a {repositoryString} repository + Link to a repository{' '} + Date: Wed, 21 Jul 2021 04:13:46 +0000 Subject: [PATCH 097/101] chore(deps-dev): bump nodemon from 2.0.7 to 2.0.12 Bumps [nodemon](https://github.com/remy/nodemon) from 2.0.7 to 2.0.12. - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](https://github.com/remy/nodemon/compare/v2.0.7...v2.0.12) --- updated-dependencies: - dependency-name: nodemon dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index abb07ca464..03dc018a06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18899,9 +18899,9 @@ node-releases@^1.1.52, node-releases@^1.1.61, node-releases@^1.1.71: integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== nodemon@^2.0.2: - version "2.0.7" - resolved "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz#6f030a0a0ebe3ea1ba2a38f71bf9bab4841ced32" - integrity sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA== + version "2.0.12" + resolved "https://registry.npmjs.org/nodemon/-/nodemon-2.0.12.tgz#5dae4e162b617b91f1873b3bfea215dd71e144d5" + integrity sha512-egCTmNZdObdBxUBw6ZNwvZ/xzk24CKRs5K6d+5zbmrMr7rOpPmfPeF6OxM3DDpaRx331CQRFEktn+wrFFfBSOA== dependencies: chokidar "^3.2.2" debug "^3.2.6" From ab32efd88ab0617bd5885e3ac9b8c0446c207aff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 04:14:50 +0000 Subject: [PATCH 098/101] chore(deps): bump immer from 9.0.1 to 9.0.5 Bumps [immer](https://github.com/immerjs/immer) from 9.0.1 to 9.0.5. - [Release notes](https://github.com/immerjs/immer/releases) - [Commits](https://github.com/immerjs/immer/compare/v9.0.1...v9.0.5) --- updated-dependencies: - dependency-name: immer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index abb07ca464..db8f48ca60 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14745,9 +14745,9 @@ immer@8.0.1: integrity sha512-aqXhGP7//Gui2+UrEtvxZxSquQVXTpZ7KDxfCcKAF3Vysvw0CViVaW9RZ1j1xlIYqaaaipBoqdqeibkc18PNvA== immer@^9.0.1: - version "9.0.1" - resolved "https://registry.npmjs.org/immer/-/immer-9.0.1.tgz#1116368e051f9a0fd188c5136b6efb74ed69c57f" - integrity sha512-7CCw1DSgr8kKYXTYOI1qMM/f5qxT5vIVMeGLDCDX8CSxsggr1Sjdoha4OhsP0AZ1UvWbyZlILHvLjaynuu02Mg== + version "9.0.5" + resolved "https://registry.npmjs.org/immer/-/immer-9.0.5.tgz#a7154f34fe7064f15f00554cc94c66cc0bf453ec" + integrity sha512-2WuIehr2y4lmYz9gaQzetPR2ECniCifk4ORaQbU3g5EalLt+0IVTosEPJ5BoYl/75ky2mivzdRzV8wWgQGOSYQ== immutable@>=3.8.2, immutable@^3.8.1, immutable@^3.8.2, immutable@^3.x.x: version "3.8.2" From 47029e79a05989703e4477f8caf80b447483f087 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Wed, 21 Jul 2021 09:08:23 +0200 Subject: [PATCH 099/101] docs: run prettier Signed-off-by: Himanshu Mishra --- docs/plugins/structure-of-a-plugin.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/plugins/structure-of-a-plugin.md b/docs/plugins/structure-of-a-plugin.md index 147f916a0d..99a55745c5 100644 --- a/docs/plugins/structure-of-a-plugin.md +++ b/docs/plugins/structure-of-a-plugin.md @@ -99,15 +99,14 @@ You may tweak these components, rename them and/or replace them completely. ## Connecting the plugin to the Backstage app -There are two things needed for a Backstage app to start making use of a -plugin. +There are two things needed for a Backstage app to start making use of a plugin. 1. Add plugin as dependency in `app/package.json` 2. Import and use one or more plugin extensions, for example in `app/src/App.tsx`. -Luckily both of these steps happen automatically when you create a plugin with the -Backstage CLI. +Luckily both of these steps happen automatically when you create a plugin with +the Backstage CLI. ## Talking to the outside world From 11e0652f8641f23ebb87186e74ff6d96969d0c75 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Wed, 21 Jul 2021 10:59:17 +0200 Subject: [PATCH 100/101] Introduce ability to add custom features Also, add more metadata to success callbacks Signed-off-by: Erik Engervall --- plugins/git-release-manager/dev/index.tsx | 76 +++++++++++++++---- .../src/GitReleaseManager.tsx | 35 ++++++--- .../CreateReleaseCandidate.tsx | 4 +- .../hooks/useCreateReleaseCandidate.ts | 16 +++- .../src/features/Features.tsx | 8 ++ .../src/features/Patch/Patch.tsx | 4 +- .../src/features/Patch/PatchBody.tsx | 4 +- .../src/features/Patch/hooks/usePatch.ts | 28 ++++--- .../src/features/PromoteRc/PromoteRc.tsx | 4 +- .../src/features/PromoteRc/PromoteRcBody.tsx | 4 +- .../features/PromoteRc/hooks/usePromoteRc.ts | 22 ++++-- .../git-release-manager/src/types/types.ts | 26 ++++--- 12 files changed, 166 insertions(+), 65 deletions(-) diff --git a/plugins/git-release-manager/dev/index.tsx b/plugins/git-release-manager/dev/index.tsx index 2a0170a61e..1876995bf1 100644 --- a/plugins/git-release-manager/dev/index.tsx +++ b/plugins/git-release-manager/dev/index.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { createDevApp } from '@backstage/dev-utils'; -import { Box, Typography } from '@material-ui/core'; +import { Box, Button, Typography } from '@material-ui/core'; import { gitReleaseManagerPlugin, GitReleaseManagerPage } from '../src/plugin'; import { InfoCardPlus } from '../src/components/InfoCardPlus'; @@ -44,10 +44,16 @@ createDevApp() Dev notes + Configure plugin statically by passing props to the `GitHubReleaseManagerPage` component + + + Note that the static configuration points towards private + repositories and will thus not work for everyone. + Dev notes - Each feature can be omitted - Success callbacks can also be added + + Each feature can be individually omitted as well as have success + callback attached to them + { + onSuccess: args => { // eslint-disable-next-line no-console console.log( - 'Custom success callback for Create RC', - comparisonUrl, - createdTag, - gitReleaseName, - gitReleaseUrl, - previousTag, + 'Custom success callback for Create RC with the following args', ); + console.log(JSON.stringify(args, null, 2)); // eslint-disable-line no-console }, }, promoteRc: { @@ -108,4 +106,50 @@ createDevApp() ), }) + .addPage({ + title: 'Custom', + path: '/custom', + element: ( + + + Dev notes + + The custom feature's return value can either be a React Element or + an array of React Elements. + + + + { + return ( + + I'm a custom feature + + + + ); + }, + }, + }} + /> + + ), + }) .render(); diff --git a/plugins/git-release-manager/src/GitReleaseManager.tsx b/plugins/git-release-manager/src/GitReleaseManager.tsx index 44669f9bc7..bca19b9b13 100644 --- a/plugins/git-release-manager/src/GitReleaseManager.tsx +++ b/plugins/git-release-manager/src/GitReleaseManager.tsx @@ -18,12 +18,14 @@ import React from 'react'; import { useAsync } from 'react-use'; import { Alert } from '@material-ui/lab'; import { Box } from '@material-ui/core'; +import { useApi } from '@backstage/core-plugin-api'; +import { ContentHeader, Progress } from '@backstage/core-components'; import { ComponentConfig, - ComponentConfigCreateRc, - ComponentConfigPatch, - ComponentConfigPromoteRc, + CreateRcOnSuccessArgs, + PatchOnSuccessArgs, + PromoteRcOnSuccessArgs, } from './types/types'; import { Features } from './features/Features'; import { gitReleaseManagerApiRef } from './api/serviceApiRef'; @@ -33,18 +35,33 @@ import { ProjectContext, Project } from './contexts/ProjectContext'; 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'; +import { + GetBranchResult, + GetLatestReleaseResult, + GetRepositoryResult, +} from './api/GitReleaseClient'; interface GitReleaseManagerProps { project?: Omit; features?: { info?: Pick, 'omit'>; stats?: Pick, 'omit'>; - createRc?: ComponentConfigCreateRc; - promoteRc?: ComponentConfigPromoteRc; - patch?: ComponentConfigPatch; + createRc?: ComponentConfig; + promoteRc?: ComponentConfig; + patch?: ComponentConfig; + custom?: { + factory: ({ + latestRelease, + project, + releaseBranch, + repository, + }: { + latestRelease: GetLatestReleaseResult['latestRelease'] | null; + project: Project; + releaseBranch: GetBranchResult['branch'] | null; + repository: GetRepositoryResult['repository']; + }) => React.ReactElement | React.ReactElement[]; + }; }; } diff --git a/plugins/git-release-manager/src/features/CreateReleaseCandidate/CreateReleaseCandidate.tsx b/plugins/git-release-manager/src/features/CreateReleaseCandidate/CreateReleaseCandidate.tsx index e99fd9267e..7f24241e66 100644 --- a/plugins/git-release-manager/src/features/CreateReleaseCandidate/CreateReleaseCandidate.tsx +++ b/plugins/git-release-manager/src/features/CreateReleaseCandidate/CreateReleaseCandidate.tsx @@ -31,7 +31,7 @@ import { GetLatestReleaseResult, GetRepositoryResult, } from '../../api/GitReleaseClient'; -import { ComponentConfigCreateRc } from '../../types/types'; +import { ComponentConfig, CreateRcOnSuccessArgs } from '../../types/types'; import { Differ } from '../../components/Differ'; import { getReleaseCandidateGitInfo } from '../../helpers/getReleaseCandidateGitInfo'; import { InfoCardPlus } from '../../components/InfoCardPlus'; @@ -45,7 +45,7 @@ interface CreateReleaseCandidateProps { defaultBranch: GetRepositoryResult['repository']['defaultBranch']; latestRelease: GetLatestReleaseResult['latestRelease']; releaseBranch: GetBranchResult['branch'] | null; - onSuccess?: ComponentConfigCreateRc['onSuccess']; + onSuccess?: ComponentConfig['onSuccess']; } const InfoCardPlusWrapper = ({ children }: { children: React.ReactNode }) => { 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 0d6d4ebb4f..9a89d59c54 100644 --- a/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts +++ b/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts @@ -21,7 +21,11 @@ import { GetRepositoryResult, } from '../../../api/GitReleaseClient'; -import { CardHook, ComponentConfigCreateRc } from '../../../types/types'; +import { + CardHook, + ComponentConfig, + CreateRcOnSuccessArgs, +} from '../../../types/types'; import { getReleaseCandidateGitInfo } from '../../../helpers/getReleaseCandidateGitInfo'; import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef'; import { GitReleaseManagerError } from '../../../errors/GitReleaseManagerError'; @@ -31,12 +35,12 @@ import { useResponseSteps } from '../../../hooks/useResponseSteps'; import { useUserContext } from '../../../contexts/UserContext'; import { useApi } from '@backstage/core-plugin-api'; -interface UseCreateReleaseCandidate { +export interface UseCreateReleaseCandidate { defaultBranch: GetRepositoryResult['repository']['defaultBranch']; latestRelease: GetLatestReleaseResult['latestRelease']; releaseCandidateGitInfo: ReturnType; project: Project; - onSuccess?: ComponentConfigCreateRc['onSuccess']; + onSuccess?: ComponentConfig['onSuccess']; } export function useCreateReleaseCandidate({ @@ -266,6 +270,12 @@ export function useCreateReleaseCandidate({ try { await onSuccess({ + input: { + defaultBranch, + latestRelease, + releaseCandidateGitInfo, + project, + }, comparisonUrl: getComparisonRes.value.htmlUrl, createdTag: createReleaseRes.value.tagName, gitReleaseName: createReleaseRes.value.name, diff --git a/plugins/git-release-manager/src/features/Features.tsx b/plugins/git-release-manager/src/features/Features.tsx index 4014f26f73..b8386c41cc 100644 --- a/plugins/git-release-manager/src/features/Features.tsx +++ b/plugins/git-release-manager/src/features/Features.tsx @@ -142,6 +142,14 @@ export function Features({ onSuccess={features?.patch?.onSuccess} /> )} + + {features?.custom?.factory && + features.custom.factory({ + latestRelease: gitBatchInfo.value.latestRelease, + project, + releaseBranch: gitBatchInfo.value.releaseBranch, + repository: gitBatchInfo.value.repository, + })} ); diff --git a/plugins/git-release-manager/src/features/Patch/Patch.tsx b/plugins/git-release-manager/src/features/Patch/Patch.tsx index 53fc901da7..c902ab0dc5 100644 --- a/plugins/git-release-manager/src/features/Patch/Patch.tsx +++ b/plugins/git-release-manager/src/features/Patch/Patch.tsx @@ -22,7 +22,7 @@ import { GetBranchResult, GetLatestReleaseResult, } from '../../api/GitReleaseClient'; -import { ComponentConfigPatch } from '../../types/types'; +import { ComponentConfig, PatchOnSuccessArgs } from '../../types/types'; import { getBumpedTag } from '../../helpers/getBumpedTag'; import { InfoCardPlus } from '../../components/InfoCardPlus'; import { NoLatestRelease } from '../../components/NoLatestRelease'; @@ -32,7 +32,7 @@ import { useProjectContext } from '../../contexts/ProjectContext'; interface PatchProps { latestRelease: GetLatestReleaseResult['latestRelease']; releaseBranch: GetBranchResult['branch'] | null; - onSuccess?: ComponentConfigPatch['onSuccess']; + onSuccess?: ComponentConfig['onSuccess']; } export const Patch = ({ diff --git a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx index b4e705fa58..01f5bc9fed 100644 --- a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx +++ b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx @@ -38,7 +38,7 @@ import { GetLatestReleaseResult, } from '../../api/GitReleaseClient'; import { CalverTagParts } from '../../helpers/tagParts/getCalverTagParts'; -import { ComponentConfigPatch } from '../../types/types'; +import { ComponentConfig, PatchOnSuccessArgs } from '../../types/types'; import { Differ } from '../../components/Differ'; import { getPatchCommitSuffix } from './helpers/getPatchCommitSuffix'; import { gitReleaseManagerApiRef } from '../../api/serviceApiRef'; @@ -56,7 +56,7 @@ interface PatchBodyProps { bumpedTag: string; latestRelease: NonNullable; releaseBranch: GetBranchResult['branch']; - onSuccess?: ComponentConfigPatch['onSuccess']; + onSuccess?: ComponentConfig['onSuccess']; tagParts: NonNullable; } diff --git a/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts index 5d3f9829ad..a2cbb7aefb 100644 --- a/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts +++ b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts @@ -22,7 +22,11 @@ import { } from '../../../api/GitReleaseClient'; import { CalverTagParts } from '../../../helpers/tagParts/getCalverTagParts'; -import { ComponentConfigPatch, CardHook } from '../../../types/types'; +import { + CardHook, + ComponentConfig, + PatchOnSuccessArgs, +} from '../../../types/types'; import { getPatchCommitSuffix } from '../helpers/getPatchCommitSuffix'; import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef'; import { Project } from '../../../contexts/ProjectContext'; @@ -32,12 +36,12 @@ import { useResponseSteps } from '../../../hooks/useResponseSteps'; import { useUserContext } from '../../../contexts/UserContext'; import { useApi } from '@backstage/core-plugin-api'; -interface Patch { +export interface UsePatch { bumpedTag: string; latestRelease: NonNullable; project: Project; tagParts: NonNullable; - onSuccess?: ComponentConfigPatch['onSuccess']; + onSuccess?: ComponentConfig['onSuccess']; } // Inspiration: https://stackoverflow.com/questions/53859199/how-to-cherry-pick-through-githubs-api @@ -47,7 +51,7 @@ export function usePatch({ project, tagParts, onSuccess, -}: Patch): CardHook { +}: UsePatch): CardHook { const pluginApiClient = useApi(gitReleaseManagerApiRef); const { user } = useUserContext(); const { @@ -337,13 +341,19 @@ ${selectedPatchCommit.commit.message}`, try { await onSuccess?.({ - updatedReleaseUrl: updatedReleaseRes.value.htmlUrl, - updatedReleaseName: updatedReleaseRes.value.name, - previousTag: latestRelease.tagName, - patchedTag: updatedReleaseRes.value.tagName, - patchCommitUrl: releaseBranchRes.value.selectedPatchCommit.htmlUrl, + input: { + bumpedTag, + latestRelease, + project, + tagParts, + }, patchCommitMessage: releaseBranchRes.value.selectedPatchCommit.commit.message, + patchCommitUrl: releaseBranchRes.value.selectedPatchCommit.htmlUrl, + patchedTag: updatedReleaseRes.value.tagName, + previousTag: latestRelease.tagName, + updatedReleaseName: updatedReleaseRes.value.name, + updatedReleaseUrl: updatedReleaseRes.value.htmlUrl, }); } catch (error) { asyncCatcher(error); diff --git a/plugins/git-release-manager/src/features/PromoteRc/PromoteRc.tsx b/plugins/git-release-manager/src/features/PromoteRc/PromoteRc.tsx index 8d42119748..341ecbbce4 100644 --- a/plugins/git-release-manager/src/features/PromoteRc/PromoteRc.tsx +++ b/plugins/git-release-manager/src/features/PromoteRc/PromoteRc.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { Alert, AlertTitle } from '@material-ui/lab'; import { Box, Typography } from '@material-ui/core'; -import { ComponentConfigPromoteRc } from '../../types/types'; +import { ComponentConfig, PromoteRcOnSuccessArgs } from '../../types/types'; import { GetLatestReleaseResult } from '../../api/GitReleaseClient'; import { InfoCardPlus } from '../../components/InfoCardPlus'; import { NoLatestRelease } from '../../components/NoLatestRelease'; @@ -27,7 +27,7 @@ import { TEST_IDS } from '../../test-helpers/test-ids'; interface PromoteRcProps { latestRelease: GetLatestReleaseResult['latestRelease']; - onSuccess?: ComponentConfigPromoteRc['onSuccess']; + onSuccess?: ComponentConfig['onSuccess']; } export const PromoteRc = ({ latestRelease, onSuccess }: PromoteRcProps) => { diff --git a/plugins/git-release-manager/src/features/PromoteRc/PromoteRcBody.tsx b/plugins/git-release-manager/src/features/PromoteRc/PromoteRcBody.tsx index d3ce5e4a70..3ca4518bbc 100644 --- a/plugins/git-release-manager/src/features/PromoteRc/PromoteRcBody.tsx +++ b/plugins/git-release-manager/src/features/PromoteRc/PromoteRcBody.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { Button, Typography, Box } from '@material-ui/core'; -import { ComponentConfigPromoteRc } from '../../types/types'; +import { ComponentConfig, PromoteRcOnSuccessArgs } from '../../types/types'; import { Differ } from '../../components/Differ'; import { GetLatestReleaseResult } from '../../api/GitReleaseClient'; import { ResponseStepDialog } from '../../components/ResponseStepDialog/ResponseStepDialog'; @@ -26,7 +26,7 @@ import { usePromoteRc } from './hooks/usePromoteRc'; interface PromoteRcBodyProps { rcRelease: NonNullable; - onSuccess?: ComponentConfigPromoteRc['onSuccess']; + onSuccess?: ComponentConfig['onSuccess']; } export const PromoteRcBody = ({ rcRelease, onSuccess }: PromoteRcBodyProps) => { 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 357ba1e0a6..f3a87d3c74 100644 --- a/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts +++ b/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts @@ -16,7 +16,11 @@ import { useState, useEffect } from 'react'; import { useAsync, useAsyncFn } from 'react-use'; -import { CardHook, ComponentConfigPromoteRc } from '../../../types/types'; +import { + CardHook, + ComponentConfig, + PromoteRcOnSuccessArgs, +} from '../../../types/types'; import { GetLatestReleaseResult } from '../../../api/GitReleaseClient'; import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef'; @@ -27,17 +31,17 @@ import { useResponseSteps } from '../../../hooks/useResponseSteps'; import { useUserContext } from '../../../contexts/UserContext'; import { useApi } from '@backstage/core-plugin-api'; -interface PromoteRc { +export interface UsePromoteRc { rcRelease: NonNullable; releaseVersion: string; - onSuccess?: ComponentConfigPromoteRc['onSuccess']; + onSuccess?: ComponentConfig['onSuccess']; } export function usePromoteRc({ rcRelease, releaseVersion, onSuccess, -}: PromoteRc): CardHook { +}: UsePromoteRc): CardHook { const pluginApiClient = useApi(gitReleaseManagerApiRef); const { user } = useUserContext(); const { project } = useProjectContext(); @@ -170,12 +174,16 @@ export function usePromoteRc({ try { await onSuccess?.({ - gitReleaseUrl: promotedReleaseRes.value.htmlUrl, + input: { + rcRelease, + releaseVersion, + }, gitReleaseName: promotedReleaseRes.value.name, - previousTagUrl: rcRelease.htmlUrl, + gitReleaseUrl: promotedReleaseRes.value.htmlUrl, previousTag: rcRelease.tagName, - updatedTagUrl: promotedReleaseRes.value.htmlUrl, + previousTagUrl: rcRelease.htmlUrl, updatedTag: promotedReleaseRes.value.tagName, + updatedTagUrl: promotedReleaseRes.value.htmlUrl, }); } catch (error) { asyncCatcher(error); diff --git a/plugins/git-release-manager/src/types/types.ts b/plugins/git-release-manager/src/types/types.ts index fd45e55ba2..39418fa9d3 100644 --- a/plugins/git-release-manager/src/types/types.ts +++ b/plugins/git-release-manager/src/types/types.ts @@ -14,21 +14,26 @@ * limitations under the License. */ -export type ComponentConfig = { +import { UseCreateReleaseCandidate } from '../features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate'; +import { UsePatch } from '../features/Patch/hooks/usePatch'; +import { UsePromoteRc } from '../features/PromoteRc/hooks/usePromoteRc'; + +export type ComponentConfig = { omit?: boolean; - onSuccess?: (args: Args) => Promise | void; + onSuccess?: (args: OnSuccessArgs) => Promise | void; }; -interface CreateRcOnSuccessArgs { - gitReleaseUrl: string; - gitReleaseName: string | null; +export interface CreateRcOnSuccessArgs { + input: Omit; comparisonUrl: string; - previousTag?: string; createdTag: string; + gitReleaseName: string | null; + gitReleaseUrl: string; + previousTag?: string; } -export type ComponentConfigCreateRc = ComponentConfig; -interface PromoteRcOnSuccessArgs { +export interface PromoteRcOnSuccessArgs { + input: Omit; gitReleaseUrl: string; gitReleaseName: string | null; previousTagUrl: string; @@ -36,9 +41,9 @@ interface PromoteRcOnSuccessArgs { updatedTagUrl: string; updatedTag: string; } -export type ComponentConfigPromoteRc = ComponentConfig; -interface PatchOnSuccessArgs { +export interface PatchOnSuccessArgs { + input: Omit; updatedReleaseUrl: string; updatedReleaseName: string | null; previousTag: string; @@ -46,7 +51,6 @@ interface PatchOnSuccessArgs { patchCommitUrl: string; patchCommitMessage: string; } -export type ComponentConfigPatch = ComponentConfig; export interface ResponseStep { message: string | React.ReactNode; From a2d8922c94f076433db2aef96d6b14dc19efa00f Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Wed, 21 Jul 2021 11:00:27 +0200 Subject: [PATCH 101/101] Add changeset & apply changes in api-report.md & package.json to make CI happy Signed-off-by: Erik Engervall --- .changeset/mighty-books-decide.md | 7 +++++++ plugins/git-release-manager/api-report.md | 1 + plugins/git-release-manager/package.json | 5 +++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/mighty-books-decide.md diff --git a/.changeset/mighty-books-decide.md b/.changeset/mighty-books-decide.md new file mode 100644 index 0000000000..6a25a2d2b5 --- /dev/null +++ b/.changeset/mighty-books-decide.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-git-release-manager': minor +--- + +Enable users to add custom features + +Add more metadata to success callbacks diff --git a/plugins/git-release-manager/api-report.md b/plugins/git-release-manager/api-report.md index 2497fed470..018a0f4be8 100644 --- a/plugins/git-release-manager/api-report.md +++ b/plugins/git-release-manager/api-report.md @@ -7,6 +7,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; +import { default as React_2 } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; // Warning: (ae-forgotten-export) The symbol "GitReleaseApi" needs to be exported by the entry point index.d.ts diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json index 35c5056904..676550ae10 100644 --- a/plugins/git-release-manager/package.json +++ b/plugins/git-release-manager/package.json @@ -28,12 +28,13 @@ "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", "@octokit/rest": "^18.5.3", + "@types/react": "^16.9", "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": { @@ -42,8 +43,8 @@ "@backstage/dev-utils": "^0.2.2", "@backstage/test-utils": "^0.1.14", "@testing-library/jest-dom": "^5.10.1", - "@testing-library/react": "^11.2.5", "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react": "^11.2.5", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32",