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/.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/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/.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/.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/.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/.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/.changeset/green-lies-hammer.md b/.changeset/green-lies-hammer.md new file mode 100644 index 0000000000..af1c2e6e92 --- /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 +--- + +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/.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` 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/.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/.changeset/poor-jars-sniff.md b/.changeset/poor-jars-sniff.md new file mode 100644 index 0000000000..b2be713a93 --- /dev/null +++ b/.changeset/poor-jars-sniff.md @@ -0,0 +1,15 @@ +--- +'@backstage/core-components': patch +'@backstage/create-app': 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/.changeset/spotty-pandas-deny.md b/.changeset/spotty-pandas-deny.md new file mode 100644 index 0000000000..c3da6afe2b --- /dev/null +++ b/.changeset/spotty-pandas-deny.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +- 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. 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. 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/.changeset/wicked-emus-deny.md b/.changeset/wicked-emus-deny.md new file mode 100644 index 0000000000..ff6788dbb2 --- /dev/null +++ b/.changeset/wicked-emus-deny.md @@ -0,0 +1,8 @@ +--- +'@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. + +See https://github.com/backstage/software-templates 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. 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/features/software-catalog/catalog-customization.md b/docs/features/software-catalog/catalog-customization.md index e0228bf7d0..0c11d8f476 100644 --- a/docs/features/software-catalog/catalog-customization.md +++ b/docs/features/software-catalog/catalog-customization.md @@ -27,27 +27,33 @@ 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 ( - + All your software catalog entities -
- -
+ + +
- -
-
+ + + + + +
-
+ ); }; ``` @@ -137,19 +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/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) diff --git a/docs/overview/roadmap.md b/docs/overview/roadmap.md index 0013c99c6b..fa34ca3d9a 100644 --- a/docs/overview/roadmap.md +++ b/docs/overview/roadmap.md @@ -1,116 +1,185 @@ --- 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. - -## Detailed roadmap - -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). - -Want to help out? Awesome ❤️ Head over to +You can also head over to the [CONTRIBUTING](https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md) guidelines to get started. -### Ongoing work 🚧 +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. -- **[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. +### How to read the roadmap -- **[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. +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. -- **[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. +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. -- **[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. +### Roadmap evolution -### Future work 🔮 +Will this roadmap change? Obviously! -- **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. +Roadmap are always evolving and ours is no different; you can expect to see this +updated roughly every month. -- **[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. +## What’s next -- **Inter-Plugin Communication** - **[Under consideration]** Establish more - clearly defined patterns for plugins to communicate. +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. -- **Improved Access Control** - **[Under consideration]** Provide finer grained - access controls and management for better control of the platform user - experience. +### Backstage Core -### Plugins +The following features are planned for release: -Building and maintaining [plugins](https://backstage.io/plugins) is the work of -the entire Backstage community. +- **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. -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 Templates -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 🧑‍🤝‍🧑 +- **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. -- [**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. +### Software Catalog -- **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 ✅ +- **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 + +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. + +### 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](#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 + 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) diff --git a/docs/plugins/structure-of-a-plugin.md b/docs/plugins/structure-of-a-plugin.md index beffcdb313..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 three 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 these three 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 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 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..0f7ddb9c60 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.npmjs.org/@spotify/prettier-config/-/prettier-config-11.0.0.tgz#d91e0546a8c1c0f7299e2edc7e44306e9be210f6" + integrity sha512-dOI13j1uHMZkRxhZuge/ugOE7Aqcg7Nxki932lDZuXyY4G8CGxkc/66PeQ8pR4PCzThHORXo7Ptvau6bh101lQ== "@types/cheerio@^0.22.8": version "0.22.23" diff --git a/packages/app/package.json b/packages/app/package.json index d86e0f27e9..9d18064717 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.6", + "@roadiehq/backstage-plugin-github-insights": "^1.1.20", + "@roadiehq/backstage-plugin-github-pull-requests": "^1.0.10", + "@roadiehq/backstage-plugin-travis-ci": "^1.0.8", "history": "^5.0.0", "prop-types": "^15.7.2", "react": "^16.12.0", diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index 16107a6cc0..4e2e32cc86 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -135,6 +135,13 @@ const EntityLayoutWrapper = (props: { children?: ReactNode }) => { ); }; +/** + * 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. + */ + export const cicdContent = ( @@ -292,10 +299,10 @@ const serviceEntityPage = ( - + - + @@ -303,10 +310,10 @@ const serviceEntityPage = ( - + - + @@ -431,15 +438,17 @@ const apiPage = ( - + - - - - - - + + + + + + + + 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; 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/packages/cli/package.json b/packages/cli/package.json index 81d7316dfb..c539b1a382 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -53,8 +53,8 @@ "@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/parser": "^v4.27.0", + "@typescript-eslint/eslint-plugin": "^v4.28.3", + "@typescript-eslint/parser": "^v4.28.3", "@yarnpkg/lockfile": "^1.1.0", "babel-plugin-dynamic-import-node": "^2.3.3", "bfj": "^7.0.2", @@ -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/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, }, ] diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index e915e004ee..ccafa4cfa7 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 "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) +export const PageWithHeader: ({ + themeId, + children, + ...props +}: 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/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/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/packages/core-components/src/components/SupportButton/SupportButton.tsx b/packages/core-components/src/components/SupportButton/SupportButton.tsx index 2ffef89878..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 1e2ad0b5d4..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'; @@ -57,15 +57,15 @@ const useStyles = (props: ContentHeaderProps) => }, })); -type DefaultTitleProps = { +type ContentHeaderTitleProps = { title?: string; - className: string; + className?: string; }; -const DefaultTitle = ({ +const ContentHeaderTitle = ({ title = 'Unknown page', className, -}: DefaultTitleProps) => ( +}: ContentHeaderTitleProps) => ( ) : ( - + ); return ( - + <>
@@ -111,6 +111,6 @@ export const ContentHeader = ({
{children}
-
+ ); }; diff --git a/packages/core-components/src/layout/Header/Header.tsx b/packages/core-components/src/layout/Header/Header.tsx index 96d024f524..227c6d1a60 100644 --- a/packages/core-components/src/layout/Header/Header.tsx +++ b/packages/core-components/src/layout/Header/Header.tsx @@ -16,17 +16,20 @@ import { useApi, configApiRef } from '@backstage/core-plugin-api'; import { BackstageTheme } from '@backstage/theme'; -import { makeStyles, Tooltip, Typography } 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'; import { Breadcrumbs } from '../Breadcrumbs'; +const minHeaderHeight = 118; + const useStyles = makeStyles(theme => ({ header: { gridArea: 'pageHeader', padding: theme.spacing(3), - minHeight: 118, + height: 'fit-content', + minHeight: minHeaderHeight, width: '100%', boxShadow: '0 0 8px 3px rgba(20, 20, 20, 0.3)', position: 'relative', @@ -34,26 +37,21 @@ const useStyles = makeStyles(theme => ({ display: 'flex', flexDirection: 'row', flexWrap: 'wrap', - justifyContent: 'flex-end', alignItems: 'center', backgroundImage: theme.page.backgroundImage, backgroundPosition: 'center', backgroundSize: 'cover', }, leftItemsBox: { - flex: '1 1 auto', + maxWidth: '100%', + flexGrow: 1, + marginBottom: theme.spacing(1), }, rightItemsBox: { - flex: '0 1 auto', - display: 'flex', - flexDirection: 'row', - flexWrap: 'wrap', - alignItems: 'center', - marginRight: theme.spacing(1), + width: 'auto', }, title: { color: theme.palette.bursts.fontColor, - lineHeight: '1.0em', wordBreak: 'break-all', fontSize: 'calc(24px + 6 * ((100vw - 320px) / 680))', marginBottom: theme.spacing(1), @@ -199,7 +197,7 @@ export const Header = ({ <>
-
+ -
-
{children}
+ + + {children} +
); diff --git a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx index 1534656f24..8557ceddf7 100644 --- a/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx +++ b/packages/core-components/src/layout/HeaderLabel/HeaderLabel.tsx @@ -14,29 +14,25 @@ * 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: { - color: '#FFFFFF', + color: theme.palette.common.white, fontWeight: 'bold', - lineHeight: '16px', letterSpacing: 0, - fontSize: 14, - height: '16px', - marginBottom: 2, + fontSize: theme.typography.fontSize, + marginBottom: theme.spacing(1) / 2, + lineHeight: 1, }, value: { color: 'rgba(255, 255, 255, 0.8)', - lineHeight: '16px', - fontSize: 14, - height: '16px', + fontSize: theme.typography.fontSize, + lineHeight: 1, }, })); @@ -64,9 +60,11 @@ export const HeaderLabel = ({ label, value, url }: HeaderLabelProps) => { /> ); return ( - - {label} - {url ? {content} : content} - + + + {label} + {url ? {content} : content} + + ); }; diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx b/packages/core-components/src/layout/Page/PageWithHeader.tsx similarity index 50% rename from plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx rename to packages/core-components/src/layout/Page/PageWithHeader.tsx index 5638c23634..70a6c1f693 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerLayout.tsx +++ b/packages/core-components/src/layout/Page/PageWithHeader.tsx @@ -14,27 +14,22 @@ * limitations under the License. */ -import React from 'react'; +import React, { PropsWithChildren, ComponentProps } from 'react'; -import { Header, Page } from '@backstage/core-components'; -import { useApi, configApiRef } from '@backstage/core-plugin-api'; +import { Header } from '../Header'; +import { Page } from './Page'; -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} - - ); +type PageWithHeaderProps = ComponentProps & { + themeId: string; }; + +export const PageWithHeader = ({ + themeId, + children, + ...props +}: PropsWithChildren) => ( + +
+ {children} + +); 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/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/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..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 @@ -157,6 +157,13 @@ const websiteEntityPage = ( ); +/** + * 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 = ( 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'; 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> = {}; 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.`, 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`, ); } 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) // diff --git a/packages/test-utils/src/testUtils/mockBreakpoint.ts b/packages/test-utils/src/testUtils/mockBreakpoint.ts index 37f0e761b6..3335284f88 100644 --- a/packages/test-utils/src/testUtils/mockBreakpoint.ts +++ b/packages/test-utils/src/testUtils/mockBreakpoint.ts @@ -14,80 +14,30 @@ * limitations under the License. */ -import { act } from '@testing-library/react'; - -type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | '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; - -function toBreakpoint(query: string) { - const breakpoint = queryToBreakpoint[query]; - if (!breakpoint) { - throw new Error( - `received unknown media query in breakpoint mock: '${query}'`, - ); - } - return breakpoint; -} - -type Listener = (event: { matches: boolean }) => void; - -interface QueryList { - addListener(listener: Listener): void; - removeListener(listener: Listener): void; - matches: boolean; -} - -interface Query { - query: string; - queryList: QueryList; - listeners: Set; -} - -export default function mockBreakpoint(initialBreakpoint: Breakpoint = 'xl') { - let currentBreakpoint = initialBreakpoint; - const queries = Array(); - - const previousMatchMedia: any = (window as any).matchMedia; - - (window as any).matchMedia = (query: string): QueryList => { - const listeners = new Set(); - - const queryList: QueryList = { - addListener(listener) { - listeners.add(listener); - }, - removeListener(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; - }, - }; +/** + * 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. + * + * 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 + */ +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/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 = ( - + - - - - - - + + + + + + + + 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/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx index 9a8b725ffc..361ce7b55b 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx @@ -14,6 +14,21 @@ * limitations under the License. */ +import { + Content, + ContentHeader, + PageWithHeader, + SupportButton, + TableColumn, +} from '@backstage/core-components'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; +import { + CatalogTable, + CatalogTableRow, + FilteredEntityLayout, + EntityListContainer, + FilterContainer, +} from '@backstage/plugin-catalog'; import { EntityKindPicker, EntityLifecyclePicker, @@ -24,29 +39,10 @@ import { UserListFilterKind, UserListPicker, } from '@backstage/plugin-catalog-react'; -import { CatalogTable, CatalogTableRow } from '@backstage/plugin-catalog'; -import { Button, makeStyles } from '@material-ui/core'; +import { Button } 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,7 +54,7 @@ const defaultColumns: TableColumn[] = [ CatalogTable.columns.createTagsColumn(), ]; -export type ApiExplorerPageProps = { +type ApiExplorerPageProps = { initiallySelectedFilter?: UserListFilterKind; columns?: TableColumn[]; }; @@ -67,11 +63,19 @@ 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 && ( @@ -86,20 +90,22 @@ export const ApiExplorerPage = ({ )} All your APIs -
- -
+ + +
- -
-
+ + + + + +
-
+ ); }; 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 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{' '} + +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'; @@ -30,7 +39,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,7 +50,54 @@ export const AboutField: ({ value, gridSizes, children, -}: Props_3) => JSX.Element; +}: Props_2) => 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) // @@ -53,17 +109,11 @@ export const CatalogEntityPage: () => JSX.Element; // // @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) @@ -249,6 +299,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 @@ -287,6 +344,20 @@ 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, +}: 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) +// +// @public (undocumented) +export const FilteredEntityLayout: ({ + children, +}: 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) 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/components/CatalogPage/CatalogLayout.tsx b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx deleted file mode 100644 index 2471ac9df2..0000000000 --- a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx +++ /dev/null @@ -1,42 +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 { configApiRef, useApi } from '@backstage/core-plugin-api'; -import { Header, Page } from '@backstage/core-components'; - -type Props = { - children?: React.ReactNode; -}; - -export const CatalogLayout = ({ children }: Props) => { - const orgName = - useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; - - return ( - -
- {children} - - ); -}; - -export default CatalogLayout; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index 584eea0850..e09aec55e7 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'; @@ -244,4 +245,13 @@ describe('CatalogPage', () => { screen.findByText(/Starred \(1\)/), ).resolves.toBeInTheDocument(); }); + + it('should wrap filter in drawer on smaller screens', async () => { + mockBreakpoint({ matches: true }); + const { getByRole } = await renderWrapped(); + const button = getByRole('button', { name: 'Filters' }); + expect(getByRole('presentation', { hidden: true })).toBeInTheDocument(); + fireEvent.click(button); + expect(getByRole('presentation')).toBeVisible(); + }); }); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index 089e61f0fb..963e04e5e2 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -14,8 +14,15 @@ * limitations under the License. */ -import React from 'react'; -import { Grid } from '@material-ui/core'; +import { + Content, + ContentHeader, + PageWithHeader, + SupportButton, + TableColumn, + TableProps, +} from '@backstage/core-components'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { EntityKindPicker, EntityLifecyclePicker, @@ -26,18 +33,15 @@ import { UserListFilterKind, UserListPicker, } from '@backstage/plugin-catalog-react'; +import React from 'react'; import { CatalogTable } from '../CatalogTable'; - import { EntityRow } from '../CatalogTable/types'; -import CatalogLayout from './CatalogLayout'; import { CreateComponentButton } from '../CreateComponentButton'; import { - Content, - ContentHeader, - SupportButton, - TableColumn, - TableProps, -} from '@backstage/core-components'; + FilteredEntityLayout, + EntityListContainer, + FilterContainer, +} from '../FilteredEntityLayout'; export type CatalogPageProps = { initiallySelectedFilter?: UserListFilterKind; @@ -46,39 +50,36 @@ export type CatalogPageProps = { }; export const CatalogPage = ({ - initiallySelectedFilter = 'owned', columns, actions, -}: CatalogPageProps) => ( - - - - - All your software catalog entities - - + initiallySelectedFilter = 'owned', +}: CatalogPageProps) => { + const orgName = + useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; + + return ( + + + + + All your software catalog entities + - - - - - - - - - - - - - - - - - + + + + + + + - - - -); + + + ); +}; 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 index 482a0c0a3c..ae2fc4b718 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/CreateComponentButton/index.ts b/plugins/catalog/src/components/CreateComponentButton/index.ts index e525bef782..edf59d18a6 100644 --- a/plugins/catalog/src/components/CreateComponentButton/index.ts +++ b/plugins/catalog/src/components/CreateComponentButton/index.ts @@ -13,4 +13,5 @@ * 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/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, diff --git a/plugins/catalog/src/components/FilteredEntityLayout/EntityListContainer.tsx b/plugins/catalog/src/components/FilteredEntityLayout/EntityListContainer.tsx new file mode 100644 index 0000000000..a39ef76b87 --- /dev/null +++ b/plugins/catalog/src/components/FilteredEntityLayout/EntityListContainer.tsx @@ -0,0 +1,24 @@ +/* + * 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 { Grid } from '@material-ui/core'; +import React, { PropsWithChildren } from 'react'; + +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..683dbf8b40 --- /dev/null +++ b/plugins/catalog/src/components/FilteredEntityLayout/FilterContainer.tsx @@ -0,0 +1,71 @@ +/* + * 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, + Typography, + useMediaQuery, + useTheme, +} from '@material-ui/core'; +import FilterListIcon from '@material-ui/icons/FilterList'; +import React, { useState, PropsWithChildren } from 'react'; + +export const FilterContainer = ({ children }: PropsWithChildren<{}>) => { + const isMidSizeScreen = useMediaQuery(theme => + theme.breakpoints.down('md'), + ); + const theme = useTheme(); + const [filterDrawerOpen, setFilterDrawerOpen] = useState(false); + + return isMidSizeScreen ? ( + <> + + setFilterDrawerOpen(false)} + anchor="left" + disableAutoFocus + keepMounted + variant="temporary" + > + + + Filters + + {children} + + + + ) : ( + + {children} + + ); +}; diff --git a/plugins/catalog/src/components/FilteredEntityLayout/FilteredEntityLayout.tsx b/plugins/catalog/src/components/FilteredEntityLayout/FilteredEntityLayout.tsx new file mode 100644 index 0000000000..628ad9fee6 --- /dev/null +++ b/plugins/catalog/src/components/FilteredEntityLayout/FilteredEntityLayout.tsx @@ -0,0 +1,24 @@ +/* + * 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 { Grid } from '@material-ui/core'; +import React, { PropsWithChildren } from 'react'; + +export const FilteredEntityLayout = ({ children }: PropsWithChildren<{}>) => ( + + {children} + +); diff --git a/plugins/catalog/src/components/FilteredEntityLayout/index.ts b/plugins/catalog/src/components/FilteredEntityLayout/index.ts new file mode 100644 index 0000000000..ded61a4edc --- /dev/null +++ b/plugins/catalog/src/components/FilteredEntityLayout/index.ts @@ -0,0 +1,19 @@ +/* + * 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 { FilteredEntityLayout } from './FilteredEntityLayout'; +export { FilterContainer } from './FilterContainer'; +export { EntityListContainer } from './EntityListContainer'; diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index f2f28679a5..215a18f661 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -14,16 +14,18 @@ * limitations under the License. */ +export { CatalogClientWrapper } from './CatalogClientWrapper'; export * from './components/AboutCard'; -export { CatalogLayout } from './components/CatalogPage'; -export { CatalogResultListItem } from './components/CatalogResultListItem'; +export * 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/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, @@ -31,8 +33,8 @@ export { catalogPlugin, catalogPlugin as plugin, EntityAboutCard, - EntityDependsOnComponentsCard, EntityDependencyOfComponentsCard, + EntityDependsOnComponentsCard, EntityDependsOnResourcesCard, EntityHasComponentsCard, EntityHasResourcesCard, @@ -41,4 +43,3 @@ export { EntityLinksCard, EntitySystemDiagramCard, } from './plugin'; -export * from './components/CatalogTable/columns'; 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/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/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", 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; 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", diff --git a/plugins/scaffolder-backend-module-cookiecutter/.eslintrc.js b/plugins/scaffolder-backend-module-cookiecutter/.eslintrc.js new file mode 100644 index 0000000000..16a033dbc6 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint.backend')], +}; diff --git a/plugins/scaffolder-backend-module-cookiecutter/README.md b/plugins/scaffolder-backend-module-cookiecutter/README.md new file mode 100644 index 0000000000..77ae93c5f3 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/README.md @@ -0,0 +1,162 @@ +# scaffolder-backend-module-cookiecutter + +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 +// packages/backend/src/plugins/scaffolder.ts + +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 +``` 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..8e46667fce --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/api-report.md @@ -0,0 +1,23 @@ +## 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'; + +// 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; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json new file mode 100644 index 0000000000..f321d6b45c --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -0,0 +1,45 @@ +{ + "name": "@backstage/plugin-scaffolder-backend-module-cookiecutter", + "version": "0.1.0", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "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.6", + "@backstage/errors": "^0.1.1", + "@backstage/integration": "^0.5.7", + "@backstage/plugin-scaffolder-backend": "^0.14.0", + "@backstage/config": "^0.1.5", + "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/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": [ + "dist" + ] +} diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.test.ts similarity index 96% rename from plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.test.ts index 86f953a6a5..bc3fe3eca2 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.test.ts +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.test.ts @@ -17,9 +17,12 @@ const runCommand = jest.fn(); const commandExists = jest.fn(); const fetchContents = jest.fn(); -jest.mock('./helpers', () => ({ fetchContents })); +jest.mock('@backstage/plugin-scaffolder-backend', () => ({ + ...jest.requireActual('@backstage/plugin-scaffolder-backend'), + fetchContents, + runCommand, +})); jest.mock('command-exists', () => commandExists); -jest.mock('../helpers', () => ({ runCommand })); import { getVoidLogger, @@ -33,7 +36,7 @@ import os from 'os'; import { PassThrough } from 'stream'; import { createFetchCookiecutterAction } from './cookiecutter'; import { join } from 'path'; -import { ActionContext } from '../../types'; +import type { ActionContext } from '@backstage/plugin-scaffolder-backend'; describe('fetch:cookiecutter', () => { const integrations = ScmIntegrations.fromConfig( diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.ts similarity index 94% rename from plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.ts rename to plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.ts index 048b2bba64..1f6fbdb7d8 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/cookiecutter.ts +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/cookiecutter.ts @@ -26,9 +26,11 @@ 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'; +import { + runCommand, + createTemplateAction, + fetchContents, +} from '@backstage/plugin-scaffolder-backend'; export class CookiecutterRunner { private readonly containerRunner: ContainerRunner; @@ -136,7 +138,7 @@ export function createFetchCookiecutterAction(options: { }>({ 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.", + 'Downloads a template from the given URL into the workspace, and runs cookiecutter on it.', schema: { input: { type: 'object', diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/index.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/index.ts new file mode 100644 index 0000000000..bbe5a16a04 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/fetch/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 './cookiecutter'; diff --git a/plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts b/plugins/scaffolder-backend-module-cookiecutter/src/actions/index.ts new file mode 100644 index 0000000000..1b47db9e03 --- /dev/null +++ b/plugins/scaffolder-backend-module-cookiecutter/src/actions/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 * from './fetch'; 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..4f06b14a86 --- /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 * from './actions'; 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) // 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/sample-templates/all-templates.yaml b/plugins/scaffolder-backend/sample-templates/all-templates.yaml index a5bcd864b1..2d5adb8e3b 100644 --- a/plugins/scaffolder-backend/sample-templates/all-templates.yaml +++ b/plugins/scaffolder-backend/sample-templates/all-templates.yaml @@ -5,5 +5,10 @@ metadata: description: A collection of all Backstage example templates spec: targets: - - ./local-templates.yaml - ./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 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..81787b4297 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/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 diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts index 6541625035..ae5a7d0697 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/createBuiltinActions.ts @@ -24,11 +24,8 @@ import { } from './catalog'; import { createDebugLogAction } from './debug'; -import { - createFetchCookiecutterAction, - createFetchPlainAction, - createFetchTemplateAction, -} from './fetch'; +import { 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/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'; 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/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/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(); } } diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index d63ddf8125..3cecf4babe 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,20 @@ type Props = { onReady?: () => void; }; +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', + }, +})); + export const Reader = ({ entityId, onReady }: Props) => { const { kind, namespace, name } = entityId; const { '*': path } = useParams(); const theme = useTheme(); + const classes = useStyles(); const { state, @@ -369,6 +384,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 +397,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} 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; +}; diff --git a/yarn.lock b/yarn.lock index bc34978977..9431895914 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" @@ -1348,19 +1348,6 @@ "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" -"@backstage/catalog-model@^0.8.4": - 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/core-api@^0.2.23": version "0.2.23" resolved "https://registry.npmjs.org/@backstage/core-api/-/core-api-0.2.23.tgz#c0ec13407ff7c78d376eb18e9d8e1490d54d995b" @@ -1425,27 +1412,6 @@ remark-gfm "^1.0.0" zen-observable "^0.8.15" -"@backstage/plugin-catalog-react@^0.2.0", "@backstage/plugin-catalog-react@^0.2.4": - 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" @@ -2438,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" @@ -4030,16 +4010,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.6": + version "1.0.6" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-buildkite/-/backstage-plugin-buildkite-1.0.6.tgz#f0ca863d206437d8b14e059a0d04fa37553de5f7" + integrity sha512-poC1yaDnH2Gteim8U3SdvVT1jkk2MtMv7YlCq0QwK08RTKUc5PFO6MaDaz95cJ+lndSjYWYn/yii8UmuqrJMUw== 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 +4033,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.20": + version "1.1.20" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-insights/-/backstage-plugin-github-insights-1.1.20.tgz#5e58124b4da2a60c0d4e6563cd94cdd7702fa341" + integrity sha512-bhYe9o1MpIGxSqXa2HK1E8P/uzTL7zJvUleLTp9C5q4CmPCroNTE/Ce8Apzlrb9o9baSQEhQLoPqe0xs+chS7A== 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 +4056,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.10": + version "1.0.10" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-1.0.10.tgz#8c921393d25a4d498c196fcab7d6138c5e2998ba" + integrity sha512-8mIhWpxIDZBUrfK72+Pc6g8e/nNo+IA0wbDqWbGO53gw8J2dWSFIU06IRpatN672pzkqrrfzt1qhQujzQslRkg== 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 +4079,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.8": + version "1.0.8" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-travis-ci/-/backstage-plugin-travis-ci-1.0.8.tgz#33c51ed676191190ba3e2d00e5e9f75b6612b767" + integrity sha512-9iLUnjpF4aCyaD1+0B8OBI3k0nSAzWWqnOSM/4NUwoFDuqhKLlMeN+/HM9L38pp6x1wcwks8sMZh8GufFYl2nw== 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" @@ -4306,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" @@ -4343,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" @@ -4388,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== @@ -4403,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" @@ -4505,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" @@ -4531,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" @@ -4567,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" @@ -4615,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" @@ -4647,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" @@ -4733,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" @@ -4761,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" @@ -4913,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" @@ -4969,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" @@ -4993,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" @@ -5065,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" @@ -5278,9 +5263,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" @@ -5288,6 +5273,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" @@ -5579,6 +5565,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 +5587,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" @@ -6239,7 +6230,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== @@ -6733,74 +6724,73 @@ 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" -"@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== +"@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.27.0" - "@typescript-eslint/visitor-keys" "4.27.0" + "@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== +"@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.27.0" - "@typescript-eslint/visitor-keys" "4.27.0" + "@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" - integrity sha512-es0GRYNZp0ieckZ938cEANfEhsfHrzuLrePukLKtY3/KPXcq1Xd555Mno9/GOgXhKzn0QfkDLVgqWO3dGY80bg== +"@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.27.0" + "@typescript-eslint/types" "4.28.3" eslint-visitor-keys "^2.0.0" "@webassemblyjs/ast@1.9.0": @@ -11352,10 +11342,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" @@ -11737,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" @@ -12149,13 +12139,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" @@ -14754,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" @@ -15698,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" @@ -16281,9 +16272,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" @@ -16814,9 +16805,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" @@ -18908,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" @@ -25987,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" @@ -25999,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"