diff --git a/.changeset/quiet-carpets-shake.md b/.changeset/quiet-carpets-shake.md new file mode 100644 index 0000000000..a0744651e3 --- /dev/null +++ b/.changeset/quiet-carpets-shake.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-kubernetes': patch +'@backstage/plugin-pagerduty': patch +'@backstage/plugin-splunk-on-call': patch +--- + +Clean up emptystate.svg image, removing wrong white artifact from the background diff --git a/.changeset/tender-cars-look.md b/.changeset/tender-cars-look.md new file mode 100644 index 0000000000..f20ba447d4 --- /dev/null +++ b/.changeset/tender-cars-look.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-test-utils': patch +--- + +Bump `testcontainers` dependency to version `8.1.2` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7222edef08..109f90eff6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,9 @@ jobs: - name: check api reports and generate API reference run: yarn build:api-reports:only --ci --docs + - name: verify changesets + run: node scripts/verify-changesets.js + - name: verify doc links run: node scripts/verify-links.js diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5cbf4e32ef..f0bfe17326 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -17,7 +17,7 @@ jobs: for your contributions. days-before-issue-stale: 60 days-before-issue-close: 7 - exempt-issue-labels: 'pinned,security,plugin,help wanted,good first issue,rfc' + exempt-issue-labels: 'pinned,security,plugin,help wanted,good first issue,rfc,will-fix' stale-issue-label: stale stale-pr-message: > This PR has been automatically marked as stale because it has not had @@ -25,6 +25,6 @@ jobs: If you are the author and the PR has been closed, feel free to re-open the PR and continue the contribution! days-before-pr-stale: 7 days-before-pr-close: 5 - exempt-pr-labels: reviewer-approved,awaiting-review + exempt-pr-labels: reviewer-approved,awaiting-review,will-fix stale-pr-label: stale operations-per-run: 100 diff --git a/README.md b/README.md index 3e91cfe7c3..1078631926 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,6 @@ # [Backstage](https://backstage.io) -> 🎄 The maintainers will be taking a break over the holidays from week beginning 20th Dec. The Repository and Discord may be quieter than usual. We will be back next year, rested and restored, on Jan. 3. 🎄 - -> 🎅 Happy holidays and a Happy New Year to all, and especially those that have made this year special for Backstage! 🎅 - [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![CNCF Status](https://img.shields.io/badge/cncf%20status-sandbox-blue.svg)](https://www.cncf.io/projects) [![Main CI Build](https://github.com/backstage/backstage/workflows/Main%20Master%20Build/badge.svg)](https://github.com/backstage/backstage/actions?query=workflow%3A%22Main+Master+Build%22) diff --git a/contrib/docs/tutorials/authenticate-api-requests.md b/contrib/docs/tutorials/authenticate-api-requests.md index 9f651ddd1a..803a6babc7 100644 --- a/contrib/docs/tutorials/authenticate-api-requests.md +++ b/contrib/docs/tutorials/authenticate-api-requests.md @@ -129,8 +129,12 @@ function msUntilExpiry(token: string): number { // Calls the specified url regularly using an auth token to set a token cookie // to authorize regular HTTP requests when loading techdocs -async function setTokenCookie(url: string, getIdToken: () => Promise) { - const token = await getIdToken(); +async function setTokenCookie(url: string, identityApi: IdentityApi) { + const { token } = await identityApi.getCredentials(); + if (!token) { + return; + } + await fetch(url, { mode: 'cors', credentials: 'include', @@ -138,11 +142,12 @@ async function setTokenCookie(url: string, getIdToken: () => Promise) { Authorization: `Bearer ${token}`, }, }); + // Call this function again a few minutes before the token expires const ms = msUntilExpiry(token) - 4 * 60 * 1000; setTimeout( () => { - setTokenCookie(url, getIdToken); + setTokenCookie(url, identityApi); }, ms > 0 ? ms : 10000, ); @@ -160,16 +165,13 @@ const app = createApp({ providers={['guest', 'custom', ...providers]} title="Select a sign-in method" align="center" - onResult={async result => { - // When logged in, set a token cookie - if (typeof result.getIdToken !== 'undefined') { - setTokenCookie( - await discoveryApi.getBaseUrl('cookie'), - result.getIdToken, - ); - } - // Forward results - props.onResult(result); + onSignInSuccess={async (identityApi: IdentityApi) => { + setTokenCookie( + await discoveryApi.getBaseUrl('cookie'), + identityApi, + ); + + props.onSignInSuccess(identityApi); }} /> ); diff --git a/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md b/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md index 086175a0ce..f45b70cdb1 100644 --- a/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md +++ b/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md @@ -4,7 +4,7 @@ ExampleFetchComponent.tsx reference ```tsx import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import Alert from '@material-ui/lab/Alert'; import { githubAuthApiRef, useApi } from '@backstage/core-plugin-api'; import { Table, TableColumn, Progress } from '@backstage/core-components'; diff --git a/docs/architecture-decisions/adr011-plugin-package-structure.md b/docs/architecture-decisions/adr011-plugin-package-structure.md index 363cae01a5..2def903dfc 100644 --- a/docs/architecture-decisions/adr011-plugin-package-structure.md +++ b/docs/architecture-decisions/adr011-plugin-package-structure.md @@ -35,9 +35,11 @@ We follow this structure for plugin packages (where `x` is the plugin name, for example `catalog` or `techdocs`): - `x`: Contains the main frontend code of the plugin. +- `x-module-`: Contains optional modules related to the frontend plugin + package. - `x-backend`: Contains the main backend code of the plugin. - `x-backend-module-`: Contains optional modules related to the backend - plugin. + plugin package. - `x-react`: Contains shared widgets, hooks and similar that both the plugin itself (`x`) and third-party frontend plugins can depend on. - `x-node`: Contains utilities for backends that both the plugin backend itself diff --git a/docs/assets/architecture-overview/package-architecture.drawio b/docs/assets/architecture-overview/package-architecture.drawio new file mode 100644 index 0000000000..c320c94c69 --- /dev/null +++ b/docs/assets/architecture-overview/package-architecture.drawio @@ -0,0 +1 @@ +7V3bktq4Fv0aHknhCwYe06Q7kzmdOZ2kp2ZyXk4JW4AntkXZopvO149sZLAt+YKvEiFVU4OFcdtaa2svSXtvj7Sle/jog932M7KgM1In1mGkfRipqqLMDfK/sOXt2DIPj8KGjW9b9KRzwzf7J6SNE9q6ty0YpE7ECDnY3qUbTeR50MSpNuD76DV92ho56b+6AxvINHwzgcO2/mVbeEtb1fnk/MVv0N5s6Z82DPrFCpg/Nj7ae/TvjVRtHf07fu2C+Fr0/GALLPSaaNLuR9rSRwgfP7mHJXTCvo277fi7h5xvT/ftQw9X+cHBgb9bB924/+ur+fXpXg2e/sFjZaodr/MCnD2MHyS6XfwWd1H0kDC8zGSk3b1ubQy/7YAZfvtKSEHatth1yJFCPgLH3njkswPX5LbuXqCPbdLb72kzRuH5a9txlshBPmnxkEeudMc+Dn3C8ArwkGiij/cRIhdi/42cEn+7oF1NqTiNOfaaAHZC27YJTBWNNgJKps3p2ucOJR9on17Qvwud6U1oEf7RQ/rs6Q5GPt6iDfKA84jC3oq69R+I8Ru1HrDHKN3p8GDjvxOfv4eXejelRx8O9MrRwVt84JEH/Dt5kPhVeHj+WXQU/26NPBxjRzg/if5FZ1nvQ3skzSsHmT+et7Z3bH6wnfhGAwx8TB9DP36bOMrlQID2vkn7788v8AG9HVYfPj/O0cvy95+fNto4HjmAv4G44DzK9hCDQkb50AHYfkmPEa2zQ4kJmkOPMxPuz63tseXMkO9JgnDZ0iHq5t5/iR5HaZsC1p+H5fjnf9RP31+8P/bgiwV/fh+rhmAcYAfccg6k+qwjQiiFhLj24YPLndlMLO7EXBaCO7Pqo0keeWbXwh4uXDN1KPYU3XZC+YHdrpn420HfJjcH/fAU29vQX2VFoGtbVkTFjFgMjr96jI4+zM8t5EjNyEaCvgXgfG1GwProB0x8Y5hzuFqfvomFfaGDqa4zMzJT1VmZOeeozM5EpqJoAg0DzUcBKQcBtaILmeqCuZB5Iwmq9DdhkQV27nmDCYf/Pn9Z6v9b2IuvfzyZS//ZmE2+xEN//fGiPaFQVWW+U6epUaLCGPEAXNsJG57BFrmAttIbVJQ+KJXBu9uhRR9STaiMmggXyEifyKQo1uu1anIVhWWsjKnRk6LQJ0MrCs4qoGQTi8x4ocioKTThJxZ89miNp6UDr4GqUkrQqnSZikaXmTB0UavypYYckZYvymArpkW3nVAaO2e/sb3xSDWAG+oHJ3T9tJFcKm7e4FN3ySFHLl7g0GKNSx9PLaBeC7JFnZWvhCizfpdCGo8lXQmXX2g5fXbJhEUgP1S8WdunH5rV9ENSylwOXQTzQzl8mQrDl3oyV87tlqp0GU7mFt12Tdky/hVWUwaWL7xll87kS5FDTHDkLoZ98mivfODbMGAoELzargOiSKKkzU0SAJqkl6DPgfoYj9VCZ56CreLOXLCdeYqFSwVfTbvqzSnTmyM9CtsjvUSGBPWB2tTYRK6LvCszLRbTQspVt5o0zhrHZrpaq+Q+gFEVZQwDPN5j22Et6IZ0BaRnQyPNetA8pEHw4wZyLZAVXsxsryjPGZSXdHgW3QUqEz2zHmJU9IEn22q9NxdlNmMCDBy0GZuOHT65REZjTeHc0nlGM1dXmnGB0cwvRTprNByt06/RxFabjzN+23Hs5gavDBJHYUP1slaMvLW9ucErpa6JI8Dz4YW+j/yb9UqqaBROjhXfCbvH9LobzDVgng4NMy+VLg2zTRToxgfYlmuxQRyQh3fFKrvc8OAjgmu0Rvc+DKCfLJEPGXyFmKGUCxv+Ep3SWXeysz1G2fhwDHY78p8tldGU791XNJoT5aTVr2rpLDQE2IJrsHewXDJHHJT7lLE5sRcMcr0ms160I0oOnmKmxG2p/UnO7mX5luflqaz8RTxOZFaRPxVlQ1y9EaA7AvC7fCgCFN52UTGJYAt24UfSU87bnR+u2OPyUT2dcLR27N1vowvqTQRUbEWkaEFHLeYZXcoRUpyhd7robuxd1LC9buLefonIlMLcPoFDU3IimeqM3ANHvqUJI3zEfmXCiBUpWXjbDWOZwuWuvQMzP6KNMsdtix74pBiZCSInbrvvFPY6acji+i85h6OZ+KGVOROPQesoXZRC1FchpUSIuK4bSXaWxYhHR9m5UQ+kGi6LsfC+6zq5a3VutZKSAjLLM7f0xjYOCAL6+VQVMbaNoVwgJ/a3ZxfI0O0U9/SMkBPiIeSeAhP1pHBWIrnT4TaCnrhdWb7f6ki1lwAVawpnPJNbGDMN8DfgCkkmw1ZCjqsXtdZRxfy+k/eVI7+vMBFL3GlrDncaJ/gNWyfrWrkjmBwsvO+EU7k/EAdAwCetT5EIHAkfojybZhauq0Yot5Klk1OCuprORngL/XGe2vYhMOWKXq6zc1zMzAskW5lTV3llsrtz6hXXE4spIF8WV63Aqm44wNPs/XKgYlmPYg54yGJDrwRmQK3En24YwIuT7ZcCxqABJJct+w5Q9bxwJVa64gmTOhvWg0zdhCp9X5kEUszHGhfQGLhucSJOQYbqK81GEMEmZPF9JwSDLLOwqVY+C+Muq7UyC+MXg2cTCC/a7bjG+Vebe/TFFG5x5nba2GhbsnFpwwZ2X8Saq5yyiU8bXqh4r7Rhsz4uos0VzvLEJw03j7Ir1hQKkMLw4nz/niZIauM5tSOd3Kq2QLAtF+gXbKdltp05gcM61/F3ViBCL0xoOymq3nLaipGvTd7Bi1Hp1TLd6JD3yya76dInu+mlyW5yFqISCOPBKzbMSkvLWfDlBrHcVRvYTamEY+x3haElp6hOB/SK3IlAafG+RMmEq1xjqGhPilR13bhQlw6Zkf4xkbtDHumMaxs4q803+qLD4CpJZUfXrEraQleqWb5A1j58LQCtQirwhoC5Y7skb1KtTkzkedDEYBVfYXJJp3BfB89bwGjldfD8aoycQbARwytlPyd5St84X1FinGEsZ+JwvTrnzLiufdxoDFf1dRIOlmpnBsJuQ8kEZYvhPI2h5EZ09Qklp2ilRFC2GJvXGEpeem6vUKoMlMk1YiLaIsmWAZc8K04jmO5K6oo43qnEq50Q5hEmTanU+j3LgO4Q1ErHVaVfCFk99ilALvJ3W9u8gVgJRN7bzfoFsej9IDcEyxHkzYu6QpD7CHIr1RbzEFtQqv05xZwIVgbL5eOnmyFW9IdDW6Kiyz3VqDVrrJH+m1lD4VRZ7hk2uacVtWaIjWEzepzX58DGTiFkgq3WbLC5tc0Hh63CMq7IsPUzSBrCDZIGg5KYbyYNgxofgGs7YcMz2CIX0Fb6ZxRlJGjexElAlKdexVZUmjkR022RIVQb9ddzbo2zDyeRgffkTg3h3Gnjcq83Ay83cKWygVdNrBvAwNvecrxK4ZX14MMLr5kkBt6oAqa0I0N11z8VdmSIVaoAFCupmdmoSri0HKvufcTlmN64rO/Aw9hVM0y9AoYZ7MLSErk7gO2V7dj4jeGfBMvwydS/SQvyhoGDk3am8Eq9dKdvjAo7YXEHP4IVdJ5QYEcvziOmgjBGLgeBY7hbEln6shH3sCEwbN+tQGCb785Dyv+xbwNvw6ktUi1ct5r15++WpbM+FVb+nnbcfIQBffxxGMrZkuxVSmVv/GKRVCjf4mJajMKIEYQT330MEfkcvfBSu/8X \ No newline at end of file diff --git a/docs/assets/architecture-overview/package-architecture.png b/docs/assets/architecture-overview/package-architecture.png new file mode 100644 index 0000000000..dfa48fb13b Binary files /dev/null and b/docs/assets/architecture-overview/package-architecture.png differ diff --git a/docs/features/kubernetes/configuration.md b/docs/features/kubernetes/configuration.md index 32ab830322..492cd86022 100644 --- a/docs/features/kubernetes/configuration.md +++ b/docs/features/kubernetes/configuration.md @@ -39,6 +39,7 @@ kubernetes: region: 'europe-west1' skipTLSVerify: true skipMetricsLookup: true + exposeDashboard: true ``` ### `serviceLocatorMethod` @@ -113,9 +114,13 @@ kubectl -n get secret $(kubectl -n get sa Note: The catalog index page is designed to have a minimal code footprint to > support easy customization, but creating a copy does introduce a possibility @@ -21,23 +20,25 @@ the catalog - you can replace the routing in `App.tsx` to point to your own For example, suppose that I want to allow filtering by a custom annotation added to entities, `company.com/security-tier`. To start, I'll copy the code for the -default catalog page and create a component in a -[new plugin](../../plugins/create-a-plugin.md): +default catalog page and create a component. ```tsx // imports, etc omitted for brevity. for full source see: -// https://github.com/backstage/backstage/blob/master/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +// https://github.com/backstage/backstage/blob/master/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx export const CustomCatalogPage = ({ columns, actions, initiallySelectedFilter = 'owned', }: CatalogPageProps) => { + const createComponentLink = useRouteRef( + catalogPlugin.externalRoutes.createComponent, + ); return ( }> - + All your software catalog entities @@ -167,21 +168,7 @@ export const CustomCatalogPage = ({ }; ``` -This page itself can be exported as a routable extension in the plugin: - -```ts -export const CustomCatalogIndexPage = myPlugin.provide( - createRoutableExtension({ - name: 'CustomCatalogIndexPage', - component: () => - import('./components/CustomCatalogPage').then(m => m.CustomCatalogPage), - mountPoint: catalogRouteRef, - }), -); -``` - -Finally, we can replace the catalog route in the Backstage application with our -new `CustomCatalogIndexPage`. +Finally, we can apply our new `CustomCatalogPage`. ```diff # packages/app/src/App.tsx @@ -189,7 +176,9 @@ const routes = ( - } /> -+ } /> ++ }> ++ ++ ``` The same method can be used to customize the _default_ filters with a different diff --git a/docs/getting-started/keeping-backstage-updated.md b/docs/getting-started/keeping-backstage-updated.md index ffe4f4dcd5..107119aace 100644 --- a/docs/getting-started/keeping-backstage-updated.md +++ b/docs/getting-started/keeping-backstage-updated.md @@ -22,6 +22,13 @@ yarn backstage-cli versions:bump The reason for bumping all `@backstage` packages at once is to maintain the dependencies that they have between each other. +If you are using other plugins you can pass in the `--pattern` option to update +more than just the `@backstage/*` dependencies. + +```bash +yarn backstage-cli versions:bump --pattern '@{backstage,roadiehq}/*' +``` + ## Following create-app template changes The `@backstage/create-app` command creates the initial structure of your diff --git a/docs/integrations/aws-s3/locations.md b/docs/integrations/aws-s3/locations.md index fe1c6050c2..b0c6829e2c 100644 --- a/docs/integrations/aws-s3/locations.md +++ b/docs/integrations/aws-s3/locations.md @@ -20,8 +20,7 @@ To use this integration, add configuration to your `app-config.yaml`: ```yaml integrations: awsS3: - - host: amazonaws.com - accessKeyId: ${AWS_ACCESS_KEY_ID} + - accessKeyId: ${AWS_ACCESS_KEY_ID} secretAccessKey: ${AWS_SECRET_ACCESS_KEY} ``` @@ -35,8 +34,21 @@ instruct the AWS S3 reader to assume a role before accessing S3: ```yaml integrations: awsS3: - - host: amazonaws.com - accessKeyId: ${AWS_ACCESS_KEY_ID} + - accessKeyId: ${AWS_ACCESS_KEY_ID} secretAccessKey: ${AWS_SECRET_ACCESS_KEY} roleArn: 'arn:aws:iam::xxxxxxxxxxxx:role/example-role' ``` + +Configuration allows specifying custom S3 endpoint, along with +[path-style access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html) +to support integration with providers like +[LocalStack](https://github.com/localstack/localstack): + +```yaml +integrations: + awsS3: + - endpoint: 'http://localhost:4566' + s3ForcePathStyle: true + accessKeyId: ${AWS_ACCESS_KEY_ID} + secretAccessKey: ${AWS_SECRET_ACCESS_KEY} +``` diff --git a/docs/local-dev/cli-commands.md b/docs/local-dev/cli-commands.md index 412e3c4598..caec60ed70 100644 --- a/docs/local-dev/cli-commands.md +++ b/docs/local-dev/cli-commands.md @@ -594,6 +594,7 @@ Usage: backstage-cli versions:bump [options] Options: -h, --help display help for command + -p, --pattern Override glob for matching packages to upgrade ``` ## versions:check diff --git a/docs/overview/architecture-overview.md b/docs/overview/architecture-overview.md index 3425b02db9..744316cf11 100644 --- a/docs/overview/architecture-overview.md +++ b/docs/overview/architecture-overview.md @@ -164,12 +164,110 @@ https://circleci.com. ![CircleCI plugin talking to proxy talking to SaaS Circle CI](../assets/architecture-overview/circle-ci-plugin-architecture.png) +## Package Architecture + +Backstage relies heavily on NPM packages, both for distribution of libraries, +and structuring of code within projects. While the way you structure your +Backstage project is up to you, there is a set of established patterns that we +encourage you to follow. These patterns can help set up a sound project +structure as well as provide familiarity between different Backstage projects. + +The following diagram shows an overview of the package architecture of +Backstage. It takes the point of view of an individual plugin and all of the +packages that it may contain, indicated by the thicker border and italic text. +Surrounding the plugin are different package groups which are the different +possible interface points of the plugin. Note that not all library package lists +are complete as packages have been omitted for brevity. + +![Package architecture](../assets/architecture-overview/package-architecture.png) + + + +### Overview + +The arrows in the diagram above indicate a runtime dependency on the code of the +target package. This strict dependency graph only applies to runtime +`dependencies`, and there may be `devDependencies` that break the rules of this +table for the purpose of testing. While there are some arrows that show a +dependency on a collection of frontend, backend and isomorphic packages, those +still have to abide by important compatibility rules shown in the bottom left. + +The `app` and `backend` packages are the entry points of a Backstage project. +The `app` package is the frontend application that brings together a collection +of frontend plugins and customizes them to fit an organization, while the +`backend` package is the backend service that powers the Backstage application. +Worth noting is that there can be more than one instance of each of these +packages within a project. Particularly the `backend` packages can benefit from +being split up into smaller deployment units that each serve their own purpose +with a smaller collection of plugins. + +### Plugin Packages + +A typical plugin consists of up to five packages, two frontend ones, two +backend, and one isomorphic packages. All packages within the plugin must share +a common prefix, typically of the form `@/plugin-`, but +alternatives like `backstage-plugin-` or +`@scope/backstage-plugin-` are also valid. Along with this prefix, +each of the packages have their own unique suffix that denotes their role. In +addition to these five plugin packages it's also possible for to a plugin to +have additional frontend and backend modules that can be installed to enable +optional features. For a full list of suffixes and their roles, see the +[Plugin Package Structure ADR](../architecture-decisions/adr011-plugin-package-structure.md). + +The `-react`, `-common`, and `-node` plugin packages together form the external +library of a plugin. The plugin library enables other plugins to build on top of +and extend a plugin, and likewise allows the plugin to depend on and extend +other plugins. Because of this, it is preferable that plugin library packages +allow duplicate installations of themselves, as you may end up with a mix of +versions being installed as dependencies of various plugins. It is also +forbidden for plugins to directly import non-library packages from other +plugins, all communication between plugins must be handled through libraries and +the application itself. + +### Frontend Packages + +The frontend packages are grouped into two main groups. The first one is +"Frontend App Core", which is the set of packages that are only used by the +`app` package itself. These packages help build up the core structure of the app +as well as provide a foundation for the plugin libraries to rely upon. + +The second group is the rest of the shared packages, further divided into +"Frontend Plugin Core" and "Frontend Libraries". The core packages that are +considered particularly stable and form the core of the frontend framework. +Their most important role is to form the boundary around each plugin and provide +a set of tools that helps you combine a collection of plugins into a running +application. The rest of the frontend packages are more traditional libraries +that serve as building blocks to create plugins. + +### Backend Packages + +The backend library packages do not currently share a similar plugin +architecture as the frontend packages. They are instead simply a collection of +building blocks and patterns that help you build backend services. This is +however likely to change in the future. + +### Common Packages + +The common packages are the packages are effectively depended on by all other +pages. This is a much smaller set of packages but they are also very pervasive. +Because the common packages are isomorphic and must execute both in the frontend +and backend, they are never allowed to depend on any of the frontend of backend +packages. + +The Backstage CLI is in a category of its own and is depended on by virtually +all other packages. It's not a library in itself though, and must always be a +development dependency only. + ## Databases As we have seen, both the `lighthouse-audit-service` and `catalog-backend` require a database to work with. -The Backstage backend and its builtin plugins are based on the +The Backstage backend and its built-in plugins are based on the [Knex](http://knexjs.org/) library, and set up a separate logical database per plugin. This gives great isolation and lets them perform migrations and evolve separate from each other. @@ -184,7 +282,7 @@ yet. ## Cache -The Backstage backend and its builtin plugins are also able to leverage cache +The Backstage backend and its built-in plugins are also able to leverage cache stores as a means of improving performance or reliability. Similar to how databases are supported, plugins receive logically separated cache connections, which are powered by [Keyv](https://github.com/lukechilds/keyv) under the hood. diff --git a/docs/tutorials/quickstart-app-plugin.md b/docs/tutorials/quickstart-app-plugin.md index 938a57198a..d1ca61a11f 100644 --- a/docs/tutorials/quickstart-app-plugin.md +++ b/docs/tutorials/quickstart-app-plugin.md @@ -135,7 +135,7 @@ changes, let's start by wiping this component clean. ```tsx import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import Alert from '@material-ui/lab/Alert'; import { Table, TableColumn, Progress } from '@backstage/core-components'; import { githubAuthApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 5465c6b9e7..c14db343bc 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,49 @@ # example-app +## 0.2.59 + +### Patch Changes + +- Updated dependencies + - @backstage/cli@0.10.5 + - @backstage/plugin-search@0.5.4 + - @backstage/plugin-techdocs@0.12.13 + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/plugin-kubernetes@0.5.3 + - @backstage/core-app-api@0.3.1 + - @backstage/core-components@0.8.3 + - @backstage/plugin-apache-airflow@0.1.2 + - @backstage/plugin-azure-devops@0.1.9 + - @backstage/plugin-badges@0.2.18 + - @backstage/plugin-catalog@0.7.7 + - @backstage/plugin-catalog-graph@0.2.5 + - @backstage/plugin-catalog-import@0.7.8 + - @backstage/plugin-circleci@0.2.33 + - @backstage/plugin-cloudbuild@0.2.31 + - @backstage/plugin-code-coverage@0.1.21 + - @backstage/plugin-cost-insights@0.11.16 + - @backstage/plugin-explore@0.3.24 + - @backstage/plugin-gcp-projects@0.3.12 + - @backstage/plugin-github-actions@0.4.30 + - @backstage/plugin-graphiql@0.2.26 + - @backstage/plugin-home@0.4.9 + - @backstage/plugin-jenkins@0.5.16 + - @backstage/plugin-kafka@0.2.24 + - @backstage/plugin-lighthouse@0.2.33 + - @backstage/plugin-newrelic@0.3.12 + - @backstage/plugin-newrelic-dashboard@0.1.2 + - @backstage/plugin-org@0.3.33 + - @backstage/plugin-pagerduty@0.3.21 + - @backstage/plugin-rollbar@0.3.22 + - @backstage/plugin-scaffolder@0.11.17 + - @backstage/plugin-sentry@0.3.32 + - @backstage/plugin-shortcuts@0.1.18 + - @backstage/plugin-tech-insights@0.1.4 + - @backstage/plugin-tech-radar@0.5.1 + - @backstage/plugin-user-settings@0.3.15 + - @backstage/plugin-api-docs@0.6.21 + ## 0.2.58 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index d5c8297db6..bbfd903484 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,61 +1,61 @@ { "name": "example-app", - "version": "0.2.58", + "version": "0.2.59", "private": true, "bundled": true, "dependencies": { "@backstage/app-defaults": "^0.1.3", "@backstage/catalog-model": "^0.9.8", - "@backstage/cli": "^0.10.3", - "@backstage/core-app-api": "^0.3.0", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/integration-react": "^0.1.16", "@backstage/plugin-airbrake": "^0.0.0", - "@backstage/plugin-api-docs": "^0.6.19", - "@backstage/plugin-azure-devops": "^0.1.8", - "@backstage/plugin-apache-airflow": "^0.1.1", - "@backstage/plugin-badges": "^0.2.17", - "@backstage/plugin-catalog": "^0.7.5", - "@backstage/plugin-catalog-graph": "^0.2.4", - "@backstage/plugin-catalog-import": "^0.7.6", - "@backstage/plugin-catalog-react": "^0.6.8", - "@backstage/plugin-circleci": "^0.2.32", - "@backstage/plugin-cloudbuild": "^0.2.30", - "@backstage/plugin-code-coverage": "^0.1.20", - "@backstage/plugin-cost-insights": "^0.11.14", - "@backstage/plugin-explore": "^0.3.23", - "@backstage/plugin-gcp-projects": "^0.3.11", - "@backstage/plugin-github-actions": "^0.4.28", - "@backstage/plugin-graphiql": "^0.2.25", - "@backstage/plugin-home": "^0.4.8", - "@backstage/plugin-jenkins": "^0.5.15", - "@backstage/plugin-kafka": "^0.2.23", - "@backstage/plugin-kubernetes": "^0.5.2", - "@backstage/plugin-lighthouse": "^0.2.32", - "@backstage/plugin-newrelic": "^0.3.11", - "@backstage/plugin-newrelic-dashboard": "^0.1.1", - "@backstage/plugin-org": "^0.3.32", - "@backstage/plugin-pagerduty": "0.3.20", - "@backstage/plugin-rollbar": "^0.3.21", - "@backstage/plugin-scaffolder": "^0.11.15", - "@backstage/plugin-search": "^0.5.2", - "@backstage/plugin-sentry": "^0.3.31", - "@backstage/plugin-shortcuts": "^0.1.16", - "@backstage/plugin-tech-radar": "^0.5.0", - "@backstage/plugin-techdocs": "^0.12.11", + "@backstage/plugin-api-docs": "^0.6.21", + "@backstage/plugin-azure-devops": "^0.1.9", + "@backstage/plugin-apache-airflow": "^0.1.2", + "@backstage/plugin-badges": "^0.2.18", + "@backstage/plugin-catalog": "^0.7.7", + "@backstage/plugin-catalog-graph": "^0.2.5", + "@backstage/plugin-catalog-import": "^0.7.8", + "@backstage/plugin-catalog-react": "^0.6.10", + "@backstage/plugin-circleci": "^0.2.33", + "@backstage/plugin-cloudbuild": "^0.2.31", + "@backstage/plugin-code-coverage": "^0.1.21", + "@backstage/plugin-cost-insights": "^0.11.16", + "@backstage/plugin-explore": "^0.3.24", + "@backstage/plugin-gcp-projects": "^0.3.12", + "@backstage/plugin-github-actions": "^0.4.30", + "@backstage/plugin-graphiql": "^0.2.26", + "@backstage/plugin-home": "^0.4.9", + "@backstage/plugin-jenkins": "^0.5.16", + "@backstage/plugin-kafka": "^0.2.24", + "@backstage/plugin-kubernetes": "^0.5.3", + "@backstage/plugin-lighthouse": "^0.2.33", + "@backstage/plugin-newrelic": "^0.3.12", + "@backstage/plugin-newrelic-dashboard": "^0.1.2", + "@backstage/plugin-org": "^0.3.33", + "@backstage/plugin-pagerduty": "0.3.21", + "@backstage/plugin-rollbar": "^0.3.22", + "@backstage/plugin-scaffolder": "^0.11.17", + "@backstage/plugin-search": "^0.5.4", + "@backstage/plugin-sentry": "^0.3.32", + "@backstage/plugin-shortcuts": "^0.1.18", + "@backstage/plugin-tech-radar": "^0.5.1", + "@backstage/plugin-techdocs": "^0.12.13", "@backstage/plugin-todo": "^0.1.17", - "@backstage/plugin-user-settings": "^0.3.14", + "@backstage/plugin-user-settings": "^0.3.15", "@backstage/search-common": "^0.2.0", - "@backstage/plugin-tech-insights": "^0.1.2", + "@backstage/plugin-tech-insights": "^0.1.4", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", "@octokit/rest": "^18.5.3", - "@roadiehq/backstage-plugin-github-insights": "^1.2.2", - "@roadiehq/backstage-plugin-github-pull-requests": "^1.0.13", - "@roadiehq/backstage-plugin-travis-ci": "^1.0.11", + "@roadiehq/backstage-plugin-github-insights": "^1.4.2", + "@roadiehq/backstage-plugin-github-pull-requests": "^1.3.2", + "@roadiehq/backstage-plugin-travis-ci": "^1.3.2", "history": "^5.0.0", "prop-types": "^15.7.2", "react": "^16.13.1", diff --git a/packages/backend-common/CHANGELOG.md b/packages/backend-common/CHANGELOG.md index 11c1cf7777..7edcbc7acf 100644 --- a/packages/backend-common/CHANGELOG.md +++ b/packages/backend-common/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/backend-common +## 0.10.2 + +### Patch Changes + +- 21ae56168e: Updated the Git class with the following: + + - Added `depth` and `noCheckout` options to Git clone, using these you can create a bare clone that includes just the git history + - New `log` function which you can use to view the commit history of a git repo + +- eacc582473: Reverted the default CSP configuration to include `'unsafe-eval'` again, which was mistakenly removed in the previous version. + ## 0.10.1 ### Patch Changes diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 061931832d..a62a280dc9 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -234,8 +234,13 @@ export class Git { remote: string; url: string; }): Promise; - // (undocumented) - clone(options: { url: string; dir: string; ref?: string }): Promise; + clone(options: { + url: string; + dir: string; + ref?: string; + depth?: number; + noCheckout?: boolean; + }): Promise; // (undocumented) commit(options: { dir: string; @@ -249,12 +254,10 @@ export class Git { email: string; }; }): Promise; - // (undocumented) currentBranch(options: { dir: string; fullName?: boolean; }): Promise; - // (undocumented) fetch(options: { dir: string; remote?: string }): Promise; // (undocumented) static fromAuth: (options: { @@ -264,7 +267,7 @@ export class Git { }) => Git; // (undocumented) init(options: { dir: string; defaultBranch?: string }): Promise; - // (undocumented) + log(options: { dir: string; ref?: string }): Promise; merge(options: { dir: string; theirs: string; @@ -280,9 +283,7 @@ export class Git { }): Promise; // (undocumented) push(options: { dir: string; remote: string }): Promise; - // (undocumented) readCommit(options: { dir: string; sha: string }): Promise; - // (undocumented) resolveRef(options: { dir: string; ref: string }): Promise; } diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index 3aa368f963..adbb6fed18 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-common", "description": "Common functionality library for Backstage backends", - "version": "0.10.1", + "version": "0.10.2", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -81,7 +81,7 @@ } }, "devDependencies": { - "@backstage/cli": "^0.10.4", + "@backstage/cli": "^0.10.5", "@backstage/test-utils": "^0.2.1", "@types/archiver": "^5.1.0", "@types/compression": "^1.7.0", diff --git a/packages/backend-common/src/scm/git.test.ts b/packages/backend-common/src/scm/git.test.ts index abbafc375d..46aa0804b6 100644 --- a/packages/backend-common/src/scm/git.test.ts +++ b/packages/backend-common/src/scm/git.test.ts @@ -320,4 +320,21 @@ describe('Git', () => { }); }); }); + + describe('log', () => { + it('should call isomorphic-git with the correct arguments', async () => { + const dir = '/some/mock/dir'; + const ref = 'as43bd7'; + + const git = Git.fromAuth({}); + + await git.log({ dir, ref }); + + expect(isomorphic.log).toHaveBeenCalledWith({ + fs, + dir, + ref, + }); + }); + }); }); diff --git a/packages/backend-common/src/scm/git.ts b/packages/backend-common/src/scm/git.ts index 372ecb0260..0446f08767 100644 --- a/packages/backend-common/src/scm/git.ts +++ b/packages/backend-common/src/scm/git.ts @@ -76,12 +76,15 @@ export class Git { return git.commit({ fs, dir, message, author, committer }); } + /** https://isomorphic-git.org/docs/en/clone */ async clone(options: { url: string; dir: string; ref?: string; + depth?: number; + noCheckout?: boolean; }): Promise { - const { url, dir, ref } = options; + const { url, dir, ref, depth, noCheckout } = options; this.config.logger?.info(`Cloning repo {dir=${dir},url=${url}}`); return git.clone({ fs, @@ -90,7 +93,8 @@ export class Git { dir, ref, singleBranch: true, - depth: 1, + depth: depth ?? 1, + noCheckout, onProgress: this.onProgressHandler(), headers: { 'user-agent': 'git/@isomorphic-git', @@ -99,7 +103,7 @@ export class Git { }); } - // https://isomorphic-git.org/docs/en/currentBranch + /** https://isomorphic-git.org/docs/en/currentBranch */ async currentBranch(options: { dir: string; fullName?: boolean; @@ -110,7 +114,7 @@ export class Git { >; } - // https://isomorphic-git.org/docs/en/fetch + /** https://isomorphic-git.org/docs/en/fetch */ async fetch(options: { dir: string; remote?: string }): Promise { const { dir, remote = 'origin' } = options; this.config.logger?.info( @@ -138,7 +142,7 @@ export class Git { }); } - // https://isomorphic-git.org/docs/en/merge + /** https://isomorphic-git.org/docs/en/merge */ async merge(options: { dir: string; theirs: string; @@ -180,7 +184,7 @@ export class Git { }); } - // https://isomorphic-git.org/docs/en/readCommit + /** https://isomorphic-git.org/docs/en/readCommit */ async readCommit(options: { dir: string; sha: string; @@ -189,12 +193,25 @@ export class Git { return git.readCommit({ fs, dir, oid: sha }); } - // https://isomorphic-git.org/docs/en/resolveRef + /** https://isomorphic-git.org/docs/en/resolveRef */ async resolveRef(options: { dir: string; ref: string }): Promise { const { dir, ref } = options; return git.resolveRef({ fs, dir, ref }); } + /** https://isomorphic-git.org/docs/en/log */ + async log(options: { + dir: string; + ref?: string; + }): Promise { + const { dir, ref } = options; + return git.log({ + fs, + dir, + ref: ref ?? 'HEAD', + }); + } + private onAuth = () => ({ username: this.config.username, password: this.config.password, diff --git a/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts b/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts index 5d33206684..d155287b34 100644 --- a/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts +++ b/packages/backend-common/src/service/lib/ServiceBuilderImpl.ts @@ -228,6 +228,10 @@ export function applyCspDirectives( const result: ContentSecurityPolicyOptions['directives'] = helmet.contentSecurityPolicy.getDefaultDirectives(); + // TODO(Rugvip): We currently use non-precompiled AJV for validation in the frontend, which uses eval. + // It should be replaced by any other solution that doesn't require unsafe-eval. + result['script-src'] = ["'self'", "'unsafe-eval'"]; + if (directives) { for (const [key, value] of Object.entries(directives)) { if (value === false) { diff --git a/packages/backend-tasks/CHANGELOG.md b/packages/backend-tasks/CHANGELOG.md index 132718b710..acaa41c131 100644 --- a/packages/backend-tasks/CHANGELOG.md +++ b/packages/backend-tasks/CHANGELOG.md @@ -1,5 +1,18 @@ # @backstage/backend-tasks +## 0.1.2 + +### Patch Changes + +- e188b37024: Updated README to clarify the following: + + - Dashes cannot be used in the `id`, changed to an underscore in the example + - The `timeout` is required, this was also added to the example + - Added a note about tasks not running as expected for local development using persistent database + +- Updated dependencies + - @backstage/backend-common@0.10.2 + ## 0.1.1 ### Patch Changes diff --git a/packages/backend-tasks/README.md b/packages/backend-tasks/README.md index d3c361c02c..fe55f37afd 100644 --- a/packages/backend-tasks/README.md +++ b/packages/backend-tasks/README.md @@ -21,14 +21,19 @@ import { Duration } from 'luxon'; const scheduler = TaskScheduler.fromConfig(rootConfig).forPlugin('my-plugin'); await scheduler.scheduleTask({ - id: 'refresh-things', + id: 'refresh_things', frequency: Duration.fromObject({ minutes: 10 }), + timeout: Duration.fromObject({ minutes: 15 }), fn: async () => { await entityProvider.run(); }, }); ``` +## Local Development + +When working with the `@backstage/backend-tasks` library you may run into your task not running immediately at startup as expected if you are using a persistent database. This is by design - the library respects the previous state and does not run the task sooner than the specified frequency. If you want to get around this, there is a table called `backstage_backend_tasks__tasks` in the applicable plugin's database which will contain a record with the next run date and time. You can delete this record to get things back to what you expect. + ## Documentation - [Backstage Readme](https://github.com/backstage/backstage/blob/master/README.md) diff --git a/packages/backend-tasks/package.json b/packages/backend-tasks/package.json index 463525b697..e7af82ce95 100644 --- a/packages/backend-tasks/package.json +++ b/packages/backend-tasks/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-tasks", "description": "Common distributed task management library for Backstage backends", - "version": "0.1.1", + "version": "0.1.2", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -29,7 +29,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.10.0", + "@backstage/backend-common": "^0.10.2", "@backstage/config": "^0.1.11", "@backstage/errors": "^0.1.4", "@backstage/types": "^0.1.1", @@ -44,7 +44,7 @@ }, "devDependencies": { "@backstage/backend-test-utils": "^0.1.11", - "@backstage/cli": "^0.10.3", + "@backstage/cli": "^0.10.5", "jest": "^26.0.1", "wait-for-expect": "^3.0.2" }, diff --git a/packages/backend-test-utils/package.json b/packages/backend-test-utils/package.json index e52398f0ef..78daeb4efe 100644 --- a/packages/backend-test-utils/package.json +++ b/packages/backend-test-utils/package.json @@ -37,7 +37,7 @@ "mysql2": "^2.2.5", "pg": "^8.3.0", "sqlite3": "^5.0.1", - "testcontainers": "^7.23.0", + "testcontainers": "^8.1.2", "uuid": "^8.0.0" }, "devDependencies": { diff --git a/packages/backend/src/plugins/techInsights.ts b/packages/backend/src/plugins/techInsights.ts index 8ab6342a4f..a05ddc339a 100644 --- a/packages/backend/src/plugins/techInsights.ts +++ b/packages/backend/src/plugins/techInsights.ts @@ -41,11 +41,11 @@ export default async function createPlugin({ discovery, factRetrievers: [ createFactRetrieverRegistration( - '* * * * *', // Example cron, every minute + '1 1 1 * *', // Example cron, At 01:01 on day-of-month 1. entityOwnershipFactRetriever, ), - createFactRetrieverRegistration('* * * * *', entityMetadataFactRetriever), - createFactRetrieverRegistration('* * * * *', techdocsFactRetriever), + createFactRetrieverRegistration('1 1 1 * *', entityMetadataFactRetriever), + createFactRetrieverRegistration('1 1 1 * *', techdocsFactRetriever), ], factCheckerFactory: new JsonRulesEngineFactCheckerFactory({ checks: [ diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 8847545348..b412c1b079 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/cli +## 0.10.5 + +### Patch Changes + +- 37123b4851: Bump `css-loader` from `5.2.6` to `6.5.1` +- 9534391ae4: Add --pattern option to override matching glob patterns for backstage versioning +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. + ## 0.10.4 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 21ba9b00b1..3b9cf52893 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/cli", "description": "CLI for developing Backstage plugins and apps", - "version": "0.10.4", + "version": "0.10.5", "private": false, "publishConfig": { "access": "public" @@ -59,7 +59,7 @@ "chalk": "^4.0.0", "chokidar": "^3.3.1", "commander": "^6.1.0", - "css-loader": "^5.2.6", + "css-loader": "^6.5.1", "diff": "^5.0.0", "esbuild": "^0.14.1", "eslint": "^7.30.0", @@ -83,6 +83,7 @@ "json-schema": "^0.4.0", "jest-transform-yaml": "^0.1.1", "lodash": "^4.17.21", + "minimatch": "3.0.4", "mini-css-extract-plugin": "^2.4.2", "node-libs-browser": "^2.2.1", "ora": "^5.3.0", @@ -114,12 +115,12 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/backend-common": "^0.10.1", + "@backstage/backend-common": "^0.10.2", "@backstage/config": "^0.1.11", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@backstage/theme": "^0.2.14", "@types/diff": "^5.0.0", @@ -127,6 +128,7 @@ "@types/fs-extra": "^9.0.1", "@types/http-proxy": "^1.17.4", "@types/inquirer": "^8.1.3", + "@types/minimatch": "^3.0.5", "@types/mock-fs": "^4.13.0", "@types/node": "^14.14.32", "@types/recursive-readdir": "^2.2.0", diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index bef5dfc285..fa00bf4073 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -214,6 +214,10 @@ export function registerCommands(program: CommanderStatic) { program .command('versions:bump') + .option( + '--pattern ', + 'Override glob for matching packages to upgrade', + ) .description('Bump Backstage packages to the latest versions') .action(lazy(() => import('./versions/bump').then(m => m.default))); diff --git a/packages/cli/src/commands/versions/bump.test.ts b/packages/cli/src/commands/versions/bump.test.ts index bc4049f1f4..377e0d59d2 100644 --- a/packages/cli/src/commands/versions/bump.test.ts +++ b/packages/cli/src/commands/versions/bump.test.ts @@ -16,6 +16,7 @@ import fs from 'fs-extra'; import mockFs from 'mock-fs'; +import { Command } from 'commander'; import { resolve as resolvePath } from 'path'; import { paths } from '../../lib/paths'; import { mapDependencies } from '../../lib/versioning'; @@ -36,6 +37,8 @@ const REGISTRY_VERSIONS: { [name: string]: string } = { '@backstage/core': '1.0.6', '@backstage/core-api': '1.0.7', '@backstage/theme': '2.0.0', + '@backstage-extra/custom': '1.1.0', + '@backstage-extra/custom-two': '2.0.0', }; const HEADER = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. @@ -83,7 +86,7 @@ describe('bump', () => { it('should bump backstage dependencies', async () => { // Make sure all modules involved in package discovery are in the module cache before we mock fs - await mapDependencies(paths.targetDir); + await mapDependencies(paths.targetDir, '@backstage/*'); mockFs({ '/yarn.lock': lockfileMock, @@ -123,9 +126,10 @@ describe('bump', () => { jest.spyOn(runObj, 'run').mockResolvedValue(undefined); const { log: logs } = await withLogCollector(['log'], async () => { - await bump(); + await bump({ pattern: null } as unknown as Command); }); expect(logs.filter(Boolean)).toEqual([ + 'Using default pattern glob @backstage/*', 'Checking for updates of @backstage/theme', 'Checking for updates of @backstage/core', 'Checking for updates of @backstage/core-api', @@ -178,9 +182,145 @@ describe('bump', () => { }); }); + it('should bump backstage dependencies and dependencies matching pattern glob', async () => { + // Make sure all modules involved in package discovery are in the module cache before we mock fs + await mapDependencies(paths.targetDir, '@backstage/*'); + const customLockfileMock = `${lockfileMock} +"@backstage-extra/custom@^1.1.0": + version "1.1.0" + +"@backstage-extra/custom@^1.0.1": + version "1.0.1" + +"@backstage-extra/custom-two@^1.0.0": + version "1.0.0" +`; + const customLockfileMockResult = `${HEADER} +"@backstage-extra/custom-two@^1.0.0": + version "1.0.0" + +"@backstage-extra/custom@^1.1.0": + version "1.1.0" + +"@backstage/core@^1.0.5": + version "1.0.6" + dependencies: + "@backstage/core-api" "^1.0.6" + +"@backstage/theme@^1.0.0": + version "1.0.0" +`; + mockFs({ + '/yarn.lock': customLockfileMock, + '/lerna.json': JSON.stringify({ + packages: ['packages/*'], + }), + '/packages/a/package.json': JSON.stringify({ + name: 'a', + dependencies: { + '@backstage/core': '^1.0.5', + '@backstage-extra/custom': '^1.0.1', + '@backstage-extra/custom-two': '^1.0.0', + }, + }), + '/packages/b/package.json': JSON.stringify({ + name: 'b', + dependencies: { + '@backstage/core': '^1.0.3', + '@backstage/theme': '^1.0.0', + '@backstage-extra/custom': '^1.1.0', + '@backstage-extra/custom-two': '^1.0.0', + }, + }), + }); + + paths.targetDir = '/'; + jest + .spyOn(paths, 'resolveTargetRoot') + .mockImplementation((...path) => resolvePath('/', ...path)); + jest.spyOn(runObj, 'runPlain').mockImplementation(async (...[, , , name]) => + JSON.stringify({ + type: 'inspect', + data: { + name: name, + 'dist-tags': { + latest: REGISTRY_VERSIONS[name], + }, + }, + }), + ); + jest.spyOn(runObj, 'run').mockResolvedValue(undefined); + + const { log: logs } = await withLogCollector(['log'], async () => { + await bump({ pattern: '@{backstage,backstage-extra}/*' } as any); + }); + expect(logs.filter(Boolean)).toEqual([ + 'Using custom pattern glob @{backstage,backstage-extra}/*', + 'Checking for updates of @backstage/theme', + 'Checking for updates of @backstage-extra/custom-two', + 'Checking for updates of @backstage-extra/custom', + 'Checking for updates of @backstage/core', + 'Checking for updates of @backstage/core-api', + 'Some packages are outdated, updating', + 'unlocking @backstage-extra/custom@^1.0.1 ~> 1.1.0', + 'unlocking @backstage/core@^1.0.3 ~> 1.0.6', + 'unlocking @backstage/core-api@^1.0.6 ~> 1.0.7', + 'unlocking @backstage/core-api@^1.0.3 ~> 1.0.7', + 'bumping @backstage-extra/custom-two in a to ^2.0.0', + 'bumping @backstage/theme in b to ^2.0.0', + 'bumping @backstage-extra/custom-two in b to ^2.0.0', + 'Running yarn install to install new versions', + '⚠️ The following packages may have breaking changes:', + ' @backstage-extra/custom-two : 1.0.0 ~> 2.0.0', + ' @backstage/theme : 1.0.0 ~> 2.0.0', + ' https://github.com/backstage/backstage/blob/master/packages/theme/CHANGELOG.md', + 'Version bump complete!', + ]); + + expect(runObj.runPlain).toHaveBeenCalledTimes(6); + expect(runObj.runPlain).toHaveBeenCalledWith( + 'yarn', + 'info', + '--json', + '@backstage/core', + ); + expect(runObj.runPlain).toHaveBeenCalledWith( + 'yarn', + 'info', + '--json', + '@backstage/theme', + ); + + expect(runObj.run).toHaveBeenCalledTimes(1); + expect(runObj.run).toHaveBeenCalledWith('yarn', ['install']); + + const lockfileContents = await fs.readFile('/yarn.lock', 'utf8'); + expect(lockfileContents).toEqual(customLockfileMockResult); + + const packageA = await fs.readJson('/packages/a/package.json'); + expect(packageA).toEqual({ + name: 'a', + dependencies: { + '@backstage-extra/custom': '^1.0.1', + '@backstage-extra/custom-two': '^2.0.0', + '@backstage/core': '^1.0.5', // not bumped since new version is within range + }, + }); + const packageB = await fs.readJson('/packages/b/package.json'); + expect(packageB).toEqual({ + name: 'b', + dependencies: { + '@backstage-extra/custom': '^1.1.0', + '@backstage-extra/custom-two': '^2.0.0', + '@backstage/core': '^1.0.3', // not bumped + '@backstage/theme': '^2.0.0', // bumped since newer + }, + }); + }); + it('should ignore not found packages', async () => { // Make sure all modules involved in package discovery are in the module cache before we mock fs - await mapDependencies(paths.targetDir); + await mapDependencies(paths.targetDir, '@backstage/*'); mockFs({ '/yarn.lock': lockfileMockResult, '/lerna.json': JSON.stringify({ @@ -209,9 +349,10 @@ describe('bump', () => { jest.spyOn(runObj, 'run').mockResolvedValue(undefined); const { log: logs } = await withLogCollector(['log'], async () => { - await bump(); + await bump({ pattern: null } as unknown as Command); }); expect(logs.filter(Boolean)).toEqual([ + 'Using default pattern glob @backstage/*', 'Checking for updates of @backstage/theme', 'Checking for updates of @backstage/core', 'Package info not found, ignoring package @backstage/theme', diff --git a/packages/cli/src/commands/versions/bump.ts b/packages/cli/src/commands/versions/bump.ts index 3898c1654a..2c16f324bc 100644 --- a/packages/cli/src/commands/versions/bump.ts +++ b/packages/cli/src/commands/versions/bump.ts @@ -17,6 +17,8 @@ import fs from 'fs-extra'; import chalk from 'chalk'; import semver from 'semver'; +import minimatch from 'minimatch'; +import { Command } from 'commander'; import { isError } from '@backstage/errors'; import { resolve as resolvePath } from 'path'; import { run } from '../../lib/run'; @@ -26,7 +28,7 @@ import { fetchPackageInfo, Lockfile, } from '../../lib/versioning'; -import { includedFilter, forbiddenDuplicatesFilter } from './lint'; +import { forbiddenDuplicatesFilter } from './lint'; import { BACKSTAGE_JSON } from '@backstage/cli-common'; const DEP_TYPES = [ @@ -36,6 +38,8 @@ const DEP_TYPES = [ 'optionalDependencies', ]; +const DEFAULT_PATTERN_GLOB = '@backstage/*'; + type PkgVersionInfo = { range: string; target: string; @@ -43,14 +47,22 @@ type PkgVersionInfo = { location: string; }; -export default async () => { +export default async (cmd: Command) => { const lockfilePath = paths.resolveTargetRoot('yarn.lock'); const lockfile = await Lockfile.load(lockfilePath); + let pattern = cmd.pattern; + + if (!pattern) { + console.log(`Using default pattern glob ${DEFAULT_PATTERN_GLOB}`); + pattern = DEFAULT_PATTERN_GLOB; + } else { + console.log(`Using custom pattern glob ${pattern}`); + } const findTargetVersion = createVersionFinder(); // First we discover all Backstage dependencies within our own repo - const dependencyMap = await mapDependencies(paths.targetDir); + const dependencyMap = await mapDependencies(paths.targetDir, pattern); // Next check with the package registry to see which dependency ranges we need to bump const versionBumps = new Map(); @@ -88,10 +100,12 @@ export default async () => { } }); + const filter = (name: string) => minimatch(name, pattern); + // Check for updates of transitive backstage dependencies await workerThreads(16, lockfile.keys(), async name => { // Only check @backstage packages and friends, we don't want this to do a full update of all deps - if (!includedFilter(name)) { + if (!filter(name)) { return; } @@ -237,7 +251,7 @@ export default async () => { // Finally we make sure the new lockfile doesn't have any duplicates const dedupLockfile = await Lockfile.load(lockfilePath); const result = dedupLockfile.analyze({ - filter: includedFilter, + filter, }); if (result.newVersions.length > 0) { diff --git a/packages/cli/src/lib/versioning/packages.test.ts b/packages/cli/src/lib/versioning/packages.test.ts index dd63e57187..b7f3614fb7 100644 --- a/packages/cli/src/lib/versioning/packages.test.ts +++ b/packages/cli/src/lib/versioning/packages.test.ts @@ -82,7 +82,10 @@ describe('mapDependencies', () => { }), }); - const dependencyMap = await mapDependencies(paths.targetDir); + const dependencyMap = await mapDependencies( + paths.targetDir, + '@backstage/*', + ); expect(Array.from(dependencyMap)).toEqual([ [ '@backstage/core', diff --git a/packages/cli/src/lib/versioning/packages.ts b/packages/cli/src/lib/versioning/packages.ts index 9f82c560f8..aa402431b9 100644 --- a/packages/cli/src/lib/versioning/packages.ts +++ b/packages/cli/src/lib/versioning/packages.ts @@ -13,12 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +import minimatch from 'minimatch'; import { runPlain } from '../../lib/run'; import { NotFoundError } from '../errors'; -const PREFIX = '@backstage'; - const DEP_TYPES = [ 'dependencies', 'devDependencies', @@ -66,6 +64,7 @@ export async function fetchPackageInfo( /** Map all dependencies in the repo as dependency => dependents */ export async function mapDependencies( targetDir: string, + pattern: string, ): Promise> { const { Project } = require('@lerna/project'); const project = new Project(targetDir); @@ -78,7 +77,7 @@ export async function mapDependencies( ); for (const [name, range] of deps) { - if (name.startsWith(PREFIX)) { + if (minimatch(name, pattern)) { dependencyMap.set( name, (dependencyMap.get(name) ?? []).concat({ diff --git a/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs b/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs index a7663567d9..159fcd70c5 100644 --- a/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs +++ b/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs @@ -2,7 +2,7 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import { Table, TableColumn, Progress } from '@backstage/core-components'; import Alert from '@material-ui/lab/Alert'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; const useStyles = makeStyles({ avatar: { diff --git a/packages/codemods/CHANGELOG.md b/packages/codemods/CHANGELOG.md index 05994d20ea..7c6ccaf9fe 100644 --- a/packages/codemods/CHANGELOG.md +++ b/packages/codemods/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/codemods +## 0.1.28 + +### Patch Changes + +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-app-api@0.3.1 + - @backstage/core-components@0.8.3 + ## 0.1.27 ### Patch Changes diff --git a/packages/codemods/package.json b/packages/codemods/package.json index dc474d3ff7..88ed029f00 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/codemods", "description": "A collection of codemods for Backstage projects", - "version": "0.1.27", + "version": "0.1.28", "private": false, "publishConfig": { "access": "public", diff --git a/packages/core-app-api/CHANGELOG.md b/packages/core-app-api/CHANGELOG.md index 687dc98649..bdd3129235 100644 --- a/packages/core-app-api/CHANGELOG.md +++ b/packages/core-app-api/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/core-app-api +## 0.3.1 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.3.0 ### Minor Changes diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index c2cc4eb0c9..fe9c419d5d 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-app-api", "description": "Core app API used by Backstage apps", - "version": "0.3.0", + "version": "0.3.1", "private": false, "publishConfig": { "access": "public", @@ -30,9 +30,9 @@ }, "dependencies": { "@backstage/app-defaults": "^0.1.3", - "@backstage/core-components": "^0.8.2", + "@backstage/core-components": "^0.8.3", "@backstage/config": "^0.1.11", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@backstage/types": "^0.1.1", "@backstage/version-bridge": "^0.1.1", @@ -50,7 +50,7 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.3", + "@backstage/cli": "^0.10.5", "@backstage/test-utils": "^0.2.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/core-app-api/src/app/AppManager.tsx b/packages/core-app-api/src/app/AppManager.tsx index 21940c08d5..7cdc06a094 100644 --- a/packages/core-app-api/src/app/AppManager.tsx +++ b/packages/core-app-api/src/app/AppManager.tsx @@ -24,7 +24,7 @@ import React, { useState, } from 'react'; import { Route, Routes } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { ApiProvider, ApiRegistry, diff --git a/packages/core-app-api/src/app/AppThemeProvider.tsx b/packages/core-app-api/src/app/AppThemeProvider.tsx index b2c800f673..2ff8e493fe 100644 --- a/packages/core-app-api/src/app/AppThemeProvider.tsx +++ b/packages/core-app-api/src/app/AppThemeProvider.tsx @@ -16,7 +16,7 @@ import React, { useMemo, useEffect, useState, PropsWithChildren } from 'react'; import { useApi, appThemeApiRef, AppTheme } from '@backstage/core-plugin-api'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; // This tries to find the most accurate match, but also falls back to less // accurate results in order to avoid errors. diff --git a/packages/core-components/CHANGELOG.md b/packages/core-components/CHANGELOG.md index eafbcc0bd6..9f306bb10f 100644 --- a/packages/core-components/CHANGELOG.md +++ b/packages/core-components/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/core-components +## 0.8.3 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + ## 0.8.2 ### Patch Changes diff --git a/packages/core-components/package.json b/packages/core-components/package.json index 82c3857a81..337a759da8 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-components", "description": "Core components used by Backstage plugins and apps", - "version": "0.8.2", + "version": "0.8.3", "private": false, "publishConfig": { "access": "public", @@ -30,7 +30,7 @@ }, "dependencies": { "@backstage/config": "^0.1.11", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.5", "@backstage/theme": "^0.2.14", "@material-table/core": "^3.1.0", @@ -72,8 +72,8 @@ "react-dom": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/core-app-api": "^0.3.0", - "@backstage/cli": "^0.10.3", + "@backstage/core-app-api": "^0.3.1", + "@backstage/cli": "^0.10.5", "@backstage/test-utils": "^0.2.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/core-components/src/components/CopyTextButton/CopyTextButton.test.tsx b/packages/core-components/src/components/CopyTextButton/CopyTextButton.test.tsx index ecb784f951..462bfb36cb 100644 --- a/packages/core-components/src/components/CopyTextButton/CopyTextButton.test.tsx +++ b/packages/core-components/src/components/CopyTextButton/CopyTextButton.test.tsx @@ -19,7 +19,7 @@ import { act, fireEvent } from '@testing-library/react'; import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; import { CopyTextButton } from './CopyTextButton'; import { errorApiRef } from '@backstage/core-plugin-api'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; jest.mock('popper.js', () => { const PopperJS = jest.requireActual('popper.js'); @@ -32,14 +32,12 @@ jest.mock('popper.js', () => { }; }); -jest.mock('react-use', () => { - const original = jest.requireActual('react-use'); +jest.mock('react-use/lib/useCopyToClipboard', () => { + const original = jest.requireActual('react-use/lib/useCopyToClipboard'); return { - ...original, - useCopyToClipboard: jest - .fn() - .mockImplementation(original.useCopyToClipboard), + __esModule: true, + default: jest.fn().mockImplementation(original.default), }; }); diff --git a/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx b/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx index fdf0868197..670c21f10c 100644 --- a/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx +++ b/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx @@ -19,7 +19,7 @@ import IconButton from '@material-ui/core/IconButton'; import Tooltip from '@material-ui/core/Tooltip'; import CopyIcon from '@material-ui/icons/FileCopy'; import React, { MouseEventHandler, useEffect, useState } from 'react'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; /** * Properties for {@link CopyTextButton} diff --git a/packages/core-components/src/components/DismissableBanner/DismissableBanner.tsx b/packages/core-components/src/components/DismissableBanner/DismissableBanner.tsx index 92b449f705..566b326cb5 100644 --- a/packages/core-components/src/components/DismissableBanner/DismissableBanner.tsx +++ b/packages/core-components/src/components/DismissableBanner/DismissableBanner.tsx @@ -16,7 +16,7 @@ import React, { ReactNode, useState, useEffect } from 'react'; import { useApi, storageApiRef } from '@backstage/core-plugin-api'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import classNames from 'classnames'; import { makeStyles } from '@material-ui/core/styles'; import { BackstageTheme } from '@backstage/theme'; diff --git a/packages/core-components/src/components/LogViewer/useLogViewerSearch.tsx b/packages/core-components/src/components/LogViewer/useLogViewerSearch.tsx index 4462a3ff50..7f0069bc44 100644 --- a/packages/core-components/src/components/LogViewer/useLogViewerSearch.tsx +++ b/packages/core-components/src/components/LogViewer/useLogViewerSearch.tsx @@ -15,7 +15,7 @@ */ import { useMemo, useState } from 'react'; -import { useToggle } from 'react-use'; +import useToggle from 'react-use/lib/useToggle'; import { AnsiLine } from './AnsiProcessor'; export function applySearchFilter(lines: AnsiLine[], searchText: string) { diff --git a/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx b/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx index a41f5e7159..f73bf22d5e 100644 --- a/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx +++ b/packages/core-components/src/components/LogViewer/useLogViewerSelection.tsx @@ -16,7 +16,7 @@ import { errorApiRef, useApi } from '@backstage/core-plugin-api'; import { useEffect, useState } from 'react'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; import { AnsiLine } from './AnsiProcessor'; export function useLogViewerSelection(lines: AnsiLine[]) { diff --git a/packages/core-components/src/components/OAuthRequestDialog/OAuthRequestDialog.tsx b/packages/core-components/src/components/OAuthRequestDialog/OAuthRequestDialog.tsx index 5378fa6c15..b11821803a 100644 --- a/packages/core-components/src/components/OAuthRequestDialog/OAuthRequestDialog.tsx +++ b/packages/core-components/src/components/OAuthRequestDialog/OAuthRequestDialog.tsx @@ -22,7 +22,7 @@ import DialogTitle from '@material-ui/core/DialogTitle'; import List from '@material-ui/core/List'; import Button from '@material-ui/core/Button'; import React, { useMemo, useState } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import LoginRequestListItem from './LoginRequestListItem'; import { useApi, oauthRequestApiRef } from '@backstage/core-plugin-api'; diff --git a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx index d0aebb4462..69952d487a 100644 --- a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx +++ b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx @@ -18,7 +18,7 @@ import { makeStyles } from '@material-ui/core/styles'; import Tooltip, { TooltipProps } from '@material-ui/core/Tooltip'; import React, { useState } from 'react'; import TextTruncate, { TextTruncateProps } from 'react-text-truncate'; -import { useMountedState } from 'react-use'; +import useMountedState from 'react-use/lib/useMountedState'; type Props = { text: TextTruncateProps['text']; diff --git a/packages/core-components/src/components/Tabs/Tabs.tsx b/packages/core-components/src/components/Tabs/Tabs.tsx index 31bf1d2027..1d08f24bb0 100644 --- a/packages/core-components/src/components/Tabs/Tabs.tsx +++ b/packages/core-components/src/components/Tabs/Tabs.tsx @@ -21,7 +21,7 @@ import { makeStyles } from '@material-ui/core/styles'; import NavigateBeforeIcon from '@material-ui/icons/NavigateBefore'; import NavigateNextIcon from '@material-ui/icons/NavigateNext'; import { chunkArray } from './utils'; -import { useWindowSize } from 'react-use'; +import useWindowSize from 'react-use/lib/useWindowSize'; /* Import Components */ diff --git a/packages/core-components/src/hooks/useQueryParamState.ts b/packages/core-components/src/hooks/useQueryParamState.ts index 57fcdc22c0..72ccafd99f 100644 --- a/packages/core-components/src/hooks/useQueryParamState.ts +++ b/packages/core-components/src/hooks/useQueryParamState.ts @@ -18,7 +18,7 @@ import { isEqual } from 'lodash'; import qs from 'qs'; import { useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; function stringify(queryParams: any): string { // Even though these setting don't look nice (e.g. escaped brackets), we should keep diff --git a/packages/core-components/src/layout/Sidebar/Intro.tsx b/packages/core-components/src/layout/Sidebar/Intro.tsx index 511a51fd9c..7b2c5fa4d7 100644 --- a/packages/core-components/src/layout/Sidebar/Intro.tsx +++ b/packages/core-components/src/layout/Sidebar/Intro.tsx @@ -21,7 +21,7 @@ import { makeStyles } from '@material-ui/core/styles'; import Typography from '@material-ui/core/Typography'; import CloseIcon from '@material-ui/icons/Close'; import React, { useContext, useState } from 'react'; -import { useLocalStorage } from 'react-use'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { sidebarConfig, SidebarContext, diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index 304e427f33..2eac16cbf4 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -25,7 +25,7 @@ import Button from '@material-ui/core/Button'; import Grid from '@material-ui/core/Grid'; import Typography from '@material-ui/core/Typography'; import React, { useState } from 'react'; -import { useMount } from 'react-use'; +import useMount from 'react-use/lib/useMount'; import { Progress } from '../../components/Progress'; import { Content } from '../Content/Content'; import { ContentHeader } from '../ContentHeader/ContentHeader'; diff --git a/packages/core-plugin-api/CHANGELOG.md b/packages/core-plugin-api/CHANGELOG.md index 0bbbf4d205..535be6aef6 100644 --- a/packages/core-plugin-api/CHANGELOG.md +++ b/packages/core-plugin-api/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/core-plugin-api +## 0.4.1 + +### Patch Changes + +- c534ef2242: Deprecated `OldIconComponent`. Existing usage should be replaced with `IconComponent`. + ## 0.4.0 ### Minor Changes diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 928a90cee5..3a4c7580b2 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -623,7 +623,7 @@ export const oktaAuthApiRef: ApiRef< SessionApi >; -// @public +// @public @deprecated export type OldIconComponent = ComponentType; // @alpha diff --git a/packages/core-plugin-api/package.json b/packages/core-plugin-api/package.json index fbb6c51c1e..b7c9189394 100644 --- a/packages/core-plugin-api/package.json +++ b/packages/core-plugin-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-plugin-api", "description": "Core API used by Backstage plugins", - "version": "0.4.0", + "version": "0.4.1", "private": false, "publishConfig": { "access": "public", @@ -45,8 +45,8 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.3", - "@backstage/core-app-api": "^0.3.0", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", "@backstage/test-utils": "^0.2.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/core-plugin-api/src/icons/types.ts b/packages/core-plugin-api/src/icons/types.ts index 5648261f3c..849561f9c0 100644 --- a/packages/core-plugin-api/src/icons/types.ts +++ b/packages/core-plugin-api/src/icons/types.ts @@ -43,5 +43,6 @@ export type IconComponent = ComponentType<{ * migration, but it is not exported. * * @public + * @deprecated This type will be removed, use {@link IconComponent} instead. */ export type OldIconComponent = ComponentType; diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md index 969b9da42b..f72e76b9c0 100644 --- a/packages/create-app/CHANGELOG.md +++ b/packages/create-app/CHANGELOG.md @@ -1,5 +1,7 @@ # @backstage/create-app +## 0.4.11 + ## 0.4.10 ### Patch Changes diff --git a/packages/create-app/package.json b/packages/create-app/package.json index af1d20b215..e95dbb3a9d 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "A CLI that helps you create your own Backstage app", - "version": "0.4.10", + "version": "0.4.11", "private": false, "publishConfig": { "access": "public" diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index df17bf7a2d..c08bbc61fd 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/dev-utils +## 0.2.16 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-app-api@0.3.1 + - @backstage/core-components@0.8.3 + ## 0.2.15 ### Patch Changes diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 99c07d99b9..75b34baf32 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/dev-utils", "description": "Utilities for developing Backstage plugins.", - "version": "0.2.15", + "version": "0.2.16", "private": false, "publishConfig": { "access": "public", @@ -30,12 +30,12 @@ }, "dependencies": { "@backstage/app-defaults": "^0.1.3", - "@backstage/core-app-api": "^0.3.0", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-app-api": "^0.3.1", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/catalog-model": "^0.9.7", "@backstage/integration-react": "^0.1.16", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/test-utils": "^0.2.0", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", @@ -55,7 +55,7 @@ "react-dom": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.3", + "@backstage/cli": "^0.10.5", "@types/jest": "^26.0.7", "@types/node": "^14.14.32" }, diff --git a/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx b/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx index e13554bbf7..585fef2db4 100644 --- a/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx +++ b/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx @@ -18,7 +18,7 @@ import { appThemeApiRef, useApi } from '@backstage/core-plugin-api'; import { ListItemIcon, ListItemText, Menu, MenuItem } from '@material-ui/core'; import AutoIcon from '@material-ui/icons/BrightnessAuto'; import React, { cloneElement, useCallback, useState } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; type ThemeIconProps = { active?: boolean; diff --git a/plugins/allure/CHANGELOG.md b/plugins/allure/CHANGELOG.md index e175654456..4f3771d348 100644 --- a/plugins/allure/CHANGELOG.md +++ b/plugins/allure/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-allure +## 0.1.10 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.9 ### Patch Changes diff --git a/plugins/allure/package.json b/plugins/allure/package.json index 6c6908dbc1..54ac6ea659 100644 --- a/plugins/allure/package.json +++ b/plugins/allure/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-allure", "description": "A Backstage plugin that integrates with Allure", - "version": "0.1.9", + "version": "0.1.10", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -23,9 +23,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -37,9 +37,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/allure/src/components/AllureReportComponent/AllureReportComponent.tsx b/plugins/allure/src/components/AllureReportComponent/AllureReportComponent.tsx index 2ca3e87691..e7564dd097 100644 --- a/plugins/allure/src/components/AllureReportComponent/AllureReportComponent.tsx +++ b/plugins/allure/src/components/AllureReportComponent/AllureReportComponent.tsx @@ -26,7 +26,7 @@ import { MissingAnnotationEmptyState, Progress, } from '@backstage/core-components'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; const AllureReport = (props: { entity: Entity }) => { diff --git a/plugins/analytics-module-ga/package.json b/plugins/analytics-module-ga/package.json index 52a72e7cce..a17f915b16 100644 --- a/plugins/analytics-module-ga/package.json +++ b/plugins/analytics-module-ga/package.json @@ -22,8 +22,8 @@ }, "dependencies": { "@backstage/config": "^0.1.5", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -35,9 +35,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/apache-airflow/CHANGELOG.md b/plugins/apache-airflow/CHANGELOG.md index c15236191c..bb8a010fda 100644 --- a/plugins/apache-airflow/CHANGELOG.md +++ b/plugins/apache-airflow/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-apache-airflow +## 0.1.2 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.1.1 ### Patch Changes diff --git a/plugins/apache-airflow/package.json b/plugins/apache-airflow/package.json index 2ddcbd26a8..d203c8de9e 100644 --- a/plugins/apache-airflow/package.json +++ b/plugins/apache-airflow/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-apache-airflow", - "version": "0.1.1", + "version": "0.1.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,8 +20,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", @@ -33,9 +33,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/apache-airflow/src/components/DagTableComponent/DagTableComponent.tsx b/plugins/apache-airflow/src/components/DagTableComponent/DagTableComponent.tsx index 13122ca552..cf343a596e 100644 --- a/plugins/apache-airflow/src/components/DagTableComponent/DagTableComponent.tsx +++ b/plugins/apache-airflow/src/components/DagTableComponent/DagTableComponent.tsx @@ -31,7 +31,7 @@ import Typography from '@material-ui/core/Typography'; import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser'; import Alert from '@material-ui/lab/Alert'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { apacheAirflowApiRef } from '../../api'; import { Dag } from '../../api/types'; import { ScheduleIntervalLabel } from '../ScheduleIntervalLabel'; diff --git a/plugins/apache-airflow/src/components/StatusComponent/StatusComponent.tsx b/plugins/apache-airflow/src/components/StatusComponent/StatusComponent.tsx index 326be4b450..4d3f3258c8 100644 --- a/plugins/apache-airflow/src/components/StatusComponent/StatusComponent.tsx +++ b/plugins/apache-airflow/src/components/StatusComponent/StatusComponent.tsx @@ -22,7 +22,7 @@ import { import { useApi } from '@backstage/core-plugin-api'; import Alert from '@material-ui/lab/Alert'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { apacheAirflowApiRef } from '../../api'; import { InstanceStatus } from '../../api/types'; diff --git a/plugins/apache-airflow/src/components/VersionComponent/VersionComponent.tsx b/plugins/apache-airflow/src/components/VersionComponent/VersionComponent.tsx index 482d1ff0a7..c82f0ee43e 100644 --- a/plugins/apache-airflow/src/components/VersionComponent/VersionComponent.tsx +++ b/plugins/apache-airflow/src/components/VersionComponent/VersionComponent.tsx @@ -22,7 +22,7 @@ import { import { useApi } from '@backstage/core-plugin-api'; import Alert from '@material-ui/lab/Alert'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { apacheAirflowApiRef } from '../../api'; import { InstanceVersion } from '../../api/types'; diff --git a/plugins/api-docs/CHANGELOG.md b/plugins/api-docs/CHANGELOG.md index 989f4d33ba..31611f5b2c 100644 --- a/plugins/api-docs/CHANGELOG.md +++ b/plugins/api-docs/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-api-docs +## 0.6.21 + +### Patch Changes + +- 11b81683a9: Support customizing index page layouts via outlets +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + - @backstage/plugin-catalog@0.7.7 + ## 0.6.20 ### Patch Changes diff --git a/plugins/api-docs/api-report.md b/plugins/api-docs/api-report.md index 111660ae07..f0e8c06aab 100644 --- a/plugins/api-docs/api-report.md +++ b/plugins/api-docs/api-report.md @@ -5,7 +5,6 @@ ```ts /// -import { Action } from '@material-table/core'; import { ApiEntity } from '@backstage/catalog-model'; import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; @@ -15,6 +14,7 @@ import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { default as React_2 } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { TableColumn } from '@backstage/core-components'; +import { TableProps } from '@backstage/core-components'; import { UserListFilterKind } from '@backstage/plugin-catalog-react'; // Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts @@ -53,27 +53,17 @@ const apiDocsPlugin: BackstagePlugin< export { apiDocsPlugin }; export { apiDocsPlugin as plugin }; +// @public +export const ApiExplorerIndexPage: ( + props: DefaultApiExplorerPageProps, +) => JSX.Element; + // 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, - actions, -}: { - initiallySelectedFilter?: UserListFilterKind | undefined; - columns?: TableColumn[] | undefined; - actions?: - | ( - | Action - | { - action: (rowData: CatalogTableRow) => Action; - position: string; - } - | ((rowData: CatalogTableRow) => Action) - )[] - | undefined; -}) => JSX.Element; +export const ApiExplorerPage: ( + props: DefaultApiExplorerPageProps, +) => 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) // @@ -110,6 +100,20 @@ export const ConsumedApisCard: ({ variant }: Props_2) => JSX.Element; // @public (undocumented) export const ConsumingComponentsCard: ({ variant }: Props_5) => JSX.Element; +// @public +export const DefaultApiExplorerPage: ({ + initiallySelectedFilter, + columns, + actions, +}: DefaultApiExplorerPageProps) => JSX.Element; + +// @public +export type DefaultApiExplorerPageProps = { + initiallySelectedFilter?: UserListFilterKind; + columns?: TableColumn[]; + actions?: TableProps['actions']; +}; + // Warning: (ae-missing-release-tag) "defaultDefinitionWidgets" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json index d1ba6080e5..ed862d6f35 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-api-docs", "description": "A Backstage plugin that helps represent API entities in the frontend", - "version": "0.6.20", + "version": "0.6.21", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,10 +32,10 @@ "dependencies": { "@asyncapi/react-component": "^1.0.0-next.25", "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog": "^0.7.6", - "@backstage/plugin-catalog-react": "^0.6.9", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog": "^0.7.7", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -54,9 +54,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx index 3629110d47..760d1ab59d 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,185 +14,31 @@ * limitations under the License. */ -import { Entity, RELATION_MEMBER_OF } from '@backstage/catalog-model'; -import { ConfigReader } from '@backstage/core-app-api'; -import { TableColumn, TableProps } from '@backstage/core-components'; -import { - ConfigApi, - configApiRef, - storageApiRef, -} from '@backstage/core-plugin-api'; -import { CatalogTableRow } from '@backstage/plugin-catalog'; -import { - CatalogApi, - catalogApiRef, - DefaultStarredEntitiesApi, - entityRouteRef, - starredEntitiesApiRef, -} from '@backstage/plugin-catalog-react'; -import { - MockStorageApi, - TestApiProvider, - wrapInTestApp, -} from '@backstage/test-utils'; -import DashboardIcon from '@material-ui/icons/Dashboard'; -import { render } from '@testing-library/react'; import React from 'react'; -import { apiDocsConfigRef } from '../../config'; +import { renderInTestApp } from '@backstage/test-utils'; +import { useOutlet } from 'react-router'; import { ApiExplorerPage } from './ApiExplorerPage'; -describe('ApiCatalogPage', () => { - const catalogApi: Partial = { - getEntities: () => - Promise.resolve({ - items: [ - { - apiVersion: 'backstage.io/v1alpha1', - kind: 'API', - metadata: { - name: 'Entity1', - }, - spec: { type: 'openapi' }, - }, - ] as Entity[], - }), - getLocationByEntity: () => - Promise.resolve({ id: 'id', type: 'github', target: 'url' }), - getEntityByName: async entityName => { - return { - apiVersion: 'backstage.io/v1alpha1', - kind: 'User', - metadata: { name: entityName.name }, - relations: [ - { - type: RELATION_MEMBER_OF, - target: { namespace: 'default', kind: 'Group', name: 'tools' }, - }, - ], - }; - }, - }; +jest.mock('react-router', () => ({ + ...jest.requireActual('react-router'), + useOutlet: jest.fn().mockReturnValue('Route Children'), +})); - const configApi: ConfigApi = new ConfigReader({ - organization: { - name: 'My Company', - }, +jest.mock('./DefaultApiExplorerPage', () => ({ + DefaultApiExplorerPage: jest.fn().mockReturnValue('DefaultApiExplorerPage'), +})); + +describe('ApiExplorerPage', () => { + it('renders provided router element', async () => { + const { getByText } = await renderInTestApp(); + + expect(getByText('Route Children')).toBeInTheDocument(); }); - const apiDocsConfig = { - getApiDefinitionWidget: () => undefined, - }; + it('renders DefaultApiExplorerPage home when no router children are provided', async () => { + (useOutlet as jest.Mock).mockReturnValueOnce(null); + const { getByText } = await renderInTestApp(); - const storageApi = MockStorageApi.create(); - - const renderWrapped = (children: React.ReactNode) => - render( - wrapInTestApp( - - {children} - , - { - mountedRoutes: { - '/catalog/:namespace/:kind/:name': entityRouteRef, - }, - }, - ), - ); - - // this test right now causes some red lines in the log output when running tests - // related to some theme issues in mui-table - // https://github.com/mbrn/material-table/issues/1293 - it('should render', async () => { - const { findByText } = renderWrapped(); - expect(await findByText(/My Company API Explorer/)).toBeInTheDocument(); - }); - - it('should render the default column of the grid', async () => { - const { getAllByRole } = renderWrapped(); - - const columnHeader = getAllByRole('button').filter( - c => c.tagName === 'SPAN', - ); - const columnHeaderLabels = columnHeader.map(c => c.textContent); - - expect(columnHeaderLabels).toEqual([ - 'Name', - 'System', - 'Owner', - 'Type', - 'Lifecycle', - 'Description', - 'Tags', - 'Actions', - ]); - }); - - it('should render the custom column passed as prop', async () => { - const columns: TableColumn[] = [ - { title: 'Foo', field: 'entity.foo' }, - { title: 'Bar', field: 'entity.bar' }, - { title: 'Baz', field: 'entity.spec.lifecycle' }, - ]; - const { getAllByRole } = renderWrapped( - , - ); - - const columnHeader = getAllByRole('button').filter( - c => c.tagName === 'SPAN', - ); - const columnHeaderLabels = columnHeader.map(c => c.textContent); - - expect(columnHeaderLabels).toEqual(['Foo', 'Bar', 'Baz', 'Actions']); - }); - - it('should render the default actions of an item in the grid', async () => { - const { findByTitle, findByText } = await renderWrapped( - , - ); - expect(await findByText(/All \(1\)/)).toBeInTheDocument(); - expect(await findByTitle(/View/)).toBeInTheDocument(); - expect(await findByTitle(/View/)).toBeInTheDocument(); - expect(await findByTitle(/Edit/)).toBeInTheDocument(); - expect(await findByTitle(/Add to favorites/)).toBeInTheDocument(); - }); - - it('should render the custom actions of an item passed as prop', async () => { - const actions: TableProps['actions'] = [ - () => { - return { - icon: () => , - tooltip: 'Foo Action', - disabled: false, - onClick: () => jest.fn(), - }; - }, - () => { - return { - icon: () => , - tooltip: 'Bar Action', - disabled: true, - onClick: () => jest.fn(), - }; - }, - ]; - - const { findByTitle, findByText } = await renderWrapped( - , - ); - expect(await findByText(/All \(1\)/)).toBeInTheDocument(); - expect(await findByTitle(/Foo Action/)).toBeInTheDocument(); - expect(await findByTitle(/Bar Action/)).toBeInTheDocument(); - expect((await findByTitle(/Bar Action/)).firstChild).toBeDisabled(); + expect(getByText('DefaultApiExplorerPage')).toBeInTheDocument(); }); }); diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx index f28574145e..68ab0a1647 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,97 +14,19 @@ * limitations under the License. */ -import { - Content, - ContentHeader, - CreateButton, - PageWithHeader, - SupportButton, - TableColumn, - TableProps, -} 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, - EntityListProvider, - EntityOwnerPicker, - EntityTagPicker, - EntityTypePicker, - UserListFilterKind, - UserListPicker, -} from '@backstage/plugin-catalog-react'; import React from 'react'; -import { createComponentRouteRef } from '../../routes'; +import { useOutlet } from 'react-router'; +import { + DefaultApiExplorerPage, + DefaultApiExplorerPageProps, +} from './DefaultApiExplorerPage'; -const defaultColumns: TableColumn[] = [ - CatalogTable.columns.createNameColumn({ defaultKind: 'API' }), - CatalogTable.columns.createSystemColumn(), - CatalogTable.columns.createOwnerColumn(), - CatalogTable.columns.createSpecTypeColumn(), - CatalogTable.columns.createSpecLifecycleColumn(), - CatalogTable.columns.createMetadataDescriptionColumn(), - CatalogTable.columns.createTagsColumn(), -]; +/** + * ApiExplorerPage + * @public + */ +export const ApiExplorerPage = (props: DefaultApiExplorerPageProps) => { + const outlet = useOutlet(); -type ApiExplorerPageProps = { - initiallySelectedFilter?: UserListFilterKind; - columns?: TableColumn[]; - actions?: TableProps['actions']; -}; - -export const ApiExplorerPage = ({ - initiallySelectedFilter = 'all', - columns, - actions, -}: ApiExplorerPageProps) => { - const configApi = useApi(configApiRef); - const generatedSubtitle = `${ - configApi.getOptionalString('organization.name') ?? 'Backstage' - } API Explorer`; - const createComponentLink = useRouteRef(createComponentRouteRef); - - return ( - - - - - All your APIs - - - - - - - - - - - - - ); + return outlet || ; }; diff --git a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx new file mode 100644 index 0000000000..9e4c861e24 --- /dev/null +++ b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx @@ -0,0 +1,198 @@ +/* + * 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 { Entity, RELATION_MEMBER_OF } from '@backstage/catalog-model'; +import { ConfigReader } from '@backstage/core-app-api'; +import { TableColumn, TableProps } from '@backstage/core-components'; +import { + ConfigApi, + configApiRef, + storageApiRef, +} from '@backstage/core-plugin-api'; +import { CatalogTableRow } from '@backstage/plugin-catalog'; +import { + CatalogApi, + catalogApiRef, + DefaultStarredEntitiesApi, + entityRouteRef, + starredEntitiesApiRef, +} from '@backstage/plugin-catalog-react'; +import { + MockStorageApi, + TestApiProvider, + wrapInTestApp, +} from '@backstage/test-utils'; +import DashboardIcon from '@material-ui/icons/Dashboard'; +import { render } from '@testing-library/react'; +import React from 'react'; +import { apiDocsConfigRef } from '../../config'; +import { DefaultApiExplorerPage } from './DefaultApiExplorerPage'; + +describe('DefaultApiExplorerPage', () => { + const catalogApi: Partial = { + getEntities: () => + Promise.resolve({ + items: [ + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'API', + metadata: { + name: 'Entity1', + }, + spec: { type: 'openapi' }, + }, + ] as Entity[], + }), + getLocationByEntity: () => + Promise.resolve({ id: 'id', type: 'github', target: 'url' }), + getEntityByName: async entityName => { + return { + apiVersion: 'backstage.io/v1alpha1', + kind: 'User', + metadata: { name: entityName.name }, + relations: [ + { + type: RELATION_MEMBER_OF, + target: { namespace: 'default', kind: 'Group', name: 'tools' }, + }, + ], + }; + }, + }; + + const configApi: ConfigApi = new ConfigReader({ + organization: { + name: 'My Company', + }, + }); + + const apiDocsConfig = { + getApiDefinitionWidget: () => undefined, + }; + + const storageApi = MockStorageApi.create(); + + const renderWrapped = (children: React.ReactNode) => + render( + wrapInTestApp( + + {children} + , + { + mountedRoutes: { + '/catalog/:namespace/:kind/:name': entityRouteRef, + }, + }, + ), + ); + + // this test right now causes some red lines in the log output when running tests + // related to some theme issues in mui-table + // https://github.com/mbrn/material-table/issues/1293 + it('should render', async () => { + const { findByText } = renderWrapped(); + expect(await findByText(/My Company API Explorer/)).toBeInTheDocument(); + }); + + it('should render the default column of the grid', async () => { + const { getAllByRole } = renderWrapped(); + + const columnHeader = getAllByRole('button').filter( + c => c.tagName === 'SPAN', + ); + const columnHeaderLabels = columnHeader.map(c => c.textContent); + + expect(columnHeaderLabels).toEqual([ + 'Name', + 'System', + 'Owner', + 'Type', + 'Lifecycle', + 'Description', + 'Tags', + 'Actions', + ]); + }); + + it('should render the custom column passed as prop', async () => { + const columns: TableColumn[] = [ + { title: 'Foo', field: 'entity.foo' }, + { title: 'Bar', field: 'entity.bar' }, + { title: 'Baz', field: 'entity.spec.lifecycle' }, + ]; + const { getAllByRole } = renderWrapped( + , + ); + + const columnHeader = getAllByRole('button').filter( + c => c.tagName === 'SPAN', + ); + const columnHeaderLabels = columnHeader.map(c => c.textContent); + + expect(columnHeaderLabels).toEqual(['Foo', 'Bar', 'Baz', 'Actions']); + }); + + it('should render the default actions of an item in the grid', async () => { + const { findByTitle, findByText } = await renderWrapped( + , + ); + expect(await findByText(/All \(1\)/)).toBeInTheDocument(); + expect(await findByTitle(/View/)).toBeInTheDocument(); + expect(await findByTitle(/View/)).toBeInTheDocument(); + expect(await findByTitle(/Edit/)).toBeInTheDocument(); + expect(await findByTitle(/Add to favorites/)).toBeInTheDocument(); + }); + + it('should render the custom actions of an item passed as prop', async () => { + const actions: TableProps['actions'] = [ + () => { + return { + icon: () => , + tooltip: 'Foo Action', + disabled: false, + onClick: () => jest.fn(), + }; + }, + () => { + return { + icon: () => , + tooltip: 'Bar Action', + disabled: true, + onClick: () => jest.fn(), + }; + }, + ]; + + const { findByTitle, findByText } = await renderWrapped( + , + ); + expect(await findByText(/All \(1\)/)).toBeInTheDocument(); + expect(await findByTitle(/Foo Action/)).toBeInTheDocument(); + expect(await findByTitle(/Bar Action/)).toBeInTheDocument(); + expect((await findByTitle(/Bar Action/)).firstChild).toBeDisabled(); + }); +}); diff --git a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx new file mode 100644 index 0000000000..5ddda96daa --- /dev/null +++ b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx @@ -0,0 +1,118 @@ +/* + * 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 { + Content, + ContentHeader, + CreateButton, + PageWithHeader, + SupportButton, + TableColumn, + TableProps, +} 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, + EntityListProvider, + EntityOwnerPicker, + EntityTagPicker, + EntityTypePicker, + UserListFilterKind, + UserListPicker, +} from '@backstage/plugin-catalog-react'; +import React from 'react'; +import { createComponentRouteRef } from '../../routes'; + +const defaultColumns: TableColumn[] = [ + CatalogTable.columns.createNameColumn({ defaultKind: 'API' }), + CatalogTable.columns.createSystemColumn(), + CatalogTable.columns.createOwnerColumn(), + CatalogTable.columns.createSpecTypeColumn(), + CatalogTable.columns.createSpecLifecycleColumn(), + CatalogTable.columns.createMetadataDescriptionColumn(), + CatalogTable.columns.createTagsColumn(), +]; + +/** + * DefaultApiExplorerPageProps + * @public + */ +export type DefaultApiExplorerPageProps = { + initiallySelectedFilter?: UserListFilterKind; + columns?: TableColumn[]; + actions?: TableProps['actions']; +}; + +/** + * DefaultApiExplorerPage + * @public + */ +export const DefaultApiExplorerPage = ({ + initiallySelectedFilter = 'all', + columns, + actions, +}: DefaultApiExplorerPageProps) => { + const configApi = useApi(configApiRef); + const generatedSubtitle = `${ + configApi.getOptionalString('organization.name') ?? 'Backstage' + } API Explorer`; + const createComponentLink = useRouteRef(createComponentRouteRef); + + return ( + + + + + All your APIs + + + + + + + + + + + + + ); +}; diff --git a/plugins/api-docs/src/components/ApiExplorerPage/index.ts b/plugins/api-docs/src/components/ApiExplorerPage/index.ts index 3d170260ad..813ca90229 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/index.ts +++ b/plugins/api-docs/src/components/ApiExplorerPage/index.ts @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,4 +14,6 @@ * limitations under the License. */ -export { ApiExplorerPage } from './ApiExplorerPage'; +export { ApiExplorerPage as ApiExplorerIndexPage } from './ApiExplorerPage'; +export { DefaultApiExplorerPage } from './DefaultApiExplorerPage'; +export type { DefaultApiExplorerPageProps } from './DefaultApiExplorerPage'; diff --git a/plugins/api-docs/src/components/index.ts b/plugins/api-docs/src/components/index.ts index c0af59dc52..f4d8034b56 100644 --- a/plugins/api-docs/src/components/index.ts +++ b/plugins/api-docs/src/components/index.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +export * from './ApiExplorerPage'; export * from './ApiDefinitionCard'; export * from './ApisCards'; export * from './AsyncApiDefinitionWidget'; diff --git a/plugins/api-docs/src/plugin.ts b/plugins/api-docs/src/plugin.ts index f400be9c7c..61695b4a7a 100644 --- a/plugins/api-docs/src/plugin.ts +++ b/plugins/api-docs/src/plugin.ts @@ -53,7 +53,7 @@ export const ApiExplorerPage = apiDocsPlugin.provide( createRoutableExtension({ name: 'ApiExplorerPage', component: () => - import('./components/ApiExplorerPage').then(m => m.ApiExplorerPage), + import('./components/ApiExplorerPage').then(m => m.ApiExplorerIndexPage), mountPoint: rootRoute, }), ); diff --git a/plugins/auth-backend/CHANGELOG.md b/plugins/auth-backend/CHANGELOG.md index c130b58dc8..14e56b060e 100644 --- a/plugins/auth-backend/CHANGELOG.md +++ b/plugins/auth-backend/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-backend +## 0.6.1 + +### Patch Changes + +- e0e57817d2: Added Google Cloud Identity-Aware Proxy as an identity provider. +- Updated dependencies + - @backstage/backend-common@0.10.2 + ## 0.6.0 ### Minor Changes diff --git a/plugins/auth-backend/api-report.md b/plugins/auth-backend/api-report.md index af46d874df..ab8bd39a94 100644 --- a/plugins/auth-backend/api-report.md +++ b/plugins/auth-backend/api-report.md @@ -9,6 +9,7 @@ import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { Entity } from '@backstage/catalog-model'; import express from 'express'; +import { JsonValue } from '@backstage/types'; import { JSONWebKey } from 'jose'; import { Logger as Logger_2 } from 'winston'; import { PluginDatabaseManager } from '@backstage/backend-common'; @@ -59,8 +60,8 @@ export type Auth0ProviderOptions = { }; // @public -export type AuthHandler = ( - input: AuthResult, +export type AuthHandler = ( + input: TAuthResult, ) => Promise; // @public @@ -249,6 +250,11 @@ export const createBitbucketProvider: ( options?: BitbucketProviderOptions | undefined, ) => AuthProviderFactory; +// @public +export function createGcpIapProvider( + options: GcpIapProviderOptions, +): AuthProviderFactory; + // Warning: (ae-missing-release-tag) "createGithubProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -335,6 +341,26 @@ export const encodeState: (state: OAuthState) => string; // @public (undocumented) export const ensuresXRequestedWith: (req: express.Request) => boolean; +// @public +export type GcpIapProviderOptions = { + authHandler?: AuthHandler; + signIn: { + resolver: SignInResolver; + }; +}; + +// @public +export type GcpIapResult = { + iapToken: GcpIapTokenInfo; +}; + +// @public +export type GcpIapTokenInfo = { + sub: string; + email: string; + [key: string]: JsonValue; +}; + // Warning: (ae-forgotten-export) The symbol "TokenParams" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "getEntityClaims" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // @@ -661,14 +687,14 @@ export type SamlProviderOptions = { }; // @public -export type SignInInfo = { +export type SignInInfo = { profile: ProfileInfo; - result: AuthResult; + result: TAuthResult; }; // @public -export type SignInResolver = ( - info: SignInInfo, +export type SignInResolver = ( + info: SignInInfo, context: { tokenIssuer: TokenIssuer; catalogIdentityClient: CatalogIdentityClient; diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index 620c8b397a..71dbcf9f02 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-auth-backend", "description": "A Backstage backend plugin that handles authentication", - "version": "0.6.0", + "version": "0.6.1", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,12 +30,13 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.10.1", + "@backstage/backend-common": "^0.10.2", "@backstage/catalog-client": "^0.5.3", "@backstage/catalog-model": "^0.9.8", "@backstage/config": "^0.1.11", "@backstage/errors": "^0.1.5", "@backstage/test-utils": "^0.2.1", + "@backstage/types": "^0.1.1", "@google-cloud/firestore": "^4.15.1", "@types/express": "^4.17.6", "@types/passport": "^1.0.3", @@ -46,6 +47,7 @@ "express-promise-router": "^4.1.0", "express-session": "^1.17.1", "fs-extra": "9.1.0", + "google-auth-library": "^7.6.1", "helmet": "^4.0.0", "jose": "^1.27.1", "jwt-decode": "^3.1.0", @@ -72,7 +74,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", + "@backstage/cli": "^0.10.5", "@types/body-parser": "^1.19.0", "@types/cookie-parser": "^1.4.2", "@types/express-session": "^1.17.2", @@ -83,7 +85,8 @@ "@types/passport-saml": "^1.1.3", "@types/passport-strategy": "^0.2.35", "@types/xml2js": "^0.4.7", - "msw": "^0.35.0" + "msw": "^0.35.0", + "supertest": "^6.1.3" }, "files": [ "dist", diff --git a/plugins/auth-backend/src/providers/aws-alb/index.ts b/plugins/auth-backend/src/providers/aws-alb/index.ts index 5f63c514a4..a8130b3575 100644 --- a/plugins/auth-backend/src/providers/aws-alb/index.ts +++ b/plugins/auth-backend/src/providers/aws-alb/index.ts @@ -13,5 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { createAwsAlbProvider } from './provider'; export type { AwsAlbProviderOptions } from './provider'; diff --git a/plugins/auth-backend/src/providers/aws-alb/provider.test.ts b/plugins/auth-backend/src/providers/aws-alb/provider.test.ts index 048128f942..fd5fe28505 100644 --- a/plugins/auth-backend/src/providers/aws-alb/provider.test.ts +++ b/plugins/auth-backend/src/providers/aws-alb/provider.test.ts @@ -18,7 +18,7 @@ import express from 'express'; import { JWT } from 'jose'; import { - ALB_ACCESSTOKEN_HEADER, + ALB_ACCESS_TOKEN_HEADER, ALB_JWT_HEADER, AwsAlbAuthProvider, } from './provider'; @@ -80,7 +80,7 @@ describe('AwsAlbAuthProvider', () => { header: jest.fn(name => { if (name === ALB_JWT_HEADER) { return mockJwt; - } else if (name === ALB_ACCESSTOKEN_HEADER) { + } else if (name === ALB_ACCESS_TOKEN_HEADER) { return mockAccessToken; } return undefined; @@ -88,7 +88,7 @@ describe('AwsAlbAuthProvider', () => { } as unknown as express.Request; const mockRequestWithoutJwt = { header: jest.fn(name => { - if (name === ALB_ACCESSTOKEN_HEADER) { + if (name === ALB_ACCESS_TOKEN_HEADER) { return mockAccessToken; } return undefined; diff --git a/plugins/auth-backend/src/providers/aws-alb/provider.ts b/plugins/auth-backend/src/providers/aws-alb/provider.ts index 114bc9a204..4f05cd7827 100644 --- a/plugins/auth-backend/src/providers/aws-alb/provider.ts +++ b/plugins/auth-backend/src/providers/aws-alb/provider.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { AuthHandler, AuthProviderFactory, @@ -35,7 +36,7 @@ import { AuthenticationError } from '@backstage/errors'; import { prepareBackstageIdentityResponse } from '../prepareBackstageIdentityResponse'; export const ALB_JWT_HEADER = 'x-amzn-oidc-data'; -export const ALB_ACCESSTOKEN_HEADER = 'x-amzn-oidc-accesstoken'; +export const ALB_ACCESS_TOKEN_HEADER = 'x-amzn-oidc-accesstoken'; type Options = { region: string; @@ -134,7 +135,7 @@ export class AwsAlbAuthProvider implements AuthProviderRouteHandlers { private async getResult(req: express.Request): Promise { const jwt = req.header(ALB_JWT_HEADER); - const accessToken = req.header(ALB_ACCESSTOKEN_HEADER); + const accessToken = req.header(ALB_ACCESS_TOKEN_HEADER); if (jwt === undefined) { throw new AuthenticationError( @@ -144,7 +145,7 @@ export class AwsAlbAuthProvider implements AuthProviderRouteHandlers { if (accessToken === undefined) { throw new AuthenticationError( - `Missing ALB OIDC header: ${ALB_ACCESSTOKEN_HEADER}`, + `Missing ALB OIDC header: ${ALB_ACCESS_TOKEN_HEADER}`, ); } diff --git a/plugins/auth-backend/src/providers/gcp-iap/helpers.test.ts b/plugins/auth-backend/src/providers/gcp-iap/helpers.test.ts new file mode 100644 index 0000000000..94fa9c0bd8 --- /dev/null +++ b/plugins/auth-backend/src/providers/gcp-iap/helpers.test.ts @@ -0,0 +1,134 @@ +/* + * 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 { ConflictError } from '@backstage/errors'; +import { OAuth2Client } from 'google-auth-library'; +import { createTokenValidator, parseRequestToken } from './helpers'; + +const validJwt = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImZvbyIsImlzcyI6ImZvbyJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.T2BNS4G-6RoiFnXc8Q8TiwdWzTpNitY8jcsGM3N3-Yo'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('helpers', () => { + describe('createTokenValidator', () => { + it('runs the happy path', async () => { + const mockClient = { + getIapPublicKeys: async () => ({ pubkeys: '' }), + verifySignedJwtWithCertsAsync: async () => ({ + getPayload: () => ({ sub: 's', email: 'e@mail.com' }), + }), + }; + const validator = createTokenValidator( + 'a', + mockClient as unknown as OAuth2Client, + ); + await expect(validator(validJwt)).resolves.toMatchObject({ + sub: 's', + email: 'e@mail.com', + }); + }); + + it('throws if the client throws', async () => { + const mockClient = { + getIapPublicKeys: async () => { + throw new TypeError('bam'); + }, + }; + const validator = createTokenValidator( + 'a', + mockClient as unknown as OAuth2Client, + ); + await expect(validator(validJwt)).rejects.toThrowError(TypeError); + }); + + it('rejects empty payload', async () => { + const mockClient = { + getIapPublicKeys: async () => ({ pubkeys: '' }), + verifySignedJwtWithCertsAsync: async () => ({ + getPayload: () => undefined, + }), + }; + const validator = createTokenValidator( + 'a', + mockClient as unknown as OAuth2Client, + ); + await expect(validator(validJwt)).rejects.toMatchObject({ + name: 'TypeError', + message: 'Token had no payload', + }); + }); + }); + + describe('parseRequestToken', () => { + it('runs the happy path', async () => { + await expect( + parseRequestToken( + validJwt, + async () => ({ sub: 's', email: 'e@mail.com' } as any), + ), + ).resolves.toMatchObject({ + iapToken: { + sub: 's', + email: 'e@mail.com', + }, + }); + }); + + it('rejects bad tokens', async () => { + await expect( + parseRequestToken(7, undefined as any), + ).rejects.toMatchObject({ + name: 'AuthenticationError', + message: 'Missing Google IAP header: x-goog-iap-jwt-assertion', + }); + await expect( + parseRequestToken(undefined, undefined as any), + ).rejects.toMatchObject({ + name: 'AuthenticationError', + message: 'Missing Google IAP header: x-goog-iap-jwt-assertion', + }); + await expect( + parseRequestToken('', undefined as any), + ).rejects.toMatchObject({ + name: 'AuthenticationError', + message: 'Missing Google IAP header: x-goog-iap-jwt-assertion', + }); + }); + + it('translates validator errors', async () => { + await expect( + parseRequestToken(validJwt, async () => { + throw new ConflictError('Ouch'); + }), + ).rejects.toMatchObject({ + name: 'AuthenticationError', + message: 'Google IAP token verification failed, ConflictError: Ouch', + }); + }); + + it('rejects bad token payloads', async () => { + await expect( + parseRequestToken(validJwt, async () => ({ sub: 'a' } as any)), + ).rejects.toMatchObject({ + name: 'AuthenticationError', + message: 'Google IAP token payload is missing sub and/or email claim', + }); + }); + }); +}); diff --git a/plugins/auth-backend/src/providers/gcp-iap/helpers.ts b/plugins/auth-backend/src/providers/gcp-iap/helpers.ts new file mode 100644 index 0000000000..c7e81adc73 --- /dev/null +++ b/plugins/auth-backend/src/providers/gcp-iap/helpers.ts @@ -0,0 +1,84 @@ +/* + * 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 { AuthenticationError } from '@backstage/errors'; +import { OAuth2Client, TokenPayload } from 'google-auth-library'; +import { AuthHandler } from '../types'; +import { GcpIapResult, IAP_JWT_HEADER } from './types'; + +export function createTokenValidator( + audience: string, + mockClient?: OAuth2Client, +): (token: string) => Promise { + const client = mockClient ?? new OAuth2Client(); + + return async function tokenValidator(token) { + // TODO(freben): Rate limit the public key reads. It may be sensible to + // cache these for some reasonable time rather than asking for the public + // keys on every single sign-in. But since the rate of events here is so + // slow, I decided to keep it simple for now. + const response = await client.getIapPublicKeys(); + const ticket = await client.verifySignedJwtWithCertsAsync( + token, + response.pubkeys, + audience, + ['https://cloud.google.com/iap'], + ); + + const payload = ticket.getPayload(); + if (!payload) { + throw new TypeError('Token had no payload'); + } + + return payload; + }; +} + +export async function parseRequestToken( + jwtToken: unknown, + tokenValidator: (token: string) => Promise, +): Promise { + if (typeof jwtToken !== 'string' || !jwtToken) { + throw new AuthenticationError( + `Missing Google IAP header: ${IAP_JWT_HEADER}`, + ); + } + + let payload: TokenPayload; + try { + payload = await tokenValidator(jwtToken); + } catch (e) { + throw new AuthenticationError(`Google IAP token verification failed, ${e}`); + } + + if (!payload.sub || !payload.email) { + throw new AuthenticationError( + 'Google IAP token payload is missing sub and/or email claim', + ); + } + + return { + iapToken: { + ...payload, + sub: payload.sub, + email: payload.email, + }, + }; +} + +export const defaultAuthHandler: AuthHandler = async ({ + iapToken, +}) => ({ profile: { email: iapToken.email } }); diff --git a/plugins/auth-backend/src/providers/gcp-iap/index.ts b/plugins/auth-backend/src/providers/gcp-iap/index.ts new file mode 100644 index 0000000000..fe5d178fcc --- /dev/null +++ b/plugins/auth-backend/src/providers/gcp-iap/index.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2021 Spotify AB + * + * 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 { createGcpIapProvider } from './provider'; +export type { + GcpIapProviderOptions, + GcpIapResult, + GcpIapTokenInfo, +} from './types'; diff --git a/plugins/auth-backend/src/providers/gcp-iap/provider.test.ts b/plugins/auth-backend/src/providers/gcp-iap/provider.test.ts new file mode 100644 index 0000000000..bb1ed5c79b --- /dev/null +++ b/plugins/auth-backend/src/providers/gcp-iap/provider.test.ts @@ -0,0 +1,76 @@ +/* + * Copyright 2020 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { getVoidLogger } from '@backstage/backend-common'; +import express from 'express'; +import request from 'supertest'; +import { GcpIapProvider } from './provider'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('GcpIapProvider', () => { + const authHandler = jest.fn(); + const signInResolver = jest.fn(); + const tokenValidator = jest.fn(); + const logger = getVoidLogger(); + + it('runs the happy path', async () => { + const provider = new GcpIapProvider({ + authHandler, + signInResolver, + tokenValidator, + tokenIssuer: {} as any, + catalogIdentityClient: {} as any, + logger, + }); + + // { "sub": "user:default/me", "ent": ["group:default/home"] } + const backstageToken = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyOmRlZmF1bHQvbWUiLCJlbnQiOlsiZ3JvdXA6ZGVmYXVsdC9ob21lIl19.CbmAKzFErGmtsnpRxyPc7dHv7WEjb5lY6206YCzR_Rc'; + const iapToken = { sub: 's', email: 'e@mail.com' }; + + authHandler.mockResolvedValueOnce({ email: 'e@mail.com' }); + signInResolver.mockResolvedValueOnce({ id: 'i', token: backstageToken }); + tokenValidator.mockResolvedValueOnce(iapToken); + + const app = express(); + app.use('/refresh', provider.refresh.bind(provider)); + + const response = await request(app) + .get('/refresh') + .set('x-goog-iap-jwt-assertion', 'token'); + + expect(response.status).toBe(200); + expect(response.get('content-type')).toBe( + 'application/json; charset=utf-8', + ); + expect(response.body).toEqual({ + backstageIdentity: { + id: 'i', + idToken: backstageToken, + token: backstageToken, + identity: { + type: 'user', + userEntityRef: 'user:default/me', + ownershipEntityRefs: ['group:default/home'], + }, + }, + providerInfo: { iapToken }, + }); + }); +}); diff --git a/plugins/auth-backend/src/providers/gcp-iap/provider.ts b/plugins/auth-backend/src/providers/gcp-iap/provider.ts new file mode 100644 index 0000000000..9007fa24fe --- /dev/null +++ b/plugins/auth-backend/src/providers/gcp-iap/provider.ts @@ -0,0 +1,125 @@ +/* + * Copyright 2021 Spotify AB + * + * 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 express from 'express'; +import { TokenPayload } from 'google-auth-library'; +import { Logger } from 'winston'; +import { TokenIssuer } from '../../identity/types'; +import { CatalogIdentityClient } from '../../lib/catalog'; +import { prepareBackstageIdentityResponse } from '../prepareBackstageIdentityResponse'; +import { + AuthHandler, + AuthProviderFactory, + AuthProviderRouteHandlers, + SignInResolver, +} from '../types'; +import { + createTokenValidator, + defaultAuthHandler, + parseRequestToken, +} from './helpers'; +import { + GcpIapProviderOptions, + GcpIapResponse, + GcpIapResult, + IAP_JWT_HEADER, +} from './types'; + +export class GcpIapProvider implements AuthProviderRouteHandlers { + private readonly authHandler: AuthHandler; + private readonly signInResolver: SignInResolver; + private readonly tokenValidator: (token: string) => Promise; + private readonly tokenIssuer: TokenIssuer; + private readonly catalogIdentityClient: CatalogIdentityClient; + private readonly logger: Logger; + + constructor(options: { + authHandler: AuthHandler; + signInResolver: SignInResolver; + tokenValidator: (token: string) => Promise; + tokenIssuer: TokenIssuer; + catalogIdentityClient: CatalogIdentityClient; + logger: Logger; + }) { + this.authHandler = options.authHandler; + this.signInResolver = options.signInResolver; + this.tokenValidator = options.tokenValidator; + this.tokenIssuer = options.tokenIssuer; + this.catalogIdentityClient = options.catalogIdentityClient; + this.logger = options.logger; + } + + async start() {} + + async frameHandler() {} + + async refresh(req: express.Request, res: express.Response): Promise { + const result = await parseRequestToken( + req.header(IAP_JWT_HEADER), + this.tokenValidator, + ); + + const { profile } = await this.authHandler(result); + + const backstageIdentity = await this.signInResolver( + { profile, result }, + { + tokenIssuer: this.tokenIssuer, + catalogIdentityClient: this.catalogIdentityClient, + logger: this.logger, + }, + ); + + const response: GcpIapResponse = { + providerInfo: { iapToken: result.iapToken }, + profile, + backstageIdentity: prepareBackstageIdentityResponse(backstageIdentity), + }; + + res.json(response); + } +} + +/** + * Creates an auth provider for Google Identity-Aware Proxy. + * + * @public + */ +export function createGcpIapProvider( + options: GcpIapProviderOptions, +): AuthProviderFactory { + return ({ config, tokenIssuer, catalogApi, logger }) => { + const audience = config.getString('audience'); + + const authHandler = options.authHandler ?? defaultAuthHandler; + const signInResolver = options.signIn.resolver; + const tokenValidator = createTokenValidator(audience); + + const catalogIdentityClient = new CatalogIdentityClient({ + catalogApi, + tokenIssuer, + }); + + return new GcpIapProvider({ + authHandler, + signInResolver, + tokenValidator, + tokenIssuer, + catalogIdentityClient, + logger, + }); + }; +} diff --git a/plugins/auth-backend/src/providers/gcp-iap/types.ts b/plugins/auth-backend/src/providers/gcp-iap/types.ts new file mode 100644 index 0000000000..5a8c3491fe --- /dev/null +++ b/plugins/auth-backend/src/providers/gcp-iap/types.ts @@ -0,0 +1,96 @@ +/* + * Copyright 2021 Spotify AB + * + * 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 { JsonValue } from '@backstage/types'; +import { AuthHandler, AuthResponse, SignInResolver } from '../types'; + +/** + * The header name used by the IAP. + */ +export const IAP_JWT_HEADER = 'x-goog-iap-jwt-assertion'; + +/** + * The data extracted from an IAP token. + * + * @public + */ +export type GcpIapTokenInfo = { + /** + * The unique, stable identifier for the user. + */ + sub: string; + /** + * User email address. + */ + email: string; + /** + * Other fields. + */ + [key: string]: JsonValue; +}; + +/** + * The result of the initial auth challenge. This is the input to the auth + * callbacks. + * + * @public + */ +export type GcpIapResult = { + /** + * The data extracted from the IAP token header. + */ + iapToken: GcpIapTokenInfo; +}; + +/** + * The provider info to return to the frontend. + */ +export type GcpIapProviderInfo = { + /** + * The data extracted from the IAP token header. + */ + iapToken: GcpIapTokenInfo; +}; + +/** + * The shape of the response to return to callers. + */ +export type GcpIapResponse = AuthResponse; + +/** + * Options for {@link createGcpIapProvider}. + * + * @public + */ +export type GcpIapProviderOptions = { + /** + * The profile transformation function used to verify and convert the auth + * response into the profile that will be presented to the user. The default + * implementation just provides the authenticated email that the IAP + * presented. + */ + authHandler?: AuthHandler; + + /** + * Configures sign-in for this provider. + */ + signIn: { + /** + * Maps an auth result to a Backstage identity for the user. + */ + resolver: SignInResolver; + }; +}; diff --git a/plugins/auth-backend/src/providers/index.ts b/plugins/auth-backend/src/providers/index.ts index 3f71dd2c26..a25d2ce8bc 100644 --- a/plugins/auth-backend/src/providers/index.ts +++ b/plugins/auth-backend/src/providers/index.ts @@ -27,6 +27,7 @@ export * from './oidc'; export * from './okta'; export * from './onelogin'; export * from './saml'; +export * from './gcp-iap'; export { factories as defaultAuthProviderFactories } from './factories'; diff --git a/plugins/auth-backend/src/providers/prepareBackstageIdentityResponse.ts b/plugins/auth-backend/src/providers/prepareBackstageIdentityResponse.ts index 31df7a4cef..1de8ebb9b2 100644 --- a/plugins/auth-backend/src/providers/prepareBackstageIdentityResponse.ts +++ b/plugins/auth-backend/src/providers/prepareBackstageIdentityResponse.ts @@ -22,7 +22,9 @@ function parseJwtPayload(token: string) { } /** - * Parses token and decorates the BackstageIdentityResponse with identity information sourced from the token + * Parses a Backstage-issued token and decorates the + * {@link BackstageIdentityResponse} with identity information sourced from the + * token. * * @public */ diff --git a/plugins/auth-backend/src/providers/types.ts b/plugins/auth-backend/src/providers/types.ts index ecb466c768..0915bccc6c 100644 --- a/plugins/auth-backend/src/providers/types.ts +++ b/plugins/auth-backend/src/providers/types.ts @@ -200,13 +200,16 @@ export interface BackstageSignInResult { /** * The old exported symbol for {@link BackstageSignInResult}. + * * @public - * @deprecated Use the `BackstageSignInResult` type instead. + * @deprecated Use the {@link BackstageSignInResult} instead. */ export type BackstageIdentity = BackstageSignInResult; /** - * Response object containing the {@link BackstageUserIdentity} and the token from the authentication provider. + * Response object containing the {@link BackstageUserIdentity} and the token + * from the authentication provider. + * * @public */ export interface BackstageIdentityResponse extends BackstageSignInResult { @@ -220,7 +223,8 @@ export interface BackstageIdentityResponse extends BackstageSignInResult { * Used to display login information to user, i.e. sidebar popup. * * It is also temporarily used as the profile of the signed-in user's Backstage - * identity, but we want to replace that with data from identity and/org catalog service + * identity, but we want to replace that with data from identity and/org catalog + * service * * @public */ @@ -241,28 +245,32 @@ export type ProfileInfo = { }; /** - * type of sign in information context, includes the profile information and authentication result which contains auth. related information + * Type of sign in information context. Includes the profile information and + * authentication result which contains auth related information. + * * @public */ -export type SignInInfo = { +export type SignInInfo = { /** * The simple profile passed down for use in the frontend. */ profile: ProfileInfo; /** - * The authentication result that was received from the authentication provider. + * The authentication result that was received from the authentication + * provider. */ - result: AuthResult; + result: TAuthResult; }; /** - * Sign in resolver type describes the function which handles the result of a successful authentication - * and it must return a valid {@link BackstageSignInResult} + * Describes the function which handles the result of a successful + * authentication. Must return a valid {@link BackstageSignInResult}. + * * @public */ -export type SignInResolver = ( - info: SignInInfo, +export type SignInResolver = ( + info: SignInInfo, context: { tokenIssuer: TokenIssuer; catalogIdentityClient: CatalogIdentityClient; @@ -271,23 +279,28 @@ export type SignInResolver = ( ) => Promise; /** - * The return type of authentication handler which must contain a valid profile information + * The return type of an authentication handler. Must contain valid profile + * information. + * * @public */ export type AuthHandlerResult = { profile: ProfileInfo }; /** - * The AuthHandler function is called every time the user authenticates using the provider. + * The AuthHandler function is called every time the user authenticates using + * the provider. * - * The handler should return a profile that represents the session for the user in the frontend. + * The handler should return a profile that represents the session for the user + * in the frontend. * - * Throwing an error in the function will cause the authentication to fail, making it - * possible to use this function as a way to limit access to a certain group of users. + * Throwing an error in the function will cause the authentication to fail, + * making it possible to use this function as a way to limit access to a certain + * group of users. * * @public */ -export type AuthHandler = ( - input: AuthResult, +export type AuthHandler = ( + input: TAuthResult, ) => Promise; export type StateEncoder = ( diff --git a/plugins/azure-devops/CHANGELOG.md b/plugins/azure-devops/CHANGELOG.md index 4d0e3a95c7..838130d4ae 100644 --- a/plugins/azure-devops/CHANGELOG.md +++ b/plugins/azure-devops/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-azure-devops +## 0.1.9 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.8 ### Patch Changes diff --git a/plugins/azure-devops/package.json b/plugins/azure-devops/package.json index 3c1f5dd351..f8cbcc430a 100644 --- a/plugins/azure-devops/package.json +++ b/plugins/azure-devops/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-azure-devops", - "version": "0.1.8", + "version": "0.1.9", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -28,11 +28,11 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.8", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.4", "@backstage/plugin-azure-devops-common": "^0.1.3", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -46,9 +46,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/azure-devops/src/hooks/useAllTeams.ts b/plugins/azure-devops/src/hooks/useAllTeams.ts index d32aa5e136..03885e4999 100644 --- a/plugins/azure-devops/src/hooks/useAllTeams.ts +++ b/plugins/azure-devops/src/hooks/useAllTeams.ts @@ -17,7 +17,7 @@ import { Team } from '@backstage/plugin-azure-devops-common'; import { azureDevOpsApiRef } from '../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; export function useAllTeams(): { teams?: Team[]; diff --git a/plugins/azure-devops/src/hooks/useDashboardPullRequests.ts b/plugins/azure-devops/src/hooks/useDashboardPullRequests.ts index 1b2333ba1c..95c97b002e 100644 --- a/plugins/azure-devops/src/hooks/useDashboardPullRequests.ts +++ b/plugins/azure-devops/src/hooks/useDashboardPullRequests.ts @@ -15,7 +15,8 @@ */ import { errorApiRef, useApi } from '@backstage/core-plugin-api'; -import { useAsyncRetry, useInterval } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; +import useInterval from 'react-use/lib/useInterval'; import { DashboardPullRequest } from '@backstage/plugin-azure-devops-common'; import { azureDevOpsApiRef } from '../api'; diff --git a/plugins/azure-devops/src/hooks/usePullRequests.ts b/plugins/azure-devops/src/hooks/usePullRequests.ts index 178bf0495f..9ddca9650b 100644 --- a/plugins/azure-devops/src/hooks/usePullRequests.ts +++ b/plugins/azure-devops/src/hooks/usePullRequests.ts @@ -24,7 +24,7 @@ import { AZURE_DEVOPS_DEFAULT_TOP } from '../constants'; import { Entity } from '@backstage/catalog-model'; import { azureDevOpsApiRef } from '../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useProjectRepoFromEntity } from './useProjectRepoFromEntity'; export function usePullRequests( diff --git a/plugins/azure-devops/src/hooks/useRepoBuilds.ts b/plugins/azure-devops/src/hooks/useRepoBuilds.ts index af2d181c34..e0fe8c2093 100644 --- a/plugins/azure-devops/src/hooks/useRepoBuilds.ts +++ b/plugins/azure-devops/src/hooks/useRepoBuilds.ts @@ -23,7 +23,7 @@ import { AZURE_DEVOPS_DEFAULT_TOP } from '../constants'; import { Entity } from '@backstage/catalog-model'; import { azureDevOpsApiRef } from '../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useProjectRepoFromEntity } from './useProjectRepoFromEntity'; export function useRepoBuilds( diff --git a/plugins/badges/CHANGELOG.md b/plugins/badges/CHANGELOG.md index 95d4917582..67d54623bf 100644 --- a/plugins/badges/CHANGELOG.md +++ b/plugins/badges/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-badges +## 0.2.18 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.2.17 ### Patch Changes diff --git a/plugins/badges/package.json b/plugins/badges/package.json index 663d6f0824..f9e24f27bf 100644 --- a/plugins/badges/package.json +++ b/plugins/badges/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-badges", "description": "A Backstage plugin that generates README badges for your entities", - "version": "0.2.17", + "version": "0.2.18", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -28,10 +28,10 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.5", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -43,9 +43,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/badges/src/components/EntityBadgesDialog.tsx b/plugins/badges/src/components/EntityBadgesDialog.tsx index 75caca2d9d..1ae5f69326 100644 --- a/plugins/badges/src/components/EntityBadgesDialog.tsx +++ b/plugins/badges/src/components/EntityBadgesDialog.tsx @@ -27,7 +27,7 @@ import { useTheme, } from '@material-ui/core'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { badgesApiRef } from '../api'; import { diff --git a/plugins/bazaar/CHANGELOG.md b/plugins/bazaar/CHANGELOG.md index 8a69f2f2ff..09b1f64edf 100644 --- a/plugins/bazaar/CHANGELOG.md +++ b/plugins/bazaar/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-bazaar +## 0.1.8 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/cli@0.10.5 + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + - @backstage/plugin-catalog@0.7.7 + ## 0.1.7 ### Patch Changes diff --git a/plugins/bazaar/package.json b/plugins/bazaar/package.json index 9bf4f22afe..144569885d 100644 --- a/plugins/bazaar/package.json +++ b/plugins/bazaar/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-bazaar", - "version": "0.1.7", + "version": "0.1.8", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,11 +22,11 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/cli": "^0.10.3", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog": "^0.7.5", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/cli": "^0.10.5", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog": "^0.7.7", + "@backstage/plugin-catalog-react": "^0.6.10", "@date-io/luxon": "1.x", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -43,8 +43,8 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/dev-utils": "^0.2.16", "@testing-library/jest-dom": "^5.10.1", "cross-fetch": "^3.0.6" }, diff --git a/plugins/bazaar/src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.tsx b/plugins/bazaar/src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.tsx index 685d400d3e..5007dbdc89 100644 --- a/plugins/bazaar/src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.tsx +++ b/plugins/bazaar/src/components/EntityBazaarInfoCard/EntityBazaarInfoCard.tsx @@ -15,7 +15,7 @@ */ import React, { useState, useEffect } from 'react'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { useApi } from '@backstage/core-plugin-api'; import { stringifyEntityRef } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; diff --git a/plugins/bazaar/src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.tsx b/plugins/bazaar/src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.tsx index f2c005abd1..470dc824b6 100644 --- a/plugins/bazaar/src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.tsx +++ b/plugins/bazaar/src/components/EntityBazaarInfoContent/EntityBazaarInfoContent.tsx @@ -30,7 +30,7 @@ import { useApi, identityApiRef } from '@backstage/core-plugin-api'; import { BazaarProject, Member } from '../../types'; import { bazaarApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import ExitToAppIcon from '@material-ui/icons/ExitToApp'; import { parseEntityRef } from '@backstage/catalog-model'; import { ConfirmationDialog } from '../ConfirmationDialog'; diff --git a/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx b/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx index daca0aec1d..05fadc6709 100644 --- a/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx +++ b/plugins/bazaar/src/components/HomePageBazaarInfoCard/HomePageBazaarInfoCard.tsx @@ -37,7 +37,7 @@ import { import { Member, BazaarProject } from '../../types'; import { bazaarApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { catalogApiRef, catalogRouteRef, diff --git a/plugins/bazaar/src/components/SortView/SortView.tsx b/plugins/bazaar/src/components/SortView/SortView.tsx index e42c51784b..a7f99625e5 100644 --- a/plugins/bazaar/src/components/SortView/SortView.tsx +++ b/plugins/bazaar/src/components/SortView/SortView.tsx @@ -19,7 +19,7 @@ import { Content, SupportButton } from '@backstage/core-components'; import { AddProjectDialog } from '../AddProjectDialog'; import { ProjectPreview } from '../ProjectPreview/ProjectPreview'; import { Button, makeStyles } from '@material-ui/core'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { Entity, stringifyEntityRef } from '@backstage/catalog-model'; import { useApi } from '@backstage/core-plugin-api'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; diff --git a/plugins/bitrise/CHANGELOG.md b/plugins/bitrise/CHANGELOG.md index 96a95b9afd..3f606353c1 100644 --- a/plugins/bitrise/CHANGELOG.md +++ b/plugins/bitrise/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-bitrise +## 0.1.21 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.20 ### Patch Changes diff --git a/plugins/bitrise/package.json b/plugins/bitrise/package.json index 3ef3fc1722..e1dca12e2b 100644 --- a/plugins/bitrise/package.json +++ b/plugins/bitrise/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-bitrise", "description": "A Backstage plugin that integrates towards Bitrise", - "version": "0.1.20", + "version": "0.1.21", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,9 +22,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -40,9 +40,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/bitrise/src/components/useBitriseArtifactDetails.ts b/plugins/bitrise/src/components/useBitriseArtifactDetails.ts index 3370f3c600..e00c8cc8e7 100644 --- a/plugins/bitrise/src/components/useBitriseArtifactDetails.ts +++ b/plugins/bitrise/src/components/useBitriseArtifactDetails.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { BitriseBuildArtifactDetails } from '../api/bitriseApi.model'; import { bitriseApiRef } from '../plugin'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/bitrise/src/components/useBitriseArtifacts.ts b/plugins/bitrise/src/components/useBitriseArtifacts.ts index 16f03c5805..0f7423c921 100644 --- a/plugins/bitrise/src/components/useBitriseArtifacts.ts +++ b/plugins/bitrise/src/components/useBitriseArtifacts.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { BitriseBuildArtifact } from '../api/bitriseApi.model'; import { bitriseApiRef } from '../plugin'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts b/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts index fe56dc5480..122968d6ea 100644 --- a/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts +++ b/plugins/bitrise/src/hooks/useBitriseBuildWorkflows.ts @@ -14,9 +14,8 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync, { AsyncState } from 'react-use/lib/useAsync'; import { bitriseApiRef } from '../plugin'; -import { AsyncState } from 'react-use/lib/useAsync'; import { BitriseApp } from '../api/bitriseApi.model'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/bitrise/src/hooks/useBitriseBuilds.ts b/plugins/bitrise/src/hooks/useBitriseBuilds.ts index a13b2db25f..13869c27a0 100644 --- a/plugins/bitrise/src/hooks/useBitriseBuilds.ts +++ b/plugins/bitrise/src/hooks/useBitriseBuilds.ts @@ -14,14 +14,13 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync, { AsyncState } from 'react-use/lib/useAsync'; import { BitriseApp, BitriseBuildListResponse, BitriseQueryParams, } from '../api/bitriseApi.model'; import { bitriseApiRef } from '../plugin'; -import { AsyncState } from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; export const useBitriseBuilds = ( diff --git a/plugins/catalog-backend/src/processing/TaskPipeline.test.ts b/plugins/catalog-backend/src/processing/TaskPipeline.test.ts index 453fdfe914..f814e8a608 100644 --- a/plugins/catalog-backend/src/processing/TaskPipeline.test.ts +++ b/plugins/catalog-backend/src/processing/TaskPipeline.test.ts @@ -42,7 +42,7 @@ function createLimitedLoader(count: number, loadDelay?: number) { }; const processTask = async (item: number) => { processedTasks.push(item); - await new Promise(resolve => setTimeout(resolve)); // emulate a bit of work + await new Promise(resolve => setTimeout(resolve, 10)); // emulate a bit of work if (processedTasks.length === count) { resolveDone({ processedTasks, loadCounts }); } diff --git a/plugins/catalog-graph/CHANGELOG.md b/plugins/catalog-graph/CHANGELOG.md index 0ae2486b3f..ffbef5c63f 100644 --- a/plugins/catalog-graph/CHANGELOG.md +++ b/plugins/catalog-graph/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-catalog-graph +## 0.2.5 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.2.4 ### Patch Changes diff --git a/plugins/catalog-graph/package.json b/plugins/catalog-graph/package.json index c294ba8e24..8718172cf4 100644 --- a/plugins/catalog-graph/package.json +++ b/plugins/catalog-graph/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-graph", - "version": "0.2.4", + "version": "0.2.5", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -23,9 +23,9 @@ "dependencies": { "@backstage/catalog-client": "^0.5.3", "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -42,9 +42,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts b/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts index e802a672c6..198cbd397f 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts @@ -28,7 +28,7 @@ import { useState, } from 'react'; import { useLocation } from 'react-router'; -import { usePrevious } from 'react-use'; +import usePrevious from 'react-use/lib/usePrevious'; import { Direction } from '../EntityRelationsGraph'; export type CatalogGraphPageValue = { diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts index 4fc00c5353..2f78fd9c17 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts @@ -18,7 +18,7 @@ import { stringifyEntityRef, } from '@backstage/catalog-model'; import { MouseEvent, useState } from 'react'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { RelationPairs, ALL_RELATION_PAIRS } from './relations'; import { EntityEdge, EntityNode } from './types'; import { useEntityRelationGraph } from './useEntityRelationGraph'; diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.ts b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.ts index 476c10b84f..b5ec3bef19 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.ts +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.ts @@ -18,7 +18,7 @@ import { useApi } from '@backstage/core-plugin-api'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import limiterFactory from 'p-limit'; import { Dispatch, useCallback, useRef, useState } from 'react'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; // TODO: This is a good use case for a graphql API, once it is available in the // future. diff --git a/plugins/catalog-import/CHANGELOG.md b/plugins/catalog-import/CHANGELOG.md index d575f64ab7..ff675b812c 100644 --- a/plugins/catalog-import/CHANGELOG.md +++ b/plugins/catalog-import/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-catalog-import +## 0.7.8 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.7.7 ### Patch Changes diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index 3f6570dca2..7558ff9445 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-import", "description": "A Backstage plugin the helps you import entities into your catalog", - "version": "0.7.7", + "version": "0.7.8", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,12 +33,12 @@ "dependencies": { "@backstage/catalog-client": "^0.5.3", "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.3", "@backstage/integration": "^0.7.0", "@backstage/integration-react": "^0.1.17", - "@backstage/plugin-catalog-react": "^0.6.9", + "@backstage/plugin-catalog-react": "^0.6.10", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", @@ -56,9 +56,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx index f441554119..077d99c4ba 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.tsx @@ -25,7 +25,7 @@ import { Box, FormHelperText, Grid, Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import React, { useCallback, useEffect, useState } from 'react'; import { UnpackNestedValue, UseFormReturn } from 'react-hook-form'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import YAML from 'yaml'; import { AnalyzeResult, catalogImportApiRef } from '../../api'; import { PartialEntity } from '../../types'; diff --git a/plugins/catalog-react/CHANGELOG.md b/plugins/catalog-react/CHANGELOG.md index 8db0fd7573..e15a9d1c13 100644 --- a/plugins/catalog-react/CHANGELOG.md +++ b/plugins/catalog-react/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-catalog-react +## 0.6.10 + +### Patch Changes + +- fe2a6532ff: Add Override Components for Components in @backstage/plugin-catalog-react +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.6.9 ### Patch Changes diff --git a/plugins/catalog-react/api-report.md b/plugins/catalog-react/api-report.md index d5cf06107c..673d9256f1 100644 --- a/plugins/catalog-react/api-report.md +++ b/plugins/catalog-react/api-report.md @@ -19,12 +19,14 @@ import { IconButton } from '@material-ui/core'; import { IdentityApi } from '@backstage/core-plugin-api'; import { LinkProps } from '@backstage/core-components'; import { Observable } from '@backstage/types'; +import { Overrides } from '@material-ui/core/styles/overrides'; import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; import { ReactNode } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { StorageApi } from '@backstage/core-plugin-api'; +import { StyleRules } from '@material-ui/core/styles/withStyles'; import { SystemEntity } from '@backstage/catalog-model'; import { TableColumn } from '@backstage/core-components'; import { UserEntity } from '@backstage/catalog-model'; @@ -52,6 +54,13 @@ export interface AsyncEntityProviderProps { refresh?: VoidFunction; } +// @public (undocumented) +export type BackstageOverrides = Overrides & { + [Name in keyof CatalogReactComponentsNameToClassKey]?: Partial< + StyleRules + >; +}; + export { CATALOG_FILTER_EXISTS }; export { CatalogApi }; @@ -61,6 +70,35 @@ export { CatalogApi }; // @public (undocumented) export const catalogApiRef: ApiRef; +// @public (undocumented) +export type CatalogReactComponentsNameToClassKey = { + CatalogReactUserListPicker: CatalogReactUserListPickerClassKey; + CatalogReactEntityLifecyclePicker: CatalogReactEntityLifecyclePickerClassKey; + CatalogReactEntitySearchBar: CatalogReactEntitySearchBarClassKey; + CatalogReactEntityTagPicker: CatalogReactEntityTagPickerClassKey; + CatalogReactEntityOwnerPicker: CatalogReactEntityOwnerPickerClassKey; +}; + +// @public (undocumented) +export type CatalogReactEntityLifecyclePickerClassKey = 'input'; + +// @public (undocumented) +export type CatalogReactEntityOwnerPickerClassKey = 'input'; + +// @public (undocumented) +export type CatalogReactEntitySearchBarClassKey = 'searchToolbar' | 'input'; + +// @public (undocumented) +export type CatalogReactEntityTagPickerClassKey = 'input'; + +// @public (undocumented) +export type CatalogReactUserListPickerClassKey = + | 'root' + | 'title' + | 'listIcon' + | 'menuItem' + | 'groupWrapper'; + // Warning: (ae-missing-release-tag) "catalogRouteRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 912ef5f653..6b76ec3925 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-react", "description": "A frontend library that helps other Backstage plugins interact with the catalog", - "version": "0.6.9", + "version": "0.6.10", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -31,8 +31,8 @@ "dependencies": { "@backstage/catalog-client": "^0.5.3", "@backstage/catalog-model": "^0.9.8", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.4", "@backstage/integration": "^0.7.0", "@backstage/types": "^0.1.1", @@ -52,8 +52,8 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx b/plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx index 750692ed2e..630b1700a0 100644 --- a/plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx +++ b/plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx @@ -31,6 +31,9 @@ import React, { useEffect, useMemo, useState } from 'react'; import { useEntityListProvider } from '../../hooks/useEntityListProvider'; import { EntityLifecycleFilter } from '../../filters'; +/** @public */ +export type CatalogReactEntityLifecyclePickerClassKey = 'input'; + const useStyles = makeStyles( { input: {}, diff --git a/plugins/catalog-react/src/components/EntityLifecyclePicker/index.ts b/plugins/catalog-react/src/components/EntityLifecyclePicker/index.ts index 4b8cfb282d..def25eabf4 100644 --- a/plugins/catalog-react/src/components/EntityLifecyclePicker/index.ts +++ b/plugins/catalog-react/src/components/EntityLifecyclePicker/index.ts @@ -15,3 +15,4 @@ */ export { EntityLifecyclePicker } from './EntityLifecyclePicker'; +export type { CatalogReactEntityLifecyclePickerClassKey } from './EntityLifecyclePicker'; diff --git a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.tsx b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.tsx index dbf6a33164..ae88858666 100644 --- a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.tsx +++ b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.tsx @@ -33,6 +33,9 @@ import { EntityOwnerFilter } from '../../filters'; import { getEntityRelations } from '../../utils'; import { formatEntityRefTitle } from '../EntityRefLink'; +/** @public */ +export type CatalogReactEntityOwnerPickerClassKey = 'input'; + const useStyles = makeStyles( { input: {}, diff --git a/plugins/catalog-react/src/components/EntityOwnerPicker/index.ts b/plugins/catalog-react/src/components/EntityOwnerPicker/index.ts index f30928718b..c20db945f7 100644 --- a/plugins/catalog-react/src/components/EntityOwnerPicker/index.ts +++ b/plugins/catalog-react/src/components/EntityOwnerPicker/index.ts @@ -15,3 +15,4 @@ */ export { EntityOwnerPicker } from './EntityOwnerPicker'; +export type { CatalogReactEntityOwnerPickerClassKey } from './EntityOwnerPicker'; diff --git a/plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx b/plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx index 3a848591a3..79b2ee36bf 100644 --- a/plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx +++ b/plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx @@ -25,10 +25,13 @@ import { import Clear from '@material-ui/icons/Clear'; import Search from '@material-ui/icons/Search'; import React, { useState } from 'react'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { useEntityListProvider } from '../../hooks/useEntityListProvider'; import { EntityTextFilter } from '../../filters'; +/** @public */ +export type CatalogReactEntitySearchBarClassKey = 'searchToolbar' | 'input'; + const useStyles = makeStyles( _theme => ({ searchToolbar: { diff --git a/plugins/catalog-react/src/components/EntitySearchBar/index.ts b/plugins/catalog-react/src/components/EntitySearchBar/index.ts index 044b8ee416..e82c06d94e 100644 --- a/plugins/catalog-react/src/components/EntitySearchBar/index.ts +++ b/plugins/catalog-react/src/components/EntitySearchBar/index.ts @@ -15,3 +15,4 @@ */ export { EntitySearchBar } from './EntitySearchBar'; +export type { CatalogReactEntitySearchBarClassKey } from './EntitySearchBar'; diff --git a/plugins/catalog-react/src/components/EntityTagPicker/EntityTagPicker.tsx b/plugins/catalog-react/src/components/EntityTagPicker/EntityTagPicker.tsx index 9e00f7e7b0..a25c50c0a9 100644 --- a/plugins/catalog-react/src/components/EntityTagPicker/EntityTagPicker.tsx +++ b/plugins/catalog-react/src/components/EntityTagPicker/EntityTagPicker.tsx @@ -31,6 +31,9 @@ import React, { useEffect, useMemo, useState } from 'react'; import { useEntityListProvider } from '../../hooks/useEntityListProvider'; import { EntityTagFilter } from '../../filters'; +/** @public */ +export type CatalogReactEntityTagPickerClassKey = 'input'; + const useStyles = makeStyles( { input: {}, diff --git a/plugins/catalog-react/src/components/EntityTagPicker/index.ts b/plugins/catalog-react/src/components/EntityTagPicker/index.ts index cb8d418a41..c982d33df0 100644 --- a/plugins/catalog-react/src/components/EntityTagPicker/index.ts +++ b/plugins/catalog-react/src/components/EntityTagPicker/index.ts @@ -15,3 +15,4 @@ */ export { EntityTagPicker } from './EntityTagPicker'; +export type { CatalogReactEntityTagPickerClassKey } from './EntityTagPicker'; diff --git a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts index ae0a323d36..7f75016e16 100644 --- a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts +++ b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts @@ -22,7 +22,7 @@ import { } from '@backstage/catalog-model'; import { catalogApiRef } from '../../api'; import { useCallback } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; /** diff --git a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.tsx b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.tsx index 9aafdf1437..8746752b08 100644 --- a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.tsx @@ -43,6 +43,14 @@ import { import { UserListFilterKind } from '../../types'; import { reduceEntityFilters } from '../../utils'; +/** @public */ +export type CatalogReactUserListPickerClassKey = + | 'root' + | 'title' + | 'listIcon' + | 'menuItem' + | 'groupWrapper'; + const useStyles = makeStyles( theme => ({ root: { diff --git a/plugins/catalog-react/src/components/UserListPicker/index.ts b/plugins/catalog-react/src/components/UserListPicker/index.ts index 0bacaee8ca..45cb471197 100644 --- a/plugins/catalog-react/src/components/UserListPicker/index.ts +++ b/plugins/catalog-react/src/components/UserListPicker/index.ts @@ -15,3 +15,4 @@ */ export { UserListPicker } from './UserListPicker'; +export type { CatalogReactUserListPickerClassKey } from './UserListPicker'; diff --git a/plugins/catalog-react/src/hooks/useEntity.tsx b/plugins/catalog-react/src/hooks/useEntity.tsx index bcb38bb807..6ad61a5d81 100644 --- a/plugins/catalog-react/src/hooks/useEntity.tsx +++ b/plugins/catalog-react/src/hooks/useEntity.tsx @@ -28,7 +28,7 @@ import React, { Context, } from 'react'; import { useNavigate } from 'react-router'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { catalogApiRef } from '../api'; import { useEntityCompoundName } from './useEntityCompoundName'; diff --git a/plugins/catalog-react/src/hooks/useEntityKinds.ts b/plugins/catalog-react/src/hooks/useEntityKinds.ts index 082e4a207d..1d5b2fec52 100644 --- a/plugins/catalog-react/src/hooks/useEntityKinds.ts +++ b/plugins/catalog-react/src/hooks/useEntityKinds.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { catalogApiRef } from '../api'; diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx index a4e5f6b2ee..fb8eb7279f 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.tsx @@ -25,7 +25,9 @@ import React, { useMemo, useState, } from 'react'; -import { useAsyncFn, useDebounce, useMountedState } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; +import useDebounce from 'react-use/lib/useDebounce'; +import useMountedState from 'react-use/lib/useMountedState'; import { catalogApiRef } from '../api'; import { EntityKindFilter, diff --git a/plugins/catalog-react/src/hooks/useEntityOwnership.ts b/plugins/catalog-react/src/hooks/useEntityOwnership.ts index 54e9e0ff99..672b41cf33 100644 --- a/plugins/catalog-react/src/hooks/useEntityOwnership.ts +++ b/plugins/catalog-react/src/hooks/useEntityOwnership.ts @@ -30,7 +30,7 @@ import { } from '@backstage/core-plugin-api'; import jwtDecoder from 'jwt-decode'; import { useMemo } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { catalogApiRef } from '../api'; import { getEntityRelations } from '../utils/getEntityRelations'; diff --git a/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx b/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx index bf5777becc..5c0139dd26 100644 --- a/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx +++ b/plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx @@ -15,7 +15,7 @@ */ import { useEffect, useMemo, useRef, useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import isEqual from 'lodash/isEqual'; import { useApi } from '@backstage/core-plugin-api'; import { catalogApiRef } from '../api'; diff --git a/plugins/catalog-react/src/hooks/useOwnUser.ts b/plugins/catalog-react/src/hooks/useOwnUser.ts index f630549b0d..3df51f885f 100644 --- a/plugins/catalog-react/src/hooks/useOwnUser.ts +++ b/plugins/catalog-react/src/hooks/useOwnUser.ts @@ -15,8 +15,7 @@ */ import { UserEntity } from '@backstage/catalog-model'; -import { useAsync } from 'react-use'; -import { AsyncState } from 'react-use/lib/useAsync'; +import useAsync, { AsyncState } from 'react-use/lib/useAsync'; import { catalogApiRef } from '../api'; import { identityApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/catalog-react/src/hooks/useOwnedEntities.ts b/plugins/catalog-react/src/hooks/useOwnedEntities.ts index f9191364cb..ffe64830f4 100644 --- a/plugins/catalog-react/src/hooks/useOwnedEntities.ts +++ b/plugins/catalog-react/src/hooks/useOwnedEntities.ts @@ -21,7 +21,7 @@ import { import { identityApiRef, useApi } from '@backstage/core-plugin-api'; import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model'; import { CatalogListResponse } from '@backstage/catalog-client'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useMemo } from 'react'; /** diff --git a/plugins/catalog-react/src/hooks/useRelatedEntities.ts b/plugins/catalog-react/src/hooks/useRelatedEntities.ts index d15211f158..942941e3d5 100644 --- a/plugins/catalog-react/src/hooks/useRelatedEntities.ts +++ b/plugins/catalog-react/src/hooks/useRelatedEntities.ts @@ -16,7 +16,7 @@ import { Entity, EntityRelation } from '@backstage/catalog-model'; import { useApi } from '@backstage/core-plugin-api'; import { chunk, groupBy } from 'lodash'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { catalogApiRef } from '../api'; const BATCH_SIZE = 20; diff --git a/plugins/catalog-react/src/hooks/useStarredEntities.ts b/plugins/catalog-react/src/hooks/useStarredEntities.ts index 8f6b09614f..066040bf02 100644 --- a/plugins/catalog-react/src/hooks/useStarredEntities.ts +++ b/plugins/catalog-react/src/hooks/useStarredEntities.ts @@ -21,7 +21,7 @@ import { } from '@backstage/catalog-model'; import { useApi } from '@backstage/core-plugin-api'; import { useCallback } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import { starredEntitiesApiRef } from '../apis'; function getEntityRef(entityOrRef: Entity | EntityName | string): string { diff --git a/plugins/catalog-react/src/index.ts b/plugins/catalog-react/src/index.ts index cf7a679f7a..7bf1bd1221 100644 --- a/plugins/catalog-react/src/index.ts +++ b/plugins/catalog-react/src/index.ts @@ -37,3 +37,4 @@ export { export * from './testUtils'; export * from './types'; export * from './utils'; +export * from './overridableComponents'; diff --git a/plugins/catalog-react/src/overridableComponents.ts b/plugins/catalog-react/src/overridableComponents.ts new file mode 100644 index 0000000000..1e654988e4 --- /dev/null +++ b/plugins/catalog-react/src/overridableComponents.ts @@ -0,0 +1,41 @@ +/* + * 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 { Overrides } from '@material-ui/core/styles/overrides'; +import { StyleRules } from '@material-ui/core/styles/withStyles'; + +import { + CatalogReactUserListPickerClassKey, + CatalogReactEntityLifecyclePickerClassKey, + CatalogReactEntitySearchBarClassKey, + CatalogReactEntityTagPickerClassKey, + CatalogReactEntityOwnerPickerClassKey, +} from './components'; + +/** @public */ +export type CatalogReactComponentsNameToClassKey = { + CatalogReactUserListPicker: CatalogReactUserListPickerClassKey; + CatalogReactEntityLifecyclePicker: CatalogReactEntityLifecyclePickerClassKey; + CatalogReactEntitySearchBar: CatalogReactEntitySearchBarClassKey; + CatalogReactEntityTagPicker: CatalogReactEntityTagPickerClassKey; + CatalogReactEntityOwnerPicker: CatalogReactEntityOwnerPickerClassKey; +}; + +/** @public */ +export type BackstageOverrides = Overrides & { + [Name in keyof CatalogReactComponentsNameToClassKey]?: Partial< + StyleRules + >; +}; diff --git a/plugins/catalog/CHANGELOG.md b/plugins/catalog/CHANGELOG.md index 2e626caf20..e33eccb116 100644 --- a/plugins/catalog/CHANGELOG.md +++ b/plugins/catalog/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-catalog +## 0.7.7 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- 11b81683a9: Support customizing index page layouts via outlets +- e195390974: Allow entities from `file` locations to be manually refreshed through the UI +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.7.6 ### Patch Changes diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 80271c89af..c046e031de 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -126,15 +126,10 @@ export class CatalogClientWrapper implements CatalogApi { // @public (undocumented) export const CatalogEntityPage: () => JSX.Element; -// Warning: (ae-forgotten-export) The symbol "CatalogPageProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "CatalogIndexPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const CatalogIndexPage: ({ - columns, - actions, - initiallySelectedFilter, -}: CatalogPageProps) => JSX.Element; +export const CatalogIndexPage: (props: DefaultCatalogPageProps) => JSX.Element; // Warning: (ae-forgotten-export) The symbol "CatalogKindHeaderProps" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "CatalogKindHeader" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -236,6 +231,13 @@ export function createSystemColumn(): TableColumn; // @public (undocumented) export function createTagsColumn(): TableColumn; +// @public +export type DefaultCatalogPageProps = { + initiallySelectedFilter?: UserListFilterKind; + columns?: TableColumn[]; + actions?: TableProps['actions']; +}; + // Warning: (ae-missing-release-tag) "EntityAboutCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 83720b9a90..da7f666b35 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog", "description": "The Backstage plugin for browsing the Backstage catalog", - "version": "0.7.6", + "version": "0.7.7", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,11 +33,11 @@ "dependencies": { "@backstage/catalog-client": "^0.5.3", "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.3", "@backstage/integration-react": "^0.1.17", - "@backstage/plugin-catalog-react": "^0.6.9", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -53,9 +53,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx index afbed3bdc7..4ef97b3d46 100644 --- a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx @@ -43,6 +43,10 @@ describe('', () => { refreshEntity: jest.fn(), } as any; + beforeEach(() => { + jest.clearAllMocks(); + }); + it('renders info', async () => { const entity = { apiVersion: 'v1', @@ -248,14 +252,16 @@ describe('', () => { expect(getByText('View Source').closest('a')).not.toHaveAttribute('href'); }); - it('triggers a refresh', async () => { + it.each([ + 'url:https://backstage.io/catalog-info.yaml', + 'file:../../catalog-info.yaml', + ])('triggers a refresh for %s', async location => { const entity = { apiVersion: 'v1', kind: 'Component', metadata: { annotations: { - 'backstage.io/managed-by-location': - 'url:https://backstage.io/catalog-info.yaml', + 'backstage.io/managed-by-location': location, }, name: 'software', }, @@ -298,7 +304,7 @@ describe('', () => { ); }); - it('should not render refresh button if the location is not an url', async () => { + it('should not render refresh button if the location is not an url or file', async () => { const entity = { apiVersion: 'v1', kind: 'Component', diff --git a/plugins/catalog/src/components/AboutCard/AboutCard.tsx b/plugins/catalog/src/components/AboutCard/AboutCard.tsx index 7e44ae4efb..a6c9635db2 100644 --- a/plugins/catalog/src/components/AboutCard/AboutCard.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutCard.tsx @@ -127,8 +127,10 @@ export function AboutCard({ variant }: AboutCardProps) { cardContentClass = classes.fullHeightCardContent; } - const isUrl = - entity.metadata.annotations?.[LOCATION_ANNOTATION]?.startsWith('url:'); + const entityLocation = entity.metadata.annotations?.[LOCATION_ANNOTATION]; + // Limiting the ability to manually refresh to the less expensive locations + const allowRefresh = + entityLocation?.startsWith('url:') || entityLocation?.startsWith('file:'); const refreshEntity = useCallback(async () => { await catalogApi.refreshEntity(stringifyEntityRef(entity)); alertApi.post({ message: 'Refresh scheduled', severity: 'info' }); @@ -140,7 +142,7 @@ export function AboutCard({ variant }: AboutCardProps) { title="About" action={ <> - {isUrl && ( + {allowRefresh && ( ({ + ...jest.requireActual('react-router'), + useOutlet: jest.fn().mockReturnValue('Route Children'), +})); + +jest.mock('./DefaultCatalogPage', () => ({ + DefaultCatalogPage: jest.fn().mockReturnValue('DefaultCatalogPage'), +})); + describe('CatalogPage', () => { - const origReplaceState = window.history.replaceState; - beforeEach(() => { - window.history.replaceState = jest.fn(); - }); - afterEach(() => { - window.history.replaceState = origReplaceState; + it('renders provided router element', async () => { + const { getByText } = await renderInTestApp(); + + expect(getByText('Route Children')).toBeInTheDocument(); }); - const catalogApi: Partial = { - getEntities: () => - Promise.resolve({ - items: [ - { - apiVersion: 'backstage.io/v1alpha1', - kind: 'Component', - metadata: { - name: 'Entity1', - }, - spec: { - owner: 'tools', - type: 'service', - }, - relations: [ - { - type: RELATION_OWNED_BY, - target: { kind: 'Group', name: 'tools', namespace: 'default' }, - }, - ], - }, - { - apiVersion: 'backstage.io/v1alpha1', - kind: 'Component', - metadata: { - name: 'Entity2', - }, - spec: { - owner: 'not-tools', - type: 'service', - }, - relations: [ - { - type: RELATION_OWNED_BY, - target: { - kind: 'Group', - name: 'not-tools', - namespace: 'default', - }, - }, - ], - }, - ] as Entity[], - }), - getLocationByEntity: () => - Promise.resolve({ id: 'id', type: 'github', target: 'url' }), - getEntityByName: async entityName => { - return { - apiVersion: 'backstage.io/v1alpha1', - kind: 'User', - metadata: { name: entityName.name }, - relations: [ - { - type: RELATION_MEMBER_OF, - target: { namespace: 'default', kind: 'Group', name: 'tools' }, - }, - ], - }; - }, - }; - const testProfile: Partial = { - displayName: 'Display Name', - }; - const identityApi: Partial = { - getUserId: () => 'tools', - getIdToken: async () => undefined, - getProfile: () => testProfile, - }; - const storageApi = MockStorageApi.create(); + it('renders DefaultCatalogPage home when no router children are provided', async () => { + (useOutlet as jest.Mock).mockReturnValueOnce(null); + const { getByText } = await renderInTestApp(); - const renderWrapped = (children: React.ReactNode) => - renderWithEffects( - wrapInTestApp( - - {children} - , - { - mountedRoutes: { - '/create': createComponentRouteRef, - '/catalog/:namespace/:kind/:name': entityRouteRef, - }, - }, - ), - ); - - // TODO(freben): The test timeouts are bumped in this file, because it seems - // page and table rerenders accumulate to occasionally go over the default - // limit. We should investigate why these timeouts happen. - - it('should render the default column of the grid', async () => { - const { getAllByRole } = await renderWrapped(); - - const columnHeader = getAllByRole('button').filter( - c => c.tagName === 'SPAN', - ); - const columnHeaderLabels = columnHeader.map(c => c.textContent); - - expect(columnHeaderLabels).toEqual([ - 'Name', - 'System', - 'Owner', - 'Type', - 'Lifecycle', - 'Description', - 'Tags', - 'Actions', - ]); - }, 20_000); - - it('should render the custom column passed as prop', async () => { - const columns: TableColumn[] = [ - { title: 'Foo', field: 'entity.foo' }, - { title: 'Bar', field: 'entity.bar' }, - { title: 'Baz', field: 'entity.spec.lifecycle' }, - ]; - const { getAllByRole } = await renderWrapped( - , - ); - - const columnHeader = getAllByRole('button').filter( - c => c.tagName === 'SPAN', - ); - const columnHeaderLabels = columnHeader.map(c => c.textContent); - expect(columnHeaderLabels).toEqual(['Foo', 'Bar', 'Baz', 'Actions']); - }, 20_000); - - it('should render the default actions of an item in the grid', async () => { - const { getByTestId, findByTitle, findByText } = await renderWrapped( - , - ); - fireEvent.click(getByTestId('user-picker-owned')); - expect(await findByText(/Owned \(1\)/)).toBeInTheDocument(); - expect(await findByTitle(/View/)).toBeInTheDocument(); - expect(await findByTitle(/Edit/)).toBeInTheDocument(); - expect(await findByTitle(/Add to favorites/)).toBeInTheDocument(); - }, 20_000); - - it('should render the custom actions of an item passed as prop', async () => { - const actions: TableProps['actions'] = [ - () => { - return { - icon: () => , - tooltip: 'Foo Action', - disabled: false, - onClick: () => jest.fn(), - }; - }, - () => { - return { - icon: () => , - tooltip: 'Bar Action', - disabled: true, - onClick: () => jest.fn(), - }; - }, - ]; - - const { getByTestId, findByTitle, findByText } = await renderWrapped( - , - ); - fireEvent.click(getByTestId('user-picker-owned')); - expect(await findByText(/Owned \(1\)/)).toBeInTheDocument(); - expect(await findByTitle(/Foo Action/)).toBeInTheDocument(); - expect(await findByTitle(/Bar Action/)).toBeInTheDocument(); - expect((await findByTitle(/Bar Action/)).firstChild).toBeDisabled(); - }, 20_000); - - // this test right now causes some red lines in the log output when running tests - // related to some theme issues in mui-table - // https://github.com/mbrn/material-table/issues/1293 - it('should render', async () => { - const { findByText, getByTestId } = await renderWrapped(); - fireEvent.click(getByTestId('user-picker-owned')); - await expect(findByText(/Owned \(1\)/)).resolves.toBeInTheDocument(); - fireEvent.click(getByTestId('user-picker-all')); - await expect(findByText(/All \(2\)/)).resolves.toBeInTheDocument(); - }, 20_000); - - it('should set initial filter correctly', async () => { - const { findByText } = await renderWrapped( - , - ); - await expect(findByText(/All \(2\)/)).resolves.toBeInTheDocument(); - }, 20_000); - - // this test is for fixing the bug after favoriting an entity, the matching - // entities defaulting to "owned" filter and not based on the selected filter - it('should render the correct entities filtered on the selected filter', async () => { - const { getByTestId } = await renderWrapped(); - fireEvent.click(getByTestId('user-picker-owned')); - await expect(screen.findByText(/Owned \(1\)/)).resolves.toBeInTheDocument(); - fireEvent.click(screen.getByTestId('user-picker-starred')); - await expect( - screen.findByText(/Starred \(0\)/), - ).resolves.toBeInTheDocument(); - fireEvent.click(screen.getByTestId('user-picker-all')); - await expect(screen.findByText(/All \(2\)/)).resolves.toBeInTheDocument(); - - const starredIcons = await screen.findAllByTitle('Add to favorites'); - fireEvent.click(starredIcons[0]); - await expect(screen.findByText(/All \(2\)/)).resolves.toBeInTheDocument(); - - fireEvent.click(screen.getByTestId('user-picker-starred')); - await expect( - screen.findByText(/Starred \(1\)/), - ).resolves.toBeInTheDocument(); - }, 20_000); - - 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(); - }, 20_000); + expect(getByText('DefaultCatalogPage')).toBeInTheDocument(); + }); }); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index ec29d3839b..cf49cff244 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Backstage Authors + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,76 +14,15 @@ * limitations under the License. */ -import { - Content, - ContentHeader, - CreateButton, - PageWithHeader, - SupportButton, - TableColumn, - TableProps, -} from '@backstage/core-components'; -import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; -import { - EntityLifecyclePicker, - EntityListProvider, - EntityOwnerPicker, - EntityTagPicker, - EntityTypePicker, - UserListFilterKind, - UserListPicker, -} from '@backstage/plugin-catalog-react'; import React from 'react'; -import { createComponentRouteRef } from '../../routes'; -import { CatalogTable } from '../CatalogTable'; -import { EntityRow } from '../CatalogTable/types'; +import { useOutlet } from 'react-router'; import { - FilteredEntityLayout, - EntityListContainer, - FilterContainer, -} from '../FilteredEntityLayout'; -import { CatalogKindHeader } from '../CatalogKindHeader'; + DefaultCatalogPage, + DefaultCatalogPageProps, +} from './DefaultCatalogPage'; -export type CatalogPageProps = { - initiallySelectedFilter?: UserListFilterKind; - columns?: TableColumn[]; - actions?: TableProps['actions']; -}; - -export const CatalogPage = ({ - columns, - actions, - initiallySelectedFilter = 'owned', -}: CatalogPageProps) => { - const orgName = - useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; - const createComponentLink = useRouteRef(createComponentRouteRef); - - return ( - - - - }> - - All your software catalog entities - - - - - - - - - - - - - - - - - ); +export const CatalogPage = (props: DefaultCatalogPageProps) => { + const outlet = useOutlet(); + + return outlet || ; }; diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx new file mode 100644 index 0000000000..5f21ba364b --- /dev/null +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx @@ -0,0 +1,287 @@ +/* + * 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 { CatalogApi } from '@backstage/catalog-client'; +import { + Entity, + RELATION_MEMBER_OF, + RELATION_OWNED_BY, +} from '@backstage/catalog-model'; +import { TableColumn, TableProps } from '@backstage/core-components'; +import { + IdentityApi, + identityApiRef, + ProfileInfo, + storageApiRef, +} from '@backstage/core-plugin-api'; +import { + catalogApiRef, + DefaultStarredEntitiesApi, + entityRouteRef, + starredEntitiesApiRef, +} from '@backstage/plugin-catalog-react'; +import { + mockBreakpoint, + MockStorageApi, + renderWithEffects, + TestApiProvider, + wrapInTestApp, +} from '@backstage/test-utils'; +import DashboardIcon from '@material-ui/icons/Dashboard'; +import { fireEvent, screen } from '@testing-library/react'; +import React from 'react'; +import { createComponentRouteRef } from '../../routes'; +import { EntityRow } from '../CatalogTable'; +import { DefaultCatalogPage } from './DefaultCatalogPage'; + +describe('DefaultCatalogPage', () => { + const origReplaceState = window.history.replaceState; + beforeEach(() => { + window.history.replaceState = jest.fn(); + }); + afterEach(() => { + window.history.replaceState = origReplaceState; + }); + + const catalogApi: Partial = { + getEntities: () => + Promise.resolve({ + items: [ + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Component', + metadata: { + name: 'Entity1', + }, + spec: { + owner: 'tools', + type: 'service', + }, + relations: [ + { + type: RELATION_OWNED_BY, + target: { kind: 'Group', name: 'tools', namespace: 'default' }, + }, + ], + }, + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Component', + metadata: { + name: 'Entity2', + }, + spec: { + owner: 'not-tools', + type: 'service', + }, + relations: [ + { + type: RELATION_OWNED_BY, + target: { + kind: 'Group', + name: 'not-tools', + namespace: 'default', + }, + }, + ], + }, + ] as Entity[], + }), + getLocationByEntity: () => + Promise.resolve({ id: 'id', type: 'github', target: 'url' }), + getEntityByName: async entityName => { + return { + apiVersion: 'backstage.io/v1alpha1', + kind: 'User', + metadata: { name: entityName.name }, + relations: [ + { + type: RELATION_MEMBER_OF, + target: { namespace: 'default', kind: 'Group', name: 'tools' }, + }, + ], + }; + }, + }; + const testProfile: Partial = { + displayName: 'Display Name', + }; + const identityApi: Partial = { + getUserId: () => 'tools', + getIdToken: async () => undefined, + getProfile: () => testProfile, + }; + const storageApi = MockStorageApi.create(); + + const renderWrapped = (children: React.ReactNode) => + renderWithEffects( + wrapInTestApp( + + {children} + , + { + mountedRoutes: { + '/create': createComponentRouteRef, + '/catalog/:namespace/:kind/:name': entityRouteRef, + }, + }, + ), + ); + + // TODO(freben): The test timeouts are bumped in this file, because it seems + // page and table rerenders accumulate to occasionally go over the default + // limit. We should investigate why these timeouts happen. + + it('should render the default column of the grid', async () => { + const { getAllByRole } = await renderWrapped(); + + const columnHeader = getAllByRole('button').filter( + c => c.tagName === 'SPAN', + ); + const columnHeaderLabels = columnHeader.map(c => c.textContent); + + expect(columnHeaderLabels).toEqual([ + 'Name', + 'System', + 'Owner', + 'Type', + 'Lifecycle', + 'Description', + 'Tags', + 'Actions', + ]); + }, 20_000); + + it('should render the custom column passed as prop', async () => { + const columns: TableColumn[] = [ + { title: 'Foo', field: 'entity.foo' }, + { title: 'Bar', field: 'entity.bar' }, + { title: 'Baz', field: 'entity.spec.lifecycle' }, + ]; + const { getAllByRole } = await renderWrapped( + , + ); + + const columnHeader = getAllByRole('button').filter( + c => c.tagName === 'SPAN', + ); + const columnHeaderLabels = columnHeader.map(c => c.textContent); + expect(columnHeaderLabels).toEqual(['Foo', 'Bar', 'Baz', 'Actions']); + }, 20_000); + + it('should render the default actions of an item in the grid', async () => { + const { getByTestId, findByTitle, findByText } = await renderWrapped( + , + ); + fireEvent.click(getByTestId('user-picker-owned')); + expect(await findByText(/Owned \(1\)/)).toBeInTheDocument(); + expect(await findByTitle(/View/)).toBeInTheDocument(); + expect(await findByTitle(/Edit/)).toBeInTheDocument(); + expect(await findByTitle(/Add to favorites/)).toBeInTheDocument(); + }, 20_000); + + it('should render the custom actions of an item passed as prop', async () => { + const actions: TableProps['actions'] = [ + () => { + return { + icon: () => , + tooltip: 'Foo Action', + disabled: false, + onClick: () => jest.fn(), + }; + }, + () => { + return { + icon: () => , + tooltip: 'Bar Action', + disabled: true, + onClick: () => jest.fn(), + }; + }, + ]; + + const { getByTestId, findByTitle, findByText } = await renderWrapped( + , + ); + fireEvent.click(getByTestId('user-picker-owned')); + expect(await findByText(/Owned \(1\)/)).toBeInTheDocument(); + expect(await findByTitle(/Foo Action/)).toBeInTheDocument(); + expect(await findByTitle(/Bar Action/)).toBeInTheDocument(); + expect((await findByTitle(/Bar Action/)).firstChild).toBeDisabled(); + }, 20_000); + + // this test right now causes some red lines in the log output when running tests + // related to some theme issues in mui-table + // https://github.com/mbrn/material-table/issues/1293 + it('should render', async () => { + const { findByText, getByTestId } = await renderWrapped( + , + ); + fireEvent.click(getByTestId('user-picker-owned')); + await expect(findByText(/Owned \(1\)/)).resolves.toBeInTheDocument(); + fireEvent.click(getByTestId('user-picker-all')); + await expect(findByText(/All \(2\)/)).resolves.toBeInTheDocument(); + }, 20_000); + + it('should set initial filter correctly', async () => { + const { findByText } = await renderWrapped( + , + ); + await expect(findByText(/All \(2\)/)).resolves.toBeInTheDocument(); + }, 20_000); + + // this test is for fixing the bug after favoriting an entity, the matching + // entities defaulting to "owned" filter and not based on the selected filter + it('should render the correct entities filtered on the selected filter', async () => { + const { getByTestId } = await renderWrapped(); + fireEvent.click(getByTestId('user-picker-owned')); + await expect(screen.findByText(/Owned \(1\)/)).resolves.toBeInTheDocument(); + fireEvent.click(screen.getByTestId('user-picker-starred')); + await expect( + screen.findByText(/Starred \(0\)/), + ).resolves.toBeInTheDocument(); + fireEvent.click(screen.getByTestId('user-picker-all')); + await expect(screen.findByText(/All \(2\)/)).resolves.toBeInTheDocument(); + + const starredIcons = await screen.findAllByTitle('Add to favorites'); + fireEvent.click(starredIcons[0]); + await expect(screen.findByText(/All \(2\)/)).resolves.toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('user-picker-starred')); + await expect( + screen.findByText(/Starred \(1\)/), + ).resolves.toBeInTheDocument(); + }, 20_000); + + 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(); + }, 20_000); +}); diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx new file mode 100644 index 0000000000..1453a39bbc --- /dev/null +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx @@ -0,0 +1,93 @@ +/* + * 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 { + Content, + ContentHeader, + CreateButton, + PageWithHeader, + SupportButton, + TableColumn, + TableProps, +} from '@backstage/core-components'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; +import { + EntityLifecyclePicker, + EntityListProvider, + EntityOwnerPicker, + EntityTagPicker, + EntityTypePicker, + UserListFilterKind, + UserListPicker, +} from '@backstage/plugin-catalog-react'; +import React from 'react'; +import { createComponentRouteRef } from '../../routes'; +import { CatalogTable } from '../CatalogTable'; +import { EntityRow } from '../CatalogTable/types'; +import { + FilteredEntityLayout, + EntityListContainer, + FilterContainer, +} from '../FilteredEntityLayout'; +import { CatalogKindHeader } from '../CatalogKindHeader'; + +/** + * DefaultCatalogPageProps + * @public + */ +export type DefaultCatalogPageProps = { + initiallySelectedFilter?: UserListFilterKind; + columns?: TableColumn[]; + actions?: TableProps['actions']; +}; + +export const DefaultCatalogPage = ({ + columns, + actions, + initiallySelectedFilter = 'owned', +}: DefaultCatalogPageProps) => { + const orgName = + useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; + const createComponentLink = useRouteRef(createComponentRouteRef); + + return ( + + + + }> + + All your software catalog entities + + + + + + + + + + + + + + + + + ); +}; diff --git a/plugins/catalog/src/components/CatalogPage/index.ts b/plugins/catalog/src/components/CatalogPage/index.ts index dc7ed68229..ca6a13c034 100644 --- a/plugins/catalog/src/components/CatalogPage/index.ts +++ b/plugins/catalog/src/components/CatalogPage/index.ts @@ -14,3 +14,5 @@ * limitations under the License. */ export { CatalogPage } from './CatalogPage'; +export { DefaultCatalogPage } from './DefaultCatalogPage'; +export type { DefaultCatalogPageProps } from './DefaultCatalogPage'; diff --git a/plugins/catalog/src/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.tsx b/plugins/catalog/src/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.tsx index 0efc9d5b03..8469c7d4e4 100644 --- a/plugins/catalog/src/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.tsx +++ b/plugins/catalog/src/components/EntityProcessingErrorsPanel/EntityProcessingErrorsPanel.tsx @@ -33,7 +33,7 @@ import { ENTITY_STATUS_CATALOG_PROCESSING_TYPE, } from '@backstage/catalog-client'; import { useApi, ApiHolder } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { SerializedError } from '@backstage/errors'; const errorFilter = (i: UNSTABLE_EntityStatusItem) => diff --git a/plugins/catalog/src/components/EntitySwitch/EntitySwitch.tsx b/plugins/catalog/src/components/EntitySwitch/EntitySwitch.tsx index 5c50c2507c..87ee81c5f4 100644 --- a/plugins/catalog/src/components/EntitySwitch/EntitySwitch.tsx +++ b/plugins/catalog/src/components/EntitySwitch/EntitySwitch.tsx @@ -23,7 +23,7 @@ import { useElementFilter, ApiHolder, } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; const ENTITY_SWITCH_KEY = 'core.backstage.entitySwitch'; diff --git a/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx b/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx index 984ae9f982..6c17e4ee67 100644 --- a/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx +++ b/plugins/catalog/src/components/SystemDiagramCard/SystemDiagramCard.tsx @@ -32,7 +32,7 @@ import { import { Box, makeStyles, Typography, useTheme } from '@material-ui/core'; import ZoomOutMap from '@material-ui/icons/ZoomOutMap'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { BackstageTheme } from '@backstage/theme'; import { diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index d804bbaf83..56cae80b6a 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -54,3 +54,4 @@ export { export type { EntityLinksEmptyStateClassKey } from './components/EntityLinksCard'; export type { SystemDiagramCardClassKey } from './components/SystemDiagramCard'; +export type { DefaultCatalogPageProps } from './components/CatalogPage'; diff --git a/plugins/circleci/CHANGELOG.md b/plugins/circleci/CHANGELOG.md index 75010bd1b6..a3b5de58c5 100644 --- a/plugins/circleci/CHANGELOG.md +++ b/plugins/circleci/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-circleci +## 0.2.33 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.2.32 ### Patch Changes diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index 7a6fda44e5..a7e05511db 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-circleci", "description": "A Backstage plugin that integrates towards Circle CI", - "version": "0.2.32", + "version": "0.2.33", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,9 +33,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -52,9 +52,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/circleci/src/state/useBuildWithSteps.ts b/plugins/circleci/src/state/useBuildWithSteps.ts index eb3c0c1506..4ba189f9d2 100644 --- a/plugins/circleci/src/state/useBuildWithSteps.ts +++ b/plugins/circleci/src/state/useBuildWithSteps.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useCallback, useMemo } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { circleCIApiRef } from '../api'; import { useAsyncPolling } from './useAsyncPolling'; import { useProjectSlugFromEntity, mapVcsType } from './useBuilds'; diff --git a/plugins/circleci/src/state/useBuilds.ts b/plugins/circleci/src/state/useBuilds.ts index 521a55e922..760c57d764 100644 --- a/plugins/circleci/src/state/useBuilds.ts +++ b/plugins/circleci/src/state/useBuilds.ts @@ -18,7 +18,7 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import { BuildSummary, GitType } from 'circleci-api'; import { getOr } from 'lodash/fp'; import { useCallback, useEffect, useState } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { circleCIApiRef } from '../api'; import type { CITableBuildInfo } from '../components/BuildsPage/lib/CITable'; import { CIRCLECI_ANNOTATION } from '../constants'; diff --git a/plugins/cloudbuild/CHANGELOG.md b/plugins/cloudbuild/CHANGELOG.md index 148756f615..cbd4c0bbfa 100644 --- a/plugins/cloudbuild/CHANGELOG.md +++ b/plugins/cloudbuild/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-cloudbuild +## 0.2.31 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.2.30 ### Patch Changes diff --git a/plugins/cloudbuild/package.json b/plugins/cloudbuild/package.json index 9c6c5586f7..d0075d683e 100644 --- a/plugins/cloudbuild/package.json +++ b/plugins/cloudbuild/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-cloudbuild", "description": "A Backstage plugin that integrates towards Google Cloud Build", - "version": "0.2.30", + "version": "0.2.31", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,9 +32,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -49,9 +49,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts index 0450d3d613..7b7ee2f407 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts +++ b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { ActionsListWorkflowRunsForRepoResponseData } from '../../api/types'; export const useWorkflowRunJobs = (jobsUrl?: string) => { diff --git a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts index c074a24a86..0b244f8b69 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts +++ b/plugins/cloudbuild/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { cloudbuildApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/cloudbuild/src/components/useProjectName.ts b/plugins/cloudbuild/src/components/useProjectName.ts index a0d19ba7dd..3f314aaa47 100644 --- a/plugins/cloudbuild/src/components/useProjectName.ts +++ b/plugins/cloudbuild/src/components/useProjectName.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; export const CLOUDBUILD_ANNOTATION = 'google.com/cloudbuild-project-slug'; diff --git a/plugins/cloudbuild/src/components/useWorkflowRuns.ts b/plugins/cloudbuild/src/components/useWorkflowRuns.ts index 3c4810d4f6..f2e107ea3f 100644 --- a/plugins/cloudbuild/src/components/useWorkflowRuns.ts +++ b/plugins/cloudbuild/src/components/useWorkflowRuns.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useState } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { cloudbuildApiRef } from '../api/CloudbuildApi'; import { ActionsListWorkflowRunsForRepoResponseData, diff --git a/plugins/code-coverage/CHANGELOG.md b/plugins/code-coverage/CHANGELOG.md index bc756dfaa0..6f10ecbbf4 100644 --- a/plugins/code-coverage/CHANGELOG.md +++ b/plugins/code-coverage/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-code-coverage +## 0.1.21 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.20 ### Patch Changes diff --git a/plugins/code-coverage/package.json b/plugins/code-coverage/package.json index 1fb00c7ba4..e6ddcdb5f1 100644 --- a/plugins/code-coverage/package.json +++ b/plugins/code-coverage/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-code-coverage", "description": "A Backstage plugin that helps you keep track of your code coverage", - "version": "0.1.20", + "version": "0.1.21", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -23,10 +23,10 @@ "dependencies": { "@backstage/catalog-model": "^0.9.7", "@backstage/config": "^0.1.11", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.4", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -43,9 +43,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx b/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx index e713eb7c6e..1e5341eb50 100644 --- a/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx +++ b/plugins/code-coverage/src/components/CoverageHistoryChart/CoverageHistoryChart.tsx @@ -30,7 +30,7 @@ import TrendingUpIcon from '@material-ui/icons/TrendingUp'; import { Alert } from '@material-ui/lab'; import { ClassNameMap } from '@material-ui/styles'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { CartesianGrid, Legend, diff --git a/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx b/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx index 06dbd19999..ac132c5a56 100644 --- a/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx +++ b/plugins/code-coverage/src/components/FileExplorer/FileContent.tsx @@ -18,7 +18,7 @@ import { useEntity } from '@backstage/plugin-catalog-react'; import { makeStyles, Paper } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { codeCoverageApiRef } from '../../api'; import { FileEntry } from '../../types'; import { CodeRow } from './CodeRow'; diff --git a/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx b/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx index 5f492edf70..790de6e00f 100644 --- a/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx +++ b/plugins/code-coverage/src/components/FileExplorer/FileExplorer.tsx @@ -26,7 +26,7 @@ import { import DescriptionIcon from '@material-ui/icons/Description'; import { Alert } from '@material-ui/lab'; import React, { Fragment, useEffect, useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { codeCoverageApiRef } from '../../api'; import { FileEntry } from '../../types'; import { FileContent } from './FileContent'; diff --git a/plugins/config-schema/CHANGELOG.md b/plugins/config-schema/CHANGELOG.md index ef52438281..20b8e258d5 100644 --- a/plugins/config-schema/CHANGELOG.md +++ b/plugins/config-schema/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-config-schema +## 0.1.17 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.1.16 ### Patch Changes diff --git a/plugins/config-schema/package.json b/plugins/config-schema/package.json index 03891b498c..85a088b20c 100644 --- a/plugins/config-schema/package.json +++ b/plugins/config-schema/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-config-schema", "description": "A Backstage plugin that lets you browse the configuration schema of your app", - "version": "0.1.16", + "version": "0.1.17", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,8 +22,8 @@ }, "dependencies": { "@backstage/config": "^0.1.11", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.5", "@backstage/theme": "^0.2.14", "@backstage/types": "^0.1.1", @@ -38,9 +38,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx b/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx index 2eae3805c2..5fb39c6ae3 100644 --- a/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx +++ b/plugins/config-schema/src/components/ConfigSchemaPage/ConfigSchemaPage.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React, { useMemo } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import { configSchemaApiRef } from '../../api'; import { SchemaViewer } from '../SchemaViewer'; import { Typography } from '@material-ui/core'; diff --git a/plugins/cost-insights/CHANGELOG.md b/plugins/cost-insights/CHANGELOG.md index 2e47db3bb8..d0a0eb400b 100644 --- a/plugins/cost-insights/CHANGELOG.md +++ b/plugins/cost-insights/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-cost-insights +## 0.11.16 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.11.15 ### Patch Changes diff --git a/plugins/cost-insights/package.json b/plugins/cost-insights/package.json index e1995f2e49..4f9c3f55ec 100644 --- a/plugins/cost-insights/package.json +++ b/plugins/cost-insights/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-cost-insights", "description": "A Backstage plugin that helps you keep track of your cloud spend", - "version": "0.11.15", + "version": "0.11.16", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,8 +32,8 @@ }, "dependencies": { "@backstage/config": "^0.1.10", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -56,9 +56,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/cost-insights/src/components/CopyUrlToClipboard/CopyUrlToClipboard.tsx b/plugins/cost-insights/src/components/CopyUrlToClipboard/CopyUrlToClipboard.tsx index 67ea368def..bef6f159de 100644 --- a/plugins/cost-insights/src/components/CopyUrlToClipboard/CopyUrlToClipboard.tsx +++ b/plugins/cost-insights/src/components/CopyUrlToClipboard/CopyUrlToClipboard.tsx @@ -16,7 +16,7 @@ import React, { useEffect, useState } from 'react'; import { useLocation } from 'react-router-dom'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; import { Tooltip, IconButton } from '@material-ui/core'; import AssignmentOutlinedIcon from '@material-ui/icons/AssignmentOutlined'; import AssignmentTurnedInOutlinedIcon from '@material-ui/icons/AssignmentTurnedInOutlined'; diff --git a/plugins/explore/CHANGELOG.md b/plugins/explore/CHANGELOG.md index 9c288deda0..2b0c42002f 100644 --- a/plugins/explore/CHANGELOG.md +++ b/plugins/explore/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-explore +## 0.3.24 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.3.23 ### Patch Changes diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 943fe915f7..424eb84eac 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-explore", "description": "A Backstage plugin for building an exploration page of your software ecosystem", - "version": "0.3.23", + "version": "0.3.24", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,9 +32,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/plugin-explore-react": "^0.0.9", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", @@ -50,9 +50,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx index 781d21bd91..ba495f6492 100644 --- a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx +++ b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.tsx @@ -17,7 +17,7 @@ import { DomainEntity } from '@backstage/catalog-model'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Button } from '@material-ui/core'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { DomainCard } from '../DomainCard'; import { diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx index 49a9481b15..36788ed1b6 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx @@ -39,7 +39,7 @@ import { makeStyles, Typography, useTheme } from '@material-ui/core'; import ZoomOutMap from '@material-ui/icons/ZoomOutMap'; import classNames from 'classnames'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; const useStyles = makeStyles((theme: BackstageTheme) => ({ graph: { diff --git a/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx b/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx index ec532f3004..db07bd0665 100644 --- a/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx +++ b/plugins/explore/src/components/ToolExplorerContent/ToolExplorerContent.tsx @@ -16,7 +16,7 @@ import { exploreToolsConfigRef } from '@backstage/plugin-explore-react'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { ToolCard } from '../ToolCard'; import { diff --git a/plugins/firehydrant/CHANGELOG.md b/plugins/firehydrant/CHANGELOG.md index cc2084467c..8d2e3b71d8 100644 --- a/plugins/firehydrant/CHANGELOG.md +++ b/plugins/firehydrant/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-firehydrant +## 0.1.11 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.10 ### Patch Changes diff --git a/plugins/firehydrant/package.json b/plugins/firehydrant/package.json index 5db5ce7018..118c64c11d 100644 --- a/plugins/firehydrant/package.json +++ b/plugins/firehydrant/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-firehydrant", "description": "A Backstage plugin that integrates towards FireHydrant", - "version": "0.1.10", + "version": "0.1.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,9 +22,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -36,9 +36,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/firehydrant/src/components/serviceAnalytics.ts b/plugins/firehydrant/src/components/serviceAnalytics.ts index ba88af86da..c37319d5ea 100644 --- a/plugins/firehydrant/src/components/serviceAnalytics.ts +++ b/plugins/firehydrant/src/components/serviceAnalytics.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { fireHydrantApiRef } from '../api'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/firehydrant/src/components/serviceDetails.ts b/plugins/firehydrant/src/components/serviceDetails.ts index b8cac2736a..9c12677577 100644 --- a/plugins/firehydrant/src/components/serviceDetails.ts +++ b/plugins/firehydrant/src/components/serviceDetails.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { fireHydrantApiRef } from '../api'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/fossa/CHANGELOG.md b/plugins/fossa/CHANGELOG.md index bb984eb282..7e62631d00 100644 --- a/plugins/fossa/CHANGELOG.md +++ b/plugins/fossa/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-fossa +## 0.2.26 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.2.25 ### Patch Changes diff --git a/plugins/fossa/package.json b/plugins/fossa/package.json index 80cc98a32a..ff5c063e15 100644 --- a/plugins/fossa/package.json +++ b/plugins/fossa/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-fossa", "description": "A Backstage plugin that integrates towards FOSSA", - "version": "0.2.25", + "version": "0.2.26", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,10 +33,10 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.3", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -50,9 +50,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/fossa/src/components/FossaCard/FossaCard.tsx b/plugins/fossa/src/components/FossaCard/FossaCard.tsx index 58ab3163fd..bbd5594fbc 100644 --- a/plugins/fossa/src/components/FossaCard/FossaCard.tsx +++ b/plugins/fossa/src/components/FossaCard/FossaCard.tsx @@ -19,7 +19,7 @@ import { Grid, Tooltip } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import { DateTime } from 'luxon'; import React, { PropsWithChildren } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { fossaApiRef } from '../../api'; import { FOSSA_PROJECT_NAME_ANNOTATION, diff --git a/plugins/fossa/src/components/FossaPage/FossaPage.tsx b/plugins/fossa/src/components/FossaPage/FossaPage.tsx index fbdaf85717..1b53546ccd 100644 --- a/plugins/fossa/src/components/FossaPage/FossaPage.tsx +++ b/plugins/fossa/src/components/FossaPage/FossaPage.tsx @@ -31,7 +31,8 @@ import { Skeleton } from '@material-ui/lab'; import { DateTime } from 'luxon'; import * as React from 'react'; import { useMemo, useState } from 'react'; -import { useAsync, useDeepCompareEffect } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useDeepCompareEffect from 'react-use/lib/useDeepCompareEffect'; import { FindingSummary, fossaApiRef } from '../../api'; import { getProjectName } from '../getProjectName'; diff --git a/plugins/gcp-projects/CHANGELOG.md b/plugins/gcp-projects/CHANGELOG.md index 029fb84c89..9da0972948 100644 --- a/plugins/gcp-projects/CHANGELOG.md +++ b/plugins/gcp-projects/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-gcp-projects +## 0.3.12 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.3.11 ### Patch Changes diff --git a/plugins/gcp-projects/package.json b/plugins/gcp-projects/package.json index 05b2976efb..1b36c4a112 100644 --- a/plugins/gcp-projects/package.json +++ b/plugins/gcp-projects/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-gcp-projects", "description": "A Backstage plugin that helps you manage projects in GCP", - "version": "0.3.11", + "version": "0.3.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -31,8 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -44,9 +44,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx b/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx index 446ef0ec5c..36247ac492 100644 --- a/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx +++ b/plugins/gcp-projects/src/components/ProjectDetailsPage/ProjectDetailsPage.tsx @@ -27,7 +27,7 @@ import { Typography, } from '@material-ui/core'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { gcpApiRef } from '../../api'; import { diff --git a/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx b/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx index b37dc2fa50..d5a57432b3 100644 --- a/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx +++ b/plugins/gcp-projects/src/components/ProjectListPage/ProjectListPage.tsx @@ -18,7 +18,7 @@ import { Button, LinearProgress, Tooltip, Typography } from '@material-ui/core'; import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { gcpApiRef, Project } from '../../api'; import { diff --git a/plugins/git-release-manager/CHANGELOG.md b/plugins/git-release-manager/CHANGELOG.md index 1f7dc43cbd..50ef4d5f26 100644 --- a/plugins/git-release-manager/CHANGELOG.md +++ b/plugins/git-release-manager/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-git-release-manager +## 0.3.7 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.3.6 ### Patch Changes diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json index 32fb6bba1e..444c77fc8a 100644 --- a/plugins/git-release-manager/package.json +++ b/plugins/git-release-manager/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-git-release-manager", "description": "A Backstage plugin that helps you manage releases in git", - "version": "0.3.6", + "version": "0.3.7", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/integration": "^0.7.0", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", @@ -40,9 +40,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/git-release-manager/src/GitReleaseManager.tsx b/plugins/git-release-manager/src/GitReleaseManager.tsx index bca19b9b13..8ac99a356c 100644 --- a/plugins/git-release-manager/src/GitReleaseManager.tsx +++ b/plugins/git-release-manager/src/GitReleaseManager.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Alert } from '@material-ui/lab'; import { Box } from '@material-ui/core'; import { useApi } from '@backstage/core-plugin-api'; 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 4030d9370f..51080570c3 100644 --- a/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts +++ b/plugins/git-release-manager/src/features/CreateReleaseCandidate/hooks/useCreateReleaseCandidate.ts @@ -15,7 +15,8 @@ */ import { useEffect, useState } from 'react'; -import { useAsync, useAsyncFn } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { GetLatestReleaseResult, GetRepositoryResult, diff --git a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx index 2a2692bb22..98303890c8 100644 --- a/plugins/git-release-manager/src/features/Patch/PatchBody.tsx +++ b/plugins/git-release-manager/src/features/Patch/PatchBody.tsx @@ -15,7 +15,7 @@ */ import React, { useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Alert, AlertTitle } from '@material-ui/lab'; import { Box, 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 188ffbca2e..73684a8f16 100644 --- a/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts +++ b/plugins/git-release-manager/src/features/Patch/hooks/usePatch.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useEffect, useState } from 'react'; import { diff --git a/plugins/git-release-manager/src/features/Patch/hooks/usePatchDryRun.tsx b/plugins/git-release-manager/src/features/Patch/hooks/usePatchDryRun.tsx index 3bd69b1028..a11ca55b4d 100644 --- a/plugins/git-release-manager/src/features/Patch/hooks/usePatchDryRun.tsx +++ b/plugins/git-release-manager/src/features/Patch/hooks/usePatchDryRun.tsx @@ -15,7 +15,8 @@ */ import { useApi } from '@backstage/core-plugin-api'; -import { useAsync, useAsyncFn } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import React from 'react'; import { CalverTagParts } from '../../../helpers/tagParts/getCalverTagParts'; 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 7ebc4fed54..e6f7545c71 100644 --- a/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts +++ b/plugins/git-release-manager/src/features/PromoteRc/hooks/usePromoteRc.ts @@ -15,7 +15,8 @@ */ import { useState, useEffect } from 'react'; -import { useAsync, useAsyncFn } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { CardHook, ComponentConfig, diff --git a/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx index 2774bfbc5e..08f8ddeadb 100644 --- a/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx +++ b/plugins/git-release-manager/src/features/RepoDetailsForm/Owner.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { useNavigate } from 'react-router'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { FormControl, FormHelperText, diff --git a/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx index 2b3ebb5058..c4a338bdf2 100644 --- a/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx +++ b/plugins/git-release-manager/src/features/RepoDetailsForm/Repo.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useNavigate } from 'react-router'; import { FormControl, diff --git a/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx b/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx index 35cb3bc411..b87433b303 100644 --- a/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx +++ b/plugins/git-release-manager/src/features/Stats/Info/hooks/useGetReleaseTimes.tsx @@ -15,7 +15,8 @@ */ import { useEffect, useState } from 'react'; -import { useAsync, useAsyncFn } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { DateTime } from 'luxon'; import { getReleaseCommitPairs } from '../helpers/getReleaseCommitPairs'; diff --git a/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx b/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx index d05240a652..7a3dac37cc 100644 --- a/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx +++ b/plugins/git-release-manager/src/features/Stats/Row/RowCollapsed/ReleaseTime.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { DateTime } from 'luxon'; import { Box, Typography } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts b/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts index 0af0dcb343..e2dbdc0876 100644 --- a/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts +++ b/plugins/git-release-manager/src/features/Stats/hooks/useGetStats.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { gitReleaseManagerApiRef } from '../../../api/serviceApiRef'; import { useProjectContext } from '../../../contexts/ProjectContext'; diff --git a/plugins/git-release-manager/src/hooks/useGetGitBatchInfo.ts b/plugins/git-release-manager/src/hooks/useGetGitBatchInfo.ts index 83c513a1e4..dbd24f5ec5 100644 --- a/plugins/git-release-manager/src/hooks/useGetGitBatchInfo.ts +++ b/plugins/git-release-manager/src/hooks/useGetGitBatchInfo.ts @@ -15,7 +15,7 @@ */ import { useEffect } from 'react'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { GitReleaseApi } from '../api/GitReleaseClient'; import { Project } from '../contexts/ProjectContext'; diff --git a/plugins/github-actions/CHANGELOG.md b/plugins/github-actions/CHANGELOG.md index 4c65a93a43..a2099a5b20 100644 --- a/plugins/github-actions/CHANGELOG.md +++ b/plugins/github-actions/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-github-actions +## 0.4.30 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.4.29 ### Patch Changes diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json index 7c3c475a0a..e65ed5a989 100644 --- a/plugins/github-actions/package.json +++ b/plugins/github-actions/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-github-actions", "description": "A Backstage plugin that integrates towards GitHub Actions", - "version": "0.4.29", + "version": "0.4.30", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,10 +34,10 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.8", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/integration": "^0.7.0", - "@backstage/plugin-catalog-react": "^0.6.9", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -52,9 +52,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts index a27e3725f2..002d379ed1 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts +++ b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { githubActionsApiRef } from '../../api'; import { buildRouteRef } from '../../routes'; import { useApi, useRouteRefParams } from '@backstage/core-plugin-api'; diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts index e62b4f1529..ef9b4f7ccf 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts +++ b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { githubActionsApiRef } from '../../api'; import { buildRouteRef } from '../../routes'; import { useApi, useRouteRefParams } from '@backstage/core-plugin-api'; diff --git a/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts b/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts index e1717509f5..3e80d0e2bb 100644 --- a/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts +++ b/plugins/github-actions/src/components/WorkflowRunLogs/useDownloadWorkflowRunLogs.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { githubActionsApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/github-actions/src/components/useProjectName.ts b/plugins/github-actions/src/components/useProjectName.ts index dd666fa599..b9be7a49c9 100644 --- a/plugins/github-actions/src/components/useProjectName.ts +++ b/plugins/github-actions/src/components/useProjectName.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; export const GITHUB_ACTIONS_ANNOTATION = 'github.com/project-slug'; diff --git a/plugins/github-actions/src/components/useWorkflowRuns.ts b/plugins/github-actions/src/components/useWorkflowRuns.ts index eb343601bd..0d855e44fb 100644 --- a/plugins/github-actions/src/components/useWorkflowRuns.ts +++ b/plugins/github-actions/src/components/useWorkflowRuns.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useState } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { githubActionsApiRef } from '../api/GithubActionsApi'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/github-deployments/CHANGELOG.md b/plugins/github-deployments/CHANGELOG.md index 3d456e56d5..94b4dadbcd 100644 --- a/plugins/github-deployments/CHANGELOG.md +++ b/plugins/github-deployments/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-github-deployments +## 0.1.25 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.24 ### Patch Changes diff --git a/plugins/github-deployments/package.json b/plugins/github-deployments/package.json index 8e023e6cd2..fcf452c67e 100644 --- a/plugins/github-deployments/package.json +++ b/plugins/github-deployments/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-github-deployments", "description": "A Backstage plugin that integrates towards GitHub Deployments", - "version": "0.1.24", + "version": "0.1.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,12 +22,12 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.3", "@backstage/integration": "^0.7.0", "@backstage/integration-react": "^0.1.17", - "@backstage/plugin-catalog-react": "^0.6.9", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -40,9 +40,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx index c1c33607a1..901e20a899 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { GithubDeployment, githubDeploymentsApiRef } from '../api'; import { useEntity } from '@backstage/plugin-catalog-react'; import { diff --git a/plugins/gitops-profiles/CHANGELOG.md b/plugins/gitops-profiles/CHANGELOG.md index f569396ff9..58607974f5 100644 --- a/plugins/gitops-profiles/CHANGELOG.md +++ b/plugins/gitops-profiles/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-gitops-profiles +## 0.3.12 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.3.11 ### Patch Changes diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index 1defa61667..345d2a812e 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-gitops-profiles", "description": "A Backstage plugin that helps you manage GitOps profiles", - "version": "0.3.11", + "version": "0.3.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,8 +32,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -45,9 +45,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx b/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx index 401a6d00d0..e55ae0ef29 100644 --- a/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx +++ b/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx @@ -18,7 +18,7 @@ import React, { useState } from 'react'; import ClusterTable from '../ClusterTable/ClusterTable'; import { Button } from '@material-ui/core'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { gitOpsApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx index 79ab73afdc..caab33217d 100644 --- a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx +++ b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx @@ -19,7 +19,7 @@ import { TextField, List, ListItem, Link } from '@material-ui/core'; import ClusterTemplateCardList from '../ClusterTemplateCardList'; import ProfileCardList from '../ProfileCardList'; -import { useLocalStorage } from 'react-use'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { gitOpsApiRef, Status } from '../../api'; import { diff --git a/plugins/graphiql/CHANGELOG.md b/plugins/graphiql/CHANGELOG.md index e48d545d0e..da188aee4b 100644 --- a/plugins/graphiql/CHANGELOG.md +++ b/plugins/graphiql/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-graphiql +## 0.2.26 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.2.25 ### Patch Changes diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index 510e06a3a4..593be20c6e 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-graphiql", "description": "Backstage plugin for browsing GraphQL APIs", - "version": "0.2.25", + "version": "0.2.26", "private": false, "publishConfig": { "access": "public", @@ -31,8 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -45,9 +45,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx index 58cf332615..e987ee10fa 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import 'graphiql/graphiql.css'; import { graphQlBrowseApiRef } from '../../lib/api'; import { GraphiQLBrowser } from '../GraphiQLBrowser'; diff --git a/plugins/home/CHANGELOG.md b/plugins/home/CHANGELOG.md index 38293b3c8e..15d4fce3de 100644 --- a/plugins/home/CHANGELOG.md +++ b/plugins/home/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-home +## 0.4.9 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.4.8 ### Patch Changes diff --git a/plugins/home/package.json b/plugins/home/package.json index ea924d2aa1..8b2f829efa 100644 --- a/plugins/home/package.json +++ b/plugins/home/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-home", "description": "A Backstage plugin that helps you build a home page", - "version": "0.4.8", + "version": "0.4.9", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -36,9 +36,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx index 9cb18bd430..40a5361f43 100644 --- a/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx +++ b/plugins/home/src/homePageComponents/WelcomeTitle/WelcomeTitle.tsx @@ -20,7 +20,7 @@ import { } from '@backstage/core-plugin-api'; import { Tooltip } from '@material-ui/core'; import React, { useEffect, useMemo } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { getTimeBasedGreeting } from './timeUtil'; export const WelcomeTitle = () => { diff --git a/plugins/ilert/CHANGELOG.md b/plugins/ilert/CHANGELOG.md index b33d1c0732..47a07999be 100644 --- a/plugins/ilert/CHANGELOG.md +++ b/plugins/ilert/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-ilert +## 0.1.20 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.19 ### Patch Changes diff --git a/plugins/ilert/package.json b/plugins/ilert/package.json index de904d9a3e..7a31632049 100644 --- a/plugins/ilert/package.json +++ b/plugins/ilert/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-ilert", "description": "A Backstage plugin that integrates towards iLert", - "version": "0.1.19", + "version": "0.1.20", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,10 +22,10 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.3", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@date-io/luxon": "1.x", "@material-ui/core": "^4.12.2", @@ -40,9 +40,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/ilert/src/hooks/useAlertSource.ts b/plugins/ilert/src/hooks/useAlertSource.ts index 4e74b9e857..279150a724 100644 --- a/plugins/ilert/src/hooks/useAlertSource.ts +++ b/plugins/ilert/src/hooks/useAlertSource.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { AlertSource, UptimeMonitor } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts b/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts index c4aeb59527..5a804e37fd 100644 --- a/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts +++ b/plugins/ilert/src/hooks/useAlertSourceOnCalls.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { AlertSource, OnCall } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useAssignIncident.ts b/plugins/ilert/src/hooks/useAssignIncident.ts index 2b6935fc8c..b760f31e9c 100644 --- a/plugins/ilert/src/hooks/useAssignIncident.ts +++ b/plugins/ilert/src/hooks/useAssignIncident.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { Incident, IncidentResponder } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useIncidentActions.ts b/plugins/ilert/src/hooks/useIncidentActions.ts index 4e20e3b56a..75621f67c3 100644 --- a/plugins/ilert/src/hooks/useIncidentActions.ts +++ b/plugins/ilert/src/hooks/useIncidentActions.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { Incident, IncidentAction } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useIncidents.ts b/plugins/ilert/src/hooks/useIncidents.ts index 286c53a5c5..45f28937c5 100644 --- a/plugins/ilert/src/hooks/useIncidents.ts +++ b/plugins/ilert/src/hooks/useIncidents.ts @@ -16,7 +16,7 @@ import React from 'react'; import { GetIncidentsOpts, ilertApiRef, TableState } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { ACCEPTED, PENDING, diff --git a/plugins/ilert/src/hooks/useNewIncident.ts b/plugins/ilert/src/hooks/useNewIncident.ts index af812ec060..f2bb3a8cd3 100644 --- a/plugins/ilert/src/hooks/useNewIncident.ts +++ b/plugins/ilert/src/hooks/useNewIncident.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { AlertSource } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useOnCallSchedules.ts b/plugins/ilert/src/hooks/useOnCallSchedules.ts index c11327ffe8..2c033067dd 100644 --- a/plugins/ilert/src/hooks/useOnCallSchedules.ts +++ b/plugins/ilert/src/hooks/useOnCallSchedules.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { Schedule } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useShiftOverride.ts b/plugins/ilert/src/hooks/useShiftOverride.ts index 33470f9607..018bdf497a 100644 --- a/plugins/ilert/src/hooks/useShiftOverride.ts +++ b/plugins/ilert/src/hooks/useShiftOverride.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { User, Shift } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/ilert/src/hooks/useUptimeMonitors.ts b/plugins/ilert/src/hooks/useUptimeMonitors.ts index fc4707c2a4..c71d5f02af 100644 --- a/plugins/ilert/src/hooks/useUptimeMonitors.ts +++ b/plugins/ilert/src/hooks/useUptimeMonitors.ts @@ -16,7 +16,7 @@ import React from 'react'; import { ilertApiRef, TableState } from '../api'; import { AuthenticationError } from '@backstage/errors'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { UptimeMonitor } from '../types'; import { useApi, errorApiRef } from '@backstage/core-plugin-api'; diff --git a/plugins/jenkins/CHANGELOG.md b/plugins/jenkins/CHANGELOG.md index c2c8ade90b..5881cd7ecf 100644 --- a/plugins/jenkins/CHANGELOG.md +++ b/plugins/jenkins/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-jenkins +## 0.5.16 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.5.15 ### Patch Changes diff --git a/plugins/jenkins/package.json b/plugins/jenkins/package.json index eba8b8405b..14ff0fd2e7 100644 --- a/plugins/jenkins/package.json +++ b/plugins/jenkins/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-jenkins", "description": "A Backstage plugin that integrates towards Jenkins", - "version": "0.5.15", + "version": "0.5.16", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,10 +33,10 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.5", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -50,9 +50,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/jenkins/src/components/useBuildWithSteps.ts b/plugins/jenkins/src/components/useBuildWithSteps.ts index 64b3bf2535..202d8b5275 100644 --- a/plugins/jenkins/src/components/useBuildWithSteps.ts +++ b/plugins/jenkins/src/components/useBuildWithSteps.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useCallback } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { jenkinsApiRef } from '../api'; import { useAsyncPolling } from './useAsyncPolling'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/jenkins/src/components/useBuilds.ts b/plugins/jenkins/src/components/useBuilds.ts index b0959671e1..a4afeb351f 100644 --- a/plugins/jenkins/src/components/useBuilds.ts +++ b/plugins/jenkins/src/components/useBuilds.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useState } from 'react'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { jenkinsApiRef } from '../api'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; import { useEntity } from '@backstage/plugin-catalog-react'; diff --git a/plugins/kafka/CHANGELOG.md b/plugins/kafka/CHANGELOG.md index c534f2410b..45b122b7c1 100644 --- a/plugins/kafka/CHANGELOG.md +++ b/plugins/kafka/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-kafka +## 0.2.24 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.2.23 ### Patch Changes diff --git a/plugins/kafka/package.json b/plugins/kafka/package.json index 6ba86a62a1..5eab137ca1 100644 --- a/plugins/kafka/package.json +++ b/plugins/kafka/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-kafka", "description": "A Backstage plugin that integrates towards Kafka", - "version": "0.2.23", + "version": "0.2.24", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,9 +22,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -36,9 +36,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts b/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts index 866b63b8bf..0be098c3f9 100644 --- a/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts +++ b/plugins/kafka/src/components/ConsumerGroupOffsets/useConsumerGroupsOffsetsForEntity.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { kafkaApiRef } from '../../api/types'; import { useConsumerGroupsForEntity } from './useConsumerGroupsForEntity'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/kubernetes-backend/CHANGELOG.md b/plugins/kubernetes-backend/CHANGELOG.md index 22fb8c09b9..faf40d12e7 100644 --- a/plugins/kubernetes-backend/CHANGELOG.md +++ b/plugins/kubernetes-backend/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-kubernetes-backend +## 0.4.2 + +### Patch Changes + +- 7ac0bd2c66: implement dashboard link formatter for GKE +- Updated dependencies + - @backstage/backend-common@0.10.2 + - @backstage/plugin-kubernetes-common@0.2.1 + ## 0.4.1 ### Patch Changes diff --git a/plugins/kubernetes-backend/api-report.md b/plugins/kubernetes-backend/api-report.md index 7d3adac1c4..9b181c8514 100644 --- a/plugins/kubernetes-backend/api-report.md +++ b/plugins/kubernetes-backend/api-report.md @@ -6,6 +6,7 @@ import { Config } from '@backstage/config'; import express from 'express'; import type { FetchResponse } from '@backstage/plugin-kubernetes-common'; +import type { JsonObject } from '@backstage/types'; import type { KubernetesFetchError } from '@backstage/plugin-kubernetes-common'; import type { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; import { Logger as Logger_2 } from 'winston'; @@ -31,6 +32,7 @@ export interface ClusterDetails { // (undocumented) caData?: string | undefined; dashboardApp?: string; + dashboardParameters?: JsonObject; dashboardUrl?: string; name: string; // (undocumented) diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json index 2ef15461fc..75ec4c3f03 100644 --- a/plugins/kubernetes-backend/package.json +++ b/plugins/kubernetes-backend/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-kubernetes-backend", "description": "A Backstage backend plugin that integrates towards Kubernetes", - "version": "0.4.1", + "version": "0.4.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,11 +32,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.10.0", + "@backstage/backend-common": "^0.10.2", "@backstage/catalog-model": "^0.9.7", "@backstage/config": "^0.1.10", "@backstage/errors": "^0.1.5", - "@backstage/plugin-kubernetes-common": "^0.2.0", + "@backstage/plugin-kubernetes-common": "^0.2.1", "@google-cloud/container": "^2.2.0", "@kubernetes/client-node": "^0.16.0", "@types/express": "^4.17.6", @@ -55,7 +55,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.3", + "@backstage/cli": "^0.10.5", "@types/aws4": "^1.5.1", "supertest": "^6.1.3", "aws-sdk-mock": "^5.2.1", diff --git a/plugins/kubernetes-backend/src/cluster-locator/ConfigClusterLocator.test.ts b/plugins/kubernetes-backend/src/cluster-locator/ConfigClusterLocator.test.ts index f5d6b56893..6ece380f28 100644 --- a/plugins/kubernetes-backend/src/cluster-locator/ConfigClusterLocator.test.ts +++ b/plugins/kubernetes-backend/src/cluster-locator/ConfigClusterLocator.test.ts @@ -176,4 +176,76 @@ describe('ConfigClusterLocator', () => { }, ]); }); + + it('one cluster with dashboardParameters', async () => { + const config: Config = new ConfigReader({ + clusters: [ + { + name: 'cluster1', + url: 'http://localhost:8080', + authProvider: 'serviceAccount', + dashboardApp: 'gke', + dashboardParameters: { + projectId: 'some-project', + region: 'some-region', + clusterName: 'cluster1', + }, + }, + ], + }); + + const sut = ConfigClusterLocator.fromConfig(config); + + const result = await sut.getClusters(); + + expect(result).toStrictEqual([ + { + name: 'cluster1', + serviceAccountToken: undefined, + url: 'http://localhost:8080', + authProvider: 'serviceAccount', + skipMetricsLookup: false, + skipTLSVerify: false, + caData: undefined, + dashboardApp: 'gke', + dashboardParameters: { + projectId: 'some-project', + region: 'some-region', + clusterName: 'cluster1', + }, + }, + ]); + }); + + it('one cluster with dashboardUrl', async () => { + const config: Config = new ConfigReader({ + clusters: [ + { + name: 'cluster1', + url: 'http://localhost:8080', + authProvider: 'serviceAccount', + dashboardApp: 'standard', + dashboardUrl: 'http://someurl', + }, + ], + }); + + const sut = ConfigClusterLocator.fromConfig(config); + + const result = await sut.getClusters(); + + expect(result).toStrictEqual([ + { + name: 'cluster1', + serviceAccountToken: undefined, + url: 'http://localhost:8080', + authProvider: 'serviceAccount', + skipMetricsLookup: false, + skipTLSVerify: false, + caData: undefined, + dashboardApp: 'standard', + dashboardUrl: 'http://someurl', + }, + ]); + }); }); diff --git a/plugins/kubernetes-backend/src/cluster-locator/ConfigClusterLocator.ts b/plugins/kubernetes-backend/src/cluster-locator/ConfigClusterLocator.ts index 36b5f58f2c..d8436b6c24 100644 --- a/plugins/kubernetes-backend/src/cluster-locator/ConfigClusterLocator.ts +++ b/plugins/kubernetes-backend/src/cluster-locator/ConfigClusterLocator.ts @@ -47,6 +47,9 @@ export class ConfigClusterLocator implements KubernetesClustersSupplier { if (dashboardApp) { clusterDetails.dashboardApp = dashboardApp; } + if (c.has('dashboardParameters')) { + clusterDetails.dashboardParameters = c.get('dashboardParameters'); + } switch (authProvider) { case 'google': { diff --git a/plugins/kubernetes-backend/src/cluster-locator/GkeClusterLocator.test.ts b/plugins/kubernetes-backend/src/cluster-locator/GkeClusterLocator.test.ts index bd342f566b..6bef8e0009 100644 --- a/plugins/kubernetes-backend/src/cluster-locator/GkeClusterLocator.test.ts +++ b/plugins/kubernetes-backend/src/cluster-locator/GkeClusterLocator.test.ts @@ -226,5 +226,51 @@ describe('GkeClusterLocator', () => { parent: 'projects/some-project/locations/some-region', }); }); + it('expose GKE dashboard', async () => { + mockedListClusters.mockReturnValueOnce([ + { + clusters: [ + { + name: 'some-cluster', + endpoint: '1.2.3.4', + }, + ], + }, + ]); + + const config: Config = new ConfigReader({ + type: 'gke', + projectId: 'some-project', + region: 'some-region', + skipMetricsLookup: true, + exposeDashboard: true, + }); + + const sut = GkeClusterLocator.fromConfigWithClient(config, { + listClusters: mockedListClusters, + } as any); + + const result = await sut.getClusters(); + + expect(result).toStrictEqual([ + { + authProvider: 'google', + name: 'some-cluster', + url: 'https://1.2.3.4', + skipTLSVerify: false, + skipMetricsLookup: true, + dashboardApp: 'gke', + dashboardParameters: { + clusterName: 'some-cluster', + projectId: 'some-project', + region: 'some-region', + }, + }, + ]); + expect(mockedListClusters).toBeCalledTimes(1); + expect(mockedListClusters).toHaveBeenCalledWith({ + parent: 'projects/some-project/locations/some-region', + }); + }); }); }); diff --git a/plugins/kubernetes-backend/src/cluster-locator/GkeClusterLocator.ts b/plugins/kubernetes-backend/src/cluster-locator/GkeClusterLocator.ts index d7f5050399..8b70db40eb 100644 --- a/plugins/kubernetes-backend/src/cluster-locator/GkeClusterLocator.ts +++ b/plugins/kubernetes-backend/src/cluster-locator/GkeClusterLocator.ts @@ -24,6 +24,7 @@ type GkeClusterLocatorOptions = { region?: string; skipTLSVerify?: boolean; skipMetricsLookup?: boolean; + exposeDashboard?: boolean; }; export class GkeClusterLocator implements KubernetesClustersSupplier { @@ -42,6 +43,7 @@ export class GkeClusterLocator implements KubernetesClustersSupplier { skipTLSVerify: config.getOptionalBoolean('skipTLSVerify') ?? false, skipMetricsLookup: config.getOptionalBoolean('skipMetricsLookup') ?? false, + exposeDashboard: config.getOptionalBoolean('exposeDashboard') ?? false, }; return new GkeClusterLocator(options, client); } @@ -55,8 +57,13 @@ export class GkeClusterLocator implements KubernetesClustersSupplier { // TODO pass caData into the object async getClusters(): Promise { - const { projectId, region, skipTLSVerify, skipMetricsLookup } = - this.options; + const { + projectId, + region, + skipTLSVerify, + skipMetricsLookup, + exposeDashboard, + } = this.options; const request = { parent: `projects/${projectId}/locations/${region}`, }; @@ -70,6 +77,16 @@ export class GkeClusterLocator implements KubernetesClustersSupplier { authProvider: 'google', skipTLSVerify, skipMetricsLookup, + ...(exposeDashboard + ? { + dashboardApp: 'gke', + dashboardParameters: { + projectId, + region, + clusterName: r.name, + }, + } + : {}), })); } catch (e) { throw new ForwardedError( diff --git a/plugins/kubernetes-backend/src/service/KubernetesFanOutHandler.ts b/plugins/kubernetes-backend/src/service/KubernetesFanOutHandler.ts index a25c220b80..b15ec1386e 100644 --- a/plugins/kubernetes-backend/src/service/KubernetesFanOutHandler.ts +++ b/plugins/kubernetes-backend/src/service/KubernetesFanOutHandler.ts @@ -255,6 +255,10 @@ export class KubernetesFanOutHandler { if (clusterDetailsItem.dashboardApp) { objects.cluster.dashboardApp = clusterDetailsItem.dashboardApp; } + if (clusterDetailsItem.dashboardParameters) { + objects.cluster.dashboardParameters = + clusterDetailsItem.dashboardParameters; + } return objects; }); }), diff --git a/plugins/kubernetes-backend/src/types/types.ts b/plugins/kubernetes-backend/src/types/types.ts index a0ec0832c1..4f25805063 100644 --- a/plugins/kubernetes-backend/src/types/types.ts +++ b/plugins/kubernetes-backend/src/types/types.ts @@ -15,6 +15,7 @@ */ import { Logger } from 'winston'; +import type { JsonObject } from '@backstage/types'; import type { FetchResponse, KubernetesFetchError, @@ -111,6 +112,7 @@ export interface ClusterDetails { * using the dashboardApp property, in order to properly format * links to kubernetes resources, otherwise it will assume that you're running the standard one. * @see dashboardApp + * @see dashboardParameters */ dashboardUrl?: string; /** @@ -129,6 +131,12 @@ export interface ClusterDetails { * ``` */ dashboardApp?: string; + /** + * Specifies specific parameters used by some dashboard URL formatters. + * This is used by the GKE formatter which requires the project, region and cluster name. + * @see dashboardApp + */ + dashboardParameters?: JsonObject; } export interface GKEClusterDetails extends ClusterDetails {} diff --git a/plugins/kubernetes-common/CHANGELOG.md b/plugins/kubernetes-common/CHANGELOG.md index 8580e73fa7..8d63e9faa6 100644 --- a/plugins/kubernetes-common/CHANGELOG.md +++ b/plugins/kubernetes-common/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/plugin-kubernetes-common +## 0.2.1 + +### Patch Changes + +- 7ac0bd2c66: implement dashboard link formatter for GKE + ## 0.2.0 ### Minor Changes diff --git a/plugins/kubernetes-common/api-report.md b/plugins/kubernetes-common/api-report.md index f3500aa271..15019d71c3 100644 --- a/plugins/kubernetes-common/api-report.md +++ b/plugins/kubernetes-common/api-report.md @@ -4,6 +4,7 @@ ```ts import { Entity } from '@backstage/catalog-model'; +import type { JsonObject } from '@backstage/types'; import { V1ConfigMap } from '@kubernetes/client-node'; import { V1CronJob } from '@kubernetes/client-node'; import { V1Deployment } from '@kubernetes/client-node'; @@ -62,6 +63,7 @@ export interface ClientPodStatus { // @public (undocumented) export interface ClusterAttributes { dashboardApp?: string; + dashboardParameters?: JsonObject; dashboardUrl?: string; name: string; } diff --git a/plugins/kubernetes-common/package.json b/plugins/kubernetes-common/package.json index 124e3415a7..cac133aa47 100644 --- a/plugins/kubernetes-common/package.json +++ b/plugins/kubernetes-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-kubernetes-common", "description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin", - "version": "0.2.0", + "version": "0.2.1", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -39,7 +39,7 @@ "@kubernetes/client-node": "^0.16.0" }, "devDependencies": { - "@backstage/cli": "^0.10.1" + "@backstage/cli": "^0.10.5" }, "jest": { "roots": [ diff --git a/plugins/kubernetes-common/src/types.ts b/plugins/kubernetes-common/src/types.ts index 0c5af00a97..afda9b5299 100644 --- a/plugins/kubernetes-common/src/types.ts +++ b/plugins/kubernetes-common/src/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import type { JsonObject } from '@backstage/types'; import { V1ConfigMap, V1CronJob, @@ -45,6 +46,7 @@ export interface ClusterAttributes { * Note that you should specify the app used for the dashboard * using the dashboardApp property, in order to properly format * links to kubernetes resources, otherwise it will assume that you're running the standard one. + * Also, for cloud clusters such as GKE, you should provide addititonal parameters using dashboardParameters. * @see dashboardApp */ dashboardUrl?: string; @@ -64,6 +66,11 @@ export interface ClusterAttributes { * ``` */ dashboardApp?: string; + /** + * Specifies specific parameters used by some dashboard URL formatters. + * This is used by the GKE formatter which requires the project, region and cluster name. + */ + dashboardParameters?: JsonObject; } export interface ClusterObjects { diff --git a/plugins/kubernetes/CHANGELOG.md b/plugins/kubernetes/CHANGELOG.md index 7ce20b7204..67126b4461 100644 --- a/plugins/kubernetes/CHANGELOG.md +++ b/plugins/kubernetes/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-kubernetes +## 0.5.3 + +### Patch Changes + +- 7ac0bd2c66: implement dashboard link formatter for GKE +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/plugin-kubernetes-common@0.2.1 + - @backstage/core-components@0.8.3 + ## 0.5.2 ### Patch Changes diff --git a/plugins/kubernetes/api-report.md b/plugins/kubernetes/api-report.md index 33ac98fb76..8dc0114738 100644 --- a/plugins/kubernetes/api-report.md +++ b/plugins/kubernetes/api-report.md @@ -10,6 +10,7 @@ import { BackstagePlugin } from '@backstage/core-plugin-api'; import { DiscoveryApi } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { IdentityApi } from '@backstage/core-plugin-api'; +import type { JsonObject } from '@backstage/types'; import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; import { OAuthApi } from '@backstage/core-plugin-api'; import { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common'; diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index 111a444f0d..2d152c7390 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-kubernetes", "description": "A Backstage plugin that integrates towards Kubernetes", - "version": "0.5.2", + "version": "0.5.3", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,10 +33,10 @@ "dependencies": { "@backstage/catalog-model": "^0.9.8", "@backstage/config": "^0.1.11", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", - "@backstage/plugin-kubernetes-common": "^0.2.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", + "@backstage/plugin-kubernetes-common": "^0.2.1", "@kubernetes/client-node": "^0.16.0", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", @@ -53,9 +53,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/kubernetes/src/assets/emptystate.svg b/plugins/kubernetes/src/assets/emptystate.svg index fa7f19123e..8a0490727f 100644 --- a/plugins/kubernetes/src/assets/emptystate.svg +++ b/plugins/kubernetes/src/assets/emptystate.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/plugins/kubernetes/src/components/KubernetesDrawer/KubernetesDrawer.tsx b/plugins/kubernetes/src/components/KubernetesDrawer/KubernetesDrawer.tsx index b4ea31dc8d..8a177cf6dd 100644 --- a/plugins/kubernetes/src/components/KubernetesDrawer/KubernetesDrawer.tsx +++ b/plugins/kubernetes/src/components/KubernetesDrawer/KubernetesDrawer.tsx @@ -155,6 +155,7 @@ const KubernetesDrawerContent = ({ const { clusterLink, errorMessage } = tryFormatClusterLink({ dashboardUrl: cluster.dashboardUrl, dashboardApp: cluster.dashboardApp, + dashboardParameters: cluster.dashboardParameters, object, kind, }); diff --git a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts index 8a8ec260fa..d9aca875c7 100644 --- a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts +++ b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts @@ -18,7 +18,7 @@ import { Entity } from '@backstage/catalog-model'; import { kubernetesApiRef } from '../api/types'; import { kubernetesAuthProvidersApiRef } from '../kubernetes-auth-provider/types'; import { useEffect, useState } from 'react'; -import { useInterval } from 'react-use'; +import useInterval from 'react-use/lib/useInterval'; import { KubernetesRequestBody, ObjectsByEntityResponse, diff --git a/plugins/kubernetes/src/types/types.ts b/plugins/kubernetes/src/types/types.ts index d6ef8fa784..1bdfa181d9 100644 --- a/plugins/kubernetes/src/types/types.ts +++ b/plugins/kubernetes/src/types/types.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import type { JsonObject } from '@backstage/types'; import { V1Deployment, V1Pod, @@ -43,7 +44,8 @@ export interface GroupedResponses extends DeploymentResources { } export interface ClusterLinksFormatterOptions { - dashboardUrl: URL; + dashboardUrl?: URL; + dashboardParameters?: JsonObject; object: any; kind: string; } diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatClusterLink.test.ts b/plugins/kubernetes/src/utils/clusterLinks/formatClusterLink.test.ts index 31e07a0f14..b767d496a2 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatClusterLink.test.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatClusterLink.test.ts @@ -114,5 +114,47 @@ describe('clusterLinks', () => { ); }); }); + describe('GKE app', () => { + it('should return an url on the deployment', () => { + const url = formatClusterLink({ + dashboardApp: 'gke', + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Deployment', + }); + expect(url).toBe( + 'https://console.cloud.google.com/kubernetes/deployment/us-east1-c/cluster-1/bar/foobar/overview?project=foobar-333614', + ); + }); + it('should return an url on the service', () => { + const url = formatClusterLink({ + dashboardApp: 'gke', + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Service', + }); + expect(url).toBe( + 'https://console.cloud.google.com/kubernetes/service/us-east1-c/cluster-1/bar/foobar/overview?project=foobar-333614', + ); + }); + }); }); }); diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatClusterLink.ts b/plugins/kubernetes/src/utils/clusterLinks/formatClusterLink.ts index a8f83a9c76..6a998bbce2 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatClusterLink.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatClusterLink.ts @@ -14,20 +14,22 @@ * limitations under the License. */ +import type { JsonObject } from '@backstage/types'; import { defaultFormatterName, clusterLinksFormatters } from './formatters'; export type FormatClusterLinkOptions = { dashboardUrl?: string; dashboardApp?: string; + dashboardParameters?: JsonObject; object: any; kind: string; }; export function formatClusterLink(options: FormatClusterLinkOptions) { - if (!options.dashboardUrl) { + if (!options.dashboardUrl && !options.dashboardParameters) { return undefined; } - if (!options.object) { + if (options.dashboardUrl && !options.object) { return options.dashboardUrl; } const app = options.dashboardApp || defaultFormatterName; @@ -36,7 +38,10 @@ export function formatClusterLink(options: FormatClusterLinkOptions) { throw new Error(`Could not find Kubernetes dashboard app named '${app}'`); } const url = formatter({ - dashboardUrl: new URL(options.dashboardUrl), + dashboardUrl: options.dashboardUrl + ? new URL(options.dashboardUrl) + : undefined, + dashboardParameters: options.dashboardParameters, object: options.object, kind: options.kind, }); diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatters/gke.test.ts b/plugins/kubernetes/src/utils/clusterLinks/formatters/gke.test.ts index e566404daf..20541f216d 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatters/gke.test.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatters/gke.test.ts @@ -16,10 +16,9 @@ import { gkeFormatter } from './gke'; describe('clusterLinks - GKE formatter', () => { - it('should return an url on the workloads when there is a namespace only', () => { + it('should provide a dashboardParameters in the options', () => { expect(() => gkeFormatter({ - dashboardUrl: new URL('https://k8s.foo.com'), object: { metadata: { name: 'foobar', @@ -28,6 +27,196 @@ describe('clusterLinks - GKE formatter', () => { }, kind: 'Deployment', }), - ).toThrowError('GKE formatter is not yet implemented. Please, contribute!'); + ).toThrowError('GKE dashboard requires a dashboardParameters option'); + }); + it('should provide a projectId in the dashboardParameters options', () => { + expect(() => + gkeFormatter({ + dashboardParameters: { + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Deployment', + }), + ).toThrowError( + 'GKE dashboard requires a "projectId" of type string in the dashboardParameters option', + ); + }); + it('should provide a region in the dashboardParameters options', () => { + expect(() => + gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Deployment', + }), + ).toThrowError( + 'GKE dashboard requires a "region" of type string in the dashboardParameters option', + ); + }); + it('should provide a clusterName in the dashboardParameters options', () => { + expect(() => + gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Deployment', + }), + ).toThrowError( + 'GKE dashboard requires a "clusterName" of type string in the dashboardParameters option', + ); + }); + it('should return an url on the cluster when there is a namespace only', () => { + const url = gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + namespace: 'bar', + }, + }, + kind: 'foo', + }); + expect(url.href).toBe( + 'https://console.cloud.google.com/kubernetes/clusters/details/us-east1-c/cluster-1/details?project=foobar-333614', + ); + }); + it('should return an url on the cluster when the kind is not recognizeed', () => { + const url = gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'UnknownKind', + }); + expect(url.href).toBe( + 'https://console.cloud.google.com/kubernetes/clusters/details/us-east1-c/cluster-1/details?project=foobar-333614', + ); + }); + it('should return an url on the deployment', () => { + const url = gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Deployment', + }); + expect(url.href).toBe( + 'https://console.cloud.google.com/kubernetes/deployment/us-east1-c/cluster-1/bar/foobar/overview?project=foobar-333614', + ); + }); + + it('should return an url on the service', () => { + const url = gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Service', + }); + expect(url.href).toBe( + 'https://console.cloud.google.com/kubernetes/service/us-east1-c/cluster-1/bar/foobar/overview?project=foobar-333614', + ); + }); + it('should return an url on the pod', () => { + const url = gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Pod', + }); + expect(url.href).toBe( + 'https://console.cloud.google.com/kubernetes/pod/us-east1-c/cluster-1/bar/foobar/details?project=foobar-333614', + ); + }); + it('should return an url on the ingress', () => { + const url = gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Ingress', + }); + expect(url.href).toBe( + 'https://console.cloud.google.com/kubernetes/ingress/us-east1-c/cluster-1/bar/foobar/details?project=foobar-333614', + ); + }); + it('should return an url on the deployment for a hpa', () => { + const url = gkeFormatter({ + dashboardParameters: { + projectId: 'foobar-333614', + region: 'us-east1-c', + clusterName: 'cluster-1', + }, + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'HorizontalPodAutoscaler', + }); + expect(url.href).toBe( + 'https://console.cloud.google.com/kubernetes/deployment/us-east1-c/cluster-1/bar/foobar/overview?project=foobar-333614', + ); }); }); diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatters/gke.ts b/plugins/kubernetes/src/utils/clusterLinks/formatters/gke.ts index 30e7fa3123..957032e6e2 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatters/gke.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatters/gke.ts @@ -15,6 +15,53 @@ */ import { ClusterLinksFormatterOptions } from '../../../types/types'; -export function gkeFormatter(_options: ClusterLinksFormatterOptions): URL { - throw new Error('GKE formatter is not yet implemented. Please, contribute!'); +const kindMappings: Record = { + deployment: 'deployment', + pod: 'pod', + ingress: 'ingress', + service: 'service', + horizontalpodautoscaler: 'deployment', +}; + +export function gkeFormatter(options: ClusterLinksFormatterOptions): URL { + if (!options.dashboardParameters) { + throw new Error('GKE dashboard requires a dashboardParameters option'); + } + const args = options.dashboardParameters; + if (typeof args.projectId !== 'string') { + throw new Error( + 'GKE dashboard requires a "projectId" of type string in the dashboardParameters option', + ); + } + if (typeof args.region !== 'string') { + throw new Error( + 'GKE dashboard requires a "region" of type string in the dashboardParameters option', + ); + } + if (typeof args.clusterName !== 'string') { + throw new Error( + 'GKE dashboard requires a "clusterName" of type string in the dashboardParameters option', + ); + } + const basePath = new URL('https://console.cloud.google.com/'); + const region = encodeURIComponent(args.region); + const clusterName = encodeURIComponent(args.clusterName); + const name = encodeURIComponent(options.object.metadata?.name ?? ''); + const namespace = encodeURIComponent( + options.object.metadata?.namespace ?? '', + ); + const validKind = kindMappings[options.kind.toLocaleLowerCase('en-US')]; + let path = ''; + if (namespace && name && validKind) { + const kindsWithDetails = ['ingress', 'pod']; + const landingPage = kindsWithDetails.includes(validKind) + ? 'details' + : 'overview'; + path = `kubernetes/${validKind}/${region}/${clusterName}/${namespace}/${name}/${landingPage}`; + } else { + path = `kubernetes/clusters/details/${region}/${clusterName}/details`; + } + const result = new URL(path, basePath); + result.searchParams.set('project', args.projectId); + return result; } diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatters/openshift.test.ts b/plugins/kubernetes/src/utils/clusterLinks/formatters/openshift.test.ts index f0b85cad49..2380d3e2d5 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatters/openshift.test.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatters/openshift.test.ts @@ -16,6 +16,19 @@ import { openshiftFormatter } from './openshift'; describe('clusterLinks - OpenShift formatter', () => { + it('should provide a dashboardUrl in the options', () => { + expect(() => + openshiftFormatter({ + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Deployment', + }), + ).toThrowError('OpenShift dashboard requires a dashboardUrl option'); + }); it('should return an url on the workloads when there is a namespace only', () => { const url = openshiftFormatter({ dashboardUrl: new URL('https://k8s.foo.com'), diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatters/openshift.ts b/plugins/kubernetes/src/utils/clusterLinks/formatters/openshift.ts index 6c20cd4720..c5b7313061 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatters/openshift.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatters/openshift.ts @@ -24,6 +24,9 @@ const kindMappings: Record = { }; export function openshiftFormatter(options: ClusterLinksFormatterOptions): URL { + if (!options.dashboardUrl) { + throw new Error('OpenShift dashboard requires a dashboardUrl option'); + } const basePath = new URL(options.dashboardUrl.href); const name = encodeURIComponent(options.object.metadata?.name ?? ''); const namespace = encodeURIComponent( diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatters/rancher.test.ts b/plugins/kubernetes/src/utils/clusterLinks/formatters/rancher.test.ts index cb200387a3..45983deab0 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatters/rancher.test.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatters/rancher.test.ts @@ -16,6 +16,19 @@ import { rancherFormatter } from './rancher'; describe('clusterLinks - rancher formatter', () => { + it('should provide a dashboardUrl in the options', () => { + expect(() => + rancherFormatter({ + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Deployment', + }), + ).toThrowError('Rancher dashboard requires a dashboardUrl option'); + }); it('should return a url on the workloads when there is a namespace only', () => { const url = rancherFormatter({ dashboardUrl: new URL('https://k8s.foo.com'), diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatters/rancher.ts b/plugins/kubernetes/src/utils/clusterLinks/formatters/rancher.ts index 1ace39ec59..6c72730181 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatters/rancher.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatters/rancher.ts @@ -23,6 +23,9 @@ const kindMappings: Record = { }; export function rancherFormatter(options: ClusterLinksFormatterOptions): URL { + if (!options.dashboardUrl) { + throw new Error('Rancher dashboard requires a dashboardUrl option'); + } const basePath = new URL(options.dashboardUrl.href); const name = encodeURIComponent(options.object.metadata?.name ?? ''); const namespace = encodeURIComponent( diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatters/standard.test.ts b/plugins/kubernetes/src/utils/clusterLinks/formatters/standard.test.ts index 0b3c21a627..c0ee3f534d 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatters/standard.test.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatters/standard.test.ts @@ -23,6 +23,19 @@ function formatUrl(url: URL) { } describe('clusterLinks - standard formatter', () => { + it('should provide a dashboardUrl in the options', () => { + expect(() => + standardFormatter({ + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Deployment', + }), + ).toThrowError('standard dashboard requires a dashboardUrl option'); + }); it('should return an url on the workloads when there is a namespace only', () => { const url = standardFormatter({ dashboardUrl: new URL('https://k8s.foo.com'), @@ -67,6 +80,21 @@ describe('clusterLinks - standard formatter', () => { 'https://k8s.foo.com/#/deployment/bar/foobar?namespace=bar', ); }); + it('should return an url on the pod', () => { + const url = standardFormatter({ + dashboardUrl: new URL('https://k8s.foo.com/'), + object: { + metadata: { + name: 'foobar', + namespace: 'bar', + }, + }, + kind: 'Pod', + }); + expect(formatUrl(url)).toBe( + 'https://k8s.foo.com/#/pod/bar/foobar?namespace=bar', + ); + }); it('should return an url on the deployment with a prefix 1', () => { const url = standardFormatter({ dashboardUrl: new URL('https://k8s.foo.com/some/prefix'), diff --git a/plugins/kubernetes/src/utils/clusterLinks/formatters/standard.ts b/plugins/kubernetes/src/utils/clusterLinks/formatters/standard.ts index e28c9fae2b..a7428a8722 100644 --- a/plugins/kubernetes/src/utils/clusterLinks/formatters/standard.ts +++ b/plugins/kubernetes/src/utils/clusterLinks/formatters/standard.ts @@ -17,12 +17,16 @@ import { ClusterLinksFormatterOptions } from '../../../types/types'; const kindMappings: Record = { deployment: 'deployment', + pod: 'pod', ingress: 'ingress', service: 'service', horizontalpodautoscaler: 'deployment', }; export function standardFormatter(options: ClusterLinksFormatterOptions) { + if (!options.dashboardUrl) { + throw new Error('standard dashboard requires a dashboardUrl option'); + } const result = new URL(options.dashboardUrl.href); const name = encodeURIComponent(options.object.metadata?.name ?? ''); const namespace = encodeURIComponent( diff --git a/plugins/lighthouse/CHANGELOG.md b/plugins/lighthouse/CHANGELOG.md index d0a113417a..83ab044467 100644 --- a/plugins/lighthouse/CHANGELOG.md +++ b/plugins/lighthouse/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-lighthouse +## 0.2.33 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.2.32 ### Patch Changes diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index 51970e16c5..4dcf72452e 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-lighthouse", "description": "A Backstage plugin that integrates towards Lighthouse", - "version": "0.2.32", + "version": "0.2.33", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,9 +34,9 @@ "dependencies": { "@backstage/catalog-model": "^0.9.7", "@backstage/config": "^0.1.10", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -48,9 +48,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx b/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx index 541bc0e22d..4701ae157f 100644 --- a/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx +++ b/plugins/lighthouse/src/components/AuditList/AuditListTable.tsx @@ -15,7 +15,7 @@ */ import React, { useState, useEffect } from 'react'; import { Website, lighthouseApiRef } from '../../api'; -import { useInterval } from 'react-use'; +import useInterval from 'react-use/lib/useInterval'; import { formatTime, CATEGORIES, diff --git a/plugins/lighthouse/src/components/AuditList/index.tsx b/plugins/lighthouse/src/components/AuditList/index.tsx index 94398bb794..c433bb1900 100644 --- a/plugins/lighthouse/src/components/AuditList/index.tsx +++ b/plugins/lighthouse/src/components/AuditList/index.tsx @@ -18,7 +18,8 @@ import { Button, Grid } from '@material-ui/core'; import Pagination from '@material-ui/lab/Pagination'; import React, { ChangeEvent, ReactNode, useMemo, useState } from 'react'; import { useNavigate } from 'react-router-dom'; -import { useAsync, useLocalStorage } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import { lighthouseApiRef } from '../../api'; import { useQuery } from '../../utils'; import LighthouseIntro, { LIGHTHOUSE_INTRO_LOCAL_STORAGE } from '../Intro'; diff --git a/plugins/lighthouse/src/components/AuditView/index.tsx b/plugins/lighthouse/src/components/AuditView/index.tsx index 30f7b61eb9..e377894c90 100644 --- a/plugins/lighthouse/src/components/AuditView/index.tsx +++ b/plugins/lighthouse/src/components/AuditView/index.tsx @@ -32,7 +32,7 @@ import { useNavigate, useParams, } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Audit, lighthouseApiRef, Website } from '../../api'; import { formatTime } from '../../utils'; import AuditStatusIcon from '../AuditStatusIcon'; diff --git a/plugins/lighthouse/src/components/Intro/index.tsx b/plugins/lighthouse/src/components/Intro/index.tsx index 509f9e468a..57609476b8 100644 --- a/plugins/lighthouse/src/components/Intro/index.tsx +++ b/plugins/lighthouse/src/components/Intro/index.tsx @@ -17,7 +17,7 @@ import { Button, Grid, makeStyles, Tab, Tabs } from '@material-ui/core'; import CloseIcon from '@material-ui/icons/Close'; import React, { useState } from 'react'; -import { useLocalStorage } from 'react-use'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; import LighthouseSupportButton from '../SupportButton'; import { ContentHeader, diff --git a/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts b/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts index 1ea1e3f8e4..3f7709fee0 100644 --- a/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts +++ b/plugins/lighthouse/src/hooks/useWebsiteForEntity.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { useEntity } from '@backstage/plugin-catalog-react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { LIGHTHOUSE_WEBSITE_URL_ANNOTATION } from '../../constants'; import { lighthouseApiRef } from '../api'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/newrelic-dashboard/CHANGELOG.md b/plugins/newrelic-dashboard/CHANGELOG.md index faf605979d..389d0f5f9d 100644 --- a/plugins/newrelic-dashboard/CHANGELOG.md +++ b/plugins/newrelic-dashboard/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-newrelic-dashboard +## 0.1.2 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.1 ### Patch Changes diff --git a/plugins/newrelic-dashboard/package.json b/plugins/newrelic-dashboard/package.json index 2a81be3b99..5a0ebc10df 100644 --- a/plugins/newrelic-dashboard/package.json +++ b/plugins/newrelic-dashboard/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-newrelic-dashboard", - "version": "0.1.1", + "version": "0.1.2", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,18 +21,18 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.8", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.5", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/plugin-catalog-react": "^0.6.10", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/dev-utils": "^0.2.16", "@testing-library/jest-dom": "^5.10.1", "@types/react": "^16.13.1 || ^17.0.0", "cross-fetch": "^3.0.6" diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx index 005bc42151..a9e6e39a0d 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { Box, makeStyles, Typography } from '@material-ui/core'; import { newRelicDashboardApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Progress, InfoCard, diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx index 95de46df2c..0b6a676f52 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { Box, Grid } from '@material-ui/core'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { InfoCard, Progress, diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx index c839a43ac2..87f2334bf7 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx @@ -17,7 +17,7 @@ import React, { useState } from 'react'; import { Grid, Tab, Tabs, makeStyles } from '@material-ui/core'; import { newRelicDashboardApiRef } from '../../../api'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Progress, ErrorPanel } from '@backstage/core-components'; import { DashboardSnapshot } from './DashboardSnapshot'; import { DashboardEntitySummary } from '../../../api/NewRelicDashboardApi'; diff --git a/plugins/newrelic/CHANGELOG.md b/plugins/newrelic/CHANGELOG.md index 95ee823f80..19265d9e17 100644 --- a/plugins/newrelic/CHANGELOG.md +++ b/plugins/newrelic/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-newrelic +## 0.3.12 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.3.11 ### Patch Changes diff --git a/plugins/newrelic/package.json b/plugins/newrelic/package.json index 135e03e495..0caca9f96e 100644 --- a/plugins/newrelic/package.json +++ b/plugins/newrelic/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-newrelic", "description": "A Backstage plugin that integrates towards New Relic", - "version": "0.3.11", + "version": "0.3.12", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,8 +32,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -44,9 +44,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx index 40f82d4beb..e626e6a6d2 100644 --- a/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx +++ b/plugins/newrelic/src/components/NewRelicFetchComponent/NewRelicFetchComponent.tsx @@ -16,7 +16,7 @@ import React from 'react'; import Alert from '@material-ui/lab/Alert'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { newRelicApiRef, NewRelicApplications } from '../../api'; import { Progress, Table, TableColumn } from '@backstage/core-components'; diff --git a/plugins/org/CHANGELOG.md b/plugins/org/CHANGELOG.md index 2cecb337d8..958e389a6e 100644 --- a/plugins/org/CHANGELOG.md +++ b/plugins/org/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-org +## 0.3.33 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.3.32 ### Patch Changes diff --git a/plugins/org/package.json b/plugins/org/package.json index 1a952dfe2f..fadca4442a 100644 --- a/plugins/org/package.json +++ b/plugins/org/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-org", "description": "A Backstage plugin that helps you create entity pages for your organization", - "version": "0.3.32", + "version": "0.3.33", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,9 +22,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.8", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -40,9 +40,9 @@ }, "devDependencies": { "@backstage/catalog-client": "^0.5.3", - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index 7a15bd2122..f27fd52515 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -35,7 +35,7 @@ import { import Pagination from '@material-ui/lab/Pagination'; import React from 'react'; import { generatePath } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Avatar, diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx index e8d7c44816..d3a90d63e3 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.tsx @@ -41,7 +41,7 @@ import { import qs from 'qs'; import React from 'react'; import pluralize from 'pluralize'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; type EntityTypeProps = { kind: string; diff --git a/plugins/pagerduty/CHANGELOG.md b/plugins/pagerduty/CHANGELOG.md index bc2aa71c7a..9e55d4d587 100644 --- a/plugins/pagerduty/CHANGELOG.md +++ b/plugins/pagerduty/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-pagerduty +## 0.3.21 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.3.20 ### Patch Changes diff --git a/plugins/pagerduty/package.json b/plugins/pagerduty/package.json index 458180841e..6a3ea7ebb9 100644 --- a/plugins/pagerduty/package.json +++ b/plugins/pagerduty/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-pagerduty", "description": "A Backstage plugin that integrates towards PagerDuty", - "version": "0.3.20", + "version": "0.3.21", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,9 +32,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -49,9 +49,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/pagerduty/src/assets/emptystate.svg b/plugins/pagerduty/src/assets/emptystate.svg index fa7f19123e..8a0490727f 100644 --- a/plugins/pagerduty/src/assets/emptystate.svg +++ b/plugins/pagerduty/src/assets/emptystate.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/plugins/pagerduty/src/components/ChangeEvents/ChangeEvents.tsx b/plugins/pagerduty/src/components/ChangeEvents/ChangeEvents.tsx index 8848612303..58b4dd6acf 100644 --- a/plugins/pagerduty/src/components/ChangeEvents/ChangeEvents.tsx +++ b/plugins/pagerduty/src/components/ChangeEvents/ChangeEvents.tsx @@ -18,7 +18,7 @@ import React, { useEffect } from 'react'; import { List, ListSubheader } from '@material-ui/core'; import { ChangeEventListItem } from './ChangeEventListItem'; import { ChangeEventEmptyState } from './ChangeEventEmptyState'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { pagerDutyApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; import { Progress } from '@backstage/core-components'; diff --git a/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx b/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx index 9cbdddca17..704887be58 100644 --- a/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx +++ b/plugins/pagerduty/src/components/Escalation/EscalationPolicy.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { List, ListSubheader } from '@material-ui/core'; import { EscalationUsersEmptyState } from './EscalationUsersEmptyState'; import { EscalationUser } from './EscalationUser'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { pagerDutyApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/pagerduty/src/components/Incident/Incidents.tsx b/plugins/pagerduty/src/components/Incident/Incidents.tsx index d7ce1b13a3..06dd50bdaa 100644 --- a/plugins/pagerduty/src/components/Incident/Incidents.tsx +++ b/plugins/pagerduty/src/components/Incident/Incidents.tsx @@ -18,7 +18,7 @@ import React, { useEffect } from 'react'; import { List, ListSubheader } from '@material-ui/core'; import { IncidentListItem } from './IncidentListItem'; import { IncidentsEmptyState } from './IncidentEmptyState'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { pagerDutyApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx index adb47e0b4b..bbade09e51 100644 --- a/plugins/pagerduty/src/components/PagerDutyCard/index.tsx +++ b/plugins/pagerduty/src/components/PagerDutyCard/index.tsx @@ -18,7 +18,7 @@ import { Entity } from '@backstage/catalog-model'; import { Card, CardHeader, Divider, CardContent } from '@material-ui/core'; import { Incidents } from '../Incident'; import { EscalationPolicy } from '../Escalation'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Alert } from '@material-ui/lab'; import { pagerDutyApiRef, UnauthorizedError } from '../../api'; import AlarmAddIcon from '@material-ui/icons/AlarmAdd'; diff --git a/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx b/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx index c5b62de15a..7e1a602bc8 100644 --- a/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx +++ b/plugins/pagerduty/src/components/TriggerDialog/TriggerDialog.tsx @@ -25,7 +25,7 @@ import { Typography, CircularProgress, } from '@material-ui/core'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { pagerDutyApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import { usePagerdutyEntity } from '../../hooks'; diff --git a/plugins/permission-react/CHANGELOG.md b/plugins/permission-react/CHANGELOG.md index 35bdcd9630..a5ad489a91 100644 --- a/plugins/permission-react/CHANGELOG.md +++ b/plugins/permission-react/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-permission-react +## 0.2.1 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + ## 0.2.0 ### Minor Changes diff --git a/plugins/permission-react/package.json b/plugins/permission-react/package.json index 7a2e72c0a1..23225cbf93 100644 --- a/plugins/permission-react/package.json +++ b/plugins/permission-react/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-permission-react", - "version": "0.2.0", + "version": "0.2.1", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -28,7 +28,7 @@ }, "dependencies": { "@backstage/config": "^0.1.11", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/plugin-permission-common": "^0.3.0", "cross-fetch": "^3.0.6", "react-router": "6.0.0-beta.0", @@ -39,7 +39,7 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.3", + "@backstage/cli": "^0.10.5", "@backstage/test-utils": "^0.2.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/permission-react/src/hooks/usePermission.ts b/plugins/permission-react/src/hooks/usePermission.ts index 129904d7df..45136d6697 100644 --- a/plugins/permission-react/src/hooks/usePermission.ts +++ b/plugins/permission-react/src/hooks/usePermission.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { permissionApiRef } from '../apis'; import { diff --git a/plugins/rollbar/CHANGELOG.md b/plugins/rollbar/CHANGELOG.md index 78fe08906e..88d06fde9d 100644 --- a/plugins/rollbar/CHANGELOG.md +++ b/plugins/rollbar/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-rollbar +## 0.3.22 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.3.21 ### Patch Changes diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json index df5305b851..baae723318 100644 --- a/plugins/rollbar/package.json +++ b/plugins/rollbar/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-rollbar", "description": "A Backstage plugin that integrates towards Rollbar", - "version": "0.3.21", + "version": "0.3.22", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,9 +33,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -50,9 +50,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/rollbar/src/hooks/useCatalogEntity.ts b/plugins/rollbar/src/hooks/useCatalogEntity.ts index b64369af7b..468d0e8c50 100644 --- a/plugins/rollbar/src/hooks/useCatalogEntity.ts +++ b/plugins/rollbar/src/hooks/useCatalogEntity.ts @@ -18,7 +18,7 @@ import { catalogApiRef, useEntityCompoundName, } from '@backstage/plugin-catalog-react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; export function useCatalogEntity() { diff --git a/plugins/rollbar/src/hooks/useRollbarEntities.ts b/plugins/rollbar/src/hooks/useRollbarEntities.ts index 150b611fae..60799e3916 100644 --- a/plugins/rollbar/src/hooks/useRollbarEntities.ts +++ b/plugins/rollbar/src/hooks/useRollbarEntities.ts @@ -15,7 +15,7 @@ */ import { catalogApiRef } from '@backstage/plugin-catalog-react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { ROLLBAR_ANNOTATION } from '../constants'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/rollbar/src/hooks/useTopActiveItems.ts b/plugins/rollbar/src/hooks/useTopActiveItems.ts index 1277678af7..04b65eb8cb 100644 --- a/plugins/rollbar/src/hooks/useTopActiveItems.ts +++ b/plugins/rollbar/src/hooks/useTopActiveItems.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; import { rollbarApiRef } from '../api'; import { RollbarTopActiveItem } from '../api/types'; diff --git a/plugins/scaffolder/CHANGELOG.md b/plugins/scaffolder/CHANGELOG.md index 78870ae5ab..429aa3b77e 100644 --- a/plugins/scaffolder/CHANGELOG.md +++ b/plugins/scaffolder/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-scaffolder +## 0.11.17 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.11.16 ### Patch Changes diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index ec33430b02..6c76010bec 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-scaffolder", "description": "The Backstage plugin that helps you create new things", - "version": "0.11.16", + "version": "0.11.17", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,12 +34,12 @@ "@backstage/catalog-client": "^0.5.3", "@backstage/catalog-model": "^0.9.7", "@backstage/config": "^0.1.11", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.5", "@backstage/integration": "^0.7.0", "@backstage/integration-react": "^0.1.17", - "@backstage/plugin-catalog-react": "^0.6.9", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/plugin-scaffolder-common": "^0.1.2", "@backstage/theme": "^0.2.14", "@backstage/types": "^0.1.1", @@ -67,10 +67,10 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", - "@backstage/plugin-catalog": "^0.7.6", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", + "@backstage/plugin-catalog": "^0.7.7", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx index caddadfd2e..4542979e73 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { scaffolderApiRef } from '../../api'; import { Typography, diff --git a/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx b/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx index b27f116b96..9f5dad2adc 100644 --- a/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx +++ b/plugins/scaffolder/src/components/TaskPage/TaskPage.tsx @@ -45,7 +45,7 @@ import { DateTime, Interval } from 'luxon'; import qs from 'qs'; import React, { memo, useEffect, useMemo, useState } from 'react'; import { generatePath, useNavigate, useParams } from 'react-router'; -import { useInterval } from 'react-use'; +import useInterval from 'react-use/lib/useInterval'; import { rootRouteRef } from '../../routes'; import { Status, TaskOutput } from '../../types'; import { useTaskEventStream } from '../hooks/useEventStream'; diff --git a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx index 9d1e7a3e2d..8ce7ecf6b3 100644 --- a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx +++ b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx @@ -20,7 +20,7 @@ import qs from 'qs'; import React, { useCallback, useState } from 'react'; import { generatePath, Navigate, useNavigate } from 'react-router'; import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { scaffolderApiRef } from '../../api'; import { CustomFieldValidator, FieldExtensionOptions } from '../../extensions'; import { rootRouteRef } from '../../routes'; diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx index c9c20e25eb..959e7883c0 100644 --- a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx +++ b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.tsx @@ -23,7 +23,7 @@ import FormControl from '@material-ui/core/FormControl'; import Autocomplete from '@material-ui/lab/Autocomplete'; import { FieldProps, UiSchema } from '@rjsf/core'; import React, { useCallback, useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; export const allowArbitraryValues = (uiSchema: UiSchema): boolean => (uiSchema['ui:options']?.allowArbitraryValues as boolean) ?? true; diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index 92261b6cac..85fe992935 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -27,7 +27,7 @@ import Input from '@material-ui/core/Input'; import InputLabel from '@material-ui/core/InputLabel'; import { FieldProps } from '@rjsf/core'; import React, { useCallback, useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { scaffolderApiRef } from '../../../api'; function splitFormData(url: string | undefined, allowedOwners?: string[]) { diff --git a/plugins/search/CHANGELOG.md b/plugins/search/CHANGELOG.md index 376a02b5fb..8baec7afa5 100644 --- a/plugins/search/CHANGELOG.md +++ b/plugins/search/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-search +## 0.5.4 + +### Patch Changes + +- e05b9115aa: Fix missing search context issue with `HomePageSearchBar` +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- 54ef743aa4: Introduce a `` variant to display tabs for selecting search result types. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.5.3 ### Patch Changes diff --git a/plugins/search/api-report.md b/plugins/search/api-report.md index 0d5b1a36a5..1fa89f7688 100644 --- a/plugins/search/api-report.md +++ b/plugins/search/api-report.md @@ -219,6 +219,7 @@ export const SearchResultPager: () => JSX.Element; export const SearchType: { (props: SearchTypeProps): JSX.Element; Accordion(props: SearchTypeAccordionProps): JSX.Element; + Tabs(props: SearchTypeTabsProps): JSX.Element; }; // @public (undocumented) @@ -240,6 +241,15 @@ export type SearchTypeProps = { defaultValue?: string[] | string | null; }; +// @public (undocumented) +export type SearchTypeTabsProps = { + types: Array<{ + value: string; + name: string; + }>; + defaultValue?: string; +}; + // Warning: (ae-missing-release-tag) "SidebarSearch" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) diff --git a/plugins/search/package.json b/plugins/search/package.json index c9e7d0aba1..f4880f86b3 100644 --- a/plugins/search/package.json +++ b/plugins/search/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-search", "description": "The Backstage plugin that provides your backstage app with search", - "version": "0.5.3", + "version": "0.5.4", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,10 +32,10 @@ "dependencies": { "@backstage/catalog-model": "^0.9.7", "@backstage/config": "^0.1.11", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.4", - "@backstage/plugin-catalog-react": "^0.6.9", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/search-common": "^0.2.1", "@backstage/theme": "^0.2.14", "@backstage/types": "^0.1.1", @@ -52,9 +52,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx b/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx index ec0fc3acb9..09a33b9b74 100644 --- a/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx +++ b/plugins/search/src/components/LegacySearchPage/LegacySearchPage.tsx @@ -16,7 +16,7 @@ import { Grid } from '@material-ui/core'; import React, { useEffect, useState } from 'react'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { SearchBar } from './LegacySearchBar'; import { SearchResult } from './LegacySearchResult'; import { diff --git a/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx b/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx index c5c3783819..f48ffb61d7 100644 --- a/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx +++ b/plugins/search/src/components/LegacySearchPage/LegacySearchResult.tsx @@ -16,7 +16,7 @@ import { Divider, Grid, makeStyles, Typography } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React, { useEffect, useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { Filters, FiltersButton, FiltersState } from './Filters'; diff --git a/plugins/search/src/components/SearchBar/SearchBar.tsx b/plugins/search/src/components/SearchBar/SearchBar.tsx index aa4b1e728a..2ddec22294 100644 --- a/plugins/search/src/components/SearchBar/SearchBar.tsx +++ b/plugins/search/src/components/SearchBar/SearchBar.tsx @@ -20,8 +20,9 @@ import React, { useState, useEffect, useCallback, + useContext, } from 'react'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { InputBase, @@ -32,7 +33,11 @@ import { import SearchIcon from '@material-ui/icons/Search'; import ClearButton from '@material-ui/icons/Clear'; -import { useSearch } from '../SearchContext'; +import { + SearchContext, + SearchContextProvider, + useSearch, +} from '../SearchContext'; import { TrackSearch } from '../SearchTracker'; /** @@ -48,6 +53,11 @@ export type SearchBarBaseProps = Omit & { onChange: (value: string) => void; }; +const useSearchContextCheck = () => { + const context = useContext(SearchContext); + return context !== undefined; +}; + /** * All search boxes exported by the search plugin are based on the , * and this one is based on the component from Material UI. @@ -69,6 +79,7 @@ export const SearchBarBase = ({ }: SearchBarBaseProps) => { const configApi = useApi(configApiRef); const [value, setValue] = useState(defaultValue as string); + const hasSearchContext = useSearchContextCheck(); useEffect(() => { setValue(prevValue => @@ -119,7 +130,7 @@ export const SearchBarBase = ({ ); - return ( + const searchBar = ( ); + + return hasSearchContext ? ( + searchBar + ) : ( + {searchBar} + ); }; /** diff --git a/plugins/search/src/components/SearchContext/SearchContext.tsx b/plugins/search/src/components/SearchContext/SearchContext.tsx index 300a191983..336041bf1f 100644 --- a/plugins/search/src/components/SearchContext/SearchContext.tsx +++ b/plugins/search/src/components/SearchContext/SearchContext.tsx @@ -25,8 +25,8 @@ import React, { useEffect, useState, } from 'react'; -import { useAsync, usePrevious } from 'react-use'; -import { AsyncState } from 'react-use/lib/useAsync'; +import useAsync, { AsyncState } from 'react-use/lib/useAsync'; +import usePrevious from 'react-use/lib/usePrevious'; import { searchApiRef } from '../../apis'; type SearchContextValue = { diff --git a/plugins/search/src/components/SearchPage/SearchPage.tsx b/plugins/search/src/components/SearchPage/SearchPage.tsx index a0738b3466..e4e1e49d57 100644 --- a/plugins/search/src/components/SearchPage/SearchPage.tsx +++ b/plugins/search/src/components/SearchPage/SearchPage.tsx @@ -15,7 +15,7 @@ */ import React, { useEffect } from 'react'; -import { usePrevious } from 'react-use'; +import usePrevious from 'react-use/lib/usePrevious'; import qs from 'qs'; import { useLocation, useOutlet } from 'react-router'; import { SearchContextProvider, useSearch } from '../SearchContext'; diff --git a/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx b/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx new file mode 100644 index 0000000000..54f09023bc --- /dev/null +++ b/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx @@ -0,0 +1,112 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react'; +import { ApiProvider } from '@backstage/core-app-api'; +import { TestApiRegistry } from '@backstage/test-utils'; +import { act, render } from '@testing-library/react'; +import user from '@testing-library/user-event'; + +import { searchApiRef } from '../../apis'; +import { SearchContext, SearchContextProvider } from '../SearchContext'; +import { SearchType } from './SearchType'; + +describe('SearchType.Tabs', () => { + const query = jest.fn(); + const mockApis = TestApiRegistry.from([searchApiRef, { query }]); + + const contextSpy = { + result: { loading: false, value: { results: [] } }, + term: '', + types: [], + filters: {}, + toggleModal: jest.fn(), + setTerm: jest.fn(), + setTypes: jest.fn(), + setFilters: jest.fn(), + setPageCursor: jest.fn(), + }; + + const expectedType = { + value: 'expected-type', + name: 'Expected Type', + }; + + beforeEach(() => { + query.mockResolvedValue({ results: [] }); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + it('should render as expected', async () => { + const { getByText } = render( + + + + + , + ); + + // The default "all" type should be rendered. + expect(getByText('All')).toBeInTheDocument(); + + // The given type is also visible + expect(getByText(expectedType.name)).toBeInTheDocument(); + + await act(() => Promise.resolve()); + }); + + it('should set entire types array when a type is selected', () => { + const { getByText } = render( + + + , + ); + + user.click(getByText(expectedType.name)); + + expect(contextSpy.setTypes).toHaveBeenCalledWith([expectedType.value]); + }); + + it('should reset types array when all is selected', () => { + const { getByText } = render( + + + , + ); + + user.click(getByText('All')); + + expect(contextSpy.setTypes).toHaveBeenCalledWith([]); + }); + + it('should reset page cursor when a new type is selected', () => { + const { getByText } = render( + + + , + ); + + user.click(getByText(expectedType.name)); + + expect(contextSpy.setPageCursor).toHaveBeenCalledWith(undefined); + }); +}); diff --git a/plugins/search/src/components/SearchType/SearchType.Tabs.tsx b/plugins/search/src/components/SearchType/SearchType.Tabs.tsx new file mode 100644 index 0000000000..465afd2de4 --- /dev/null +++ b/plugins/search/src/components/SearchType/SearchType.Tabs.tsx @@ -0,0 +1,90 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { useEffect } from 'react'; +import { useSearch } from '../SearchContext'; +import { BackstageTheme } from '@backstage/theme'; +import { makeStyles, Tab, Tabs } from '@material-ui/core'; + +const useStyles = makeStyles((theme: BackstageTheme) => ({ + tabs: { + borderBottom: `1px solid ${theme.palette.textVerySubtle}`, + padding: theme.spacing(0, 4), + }, + tab: { + height: '50px', + fontWeight: theme.typography.fontWeightBold, + fontSize: theme.typography.pxToRem(13), + color: theme.palette.textSubtle, + minWidth: '130px', + }, +})); + +/** + * @public + */ +export type SearchTypeTabsProps = { + types: Array<{ + value: string; + name: string; + }>; + defaultValue?: string; +}; + +export const SearchTypeTabs = (props: SearchTypeTabsProps) => { + const classes = useStyles(); + const { setPageCursor, setTypes, types } = useSearch(); + const { defaultValue, types: givenTypes } = props; + + const changeTab = (_: React.ChangeEvent<{}>, newType: string) => { + setTypes(newType !== '' ? [newType] : []); + setPageCursor(undefined); + }; + + // Handle any provided defaultValue + useEffect(() => { + if (defaultValue) { + setTypes([defaultValue]); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const definedTypes = [ + { + value: '', + name: 'All', + }, + ...givenTypes, + ]; + + return ( + + {definedTypes.map(type => ( + + ))} + + ); +}; diff --git a/plugins/search/src/components/SearchType/SearchType.stories.tsx b/plugins/search/src/components/SearchType/SearchType.stories.tsx index 833573f5ee..596c4a027a 100644 --- a/plugins/search/src/components/SearchType/SearchType.stories.tsx +++ b/plugins/search/src/components/SearchType/SearchType.stories.tsx @@ -61,3 +61,16 @@ export const Accordion = () => { /> ); }; + +export const Tabs = () => { + return ( + + ); +}; diff --git a/plugins/search/src/components/SearchType/SearchType.tsx b/plugins/search/src/components/SearchType/SearchType.tsx index f42802819a..ba20e1db5d 100644 --- a/plugins/search/src/components/SearchType/SearchType.tsx +++ b/plugins/search/src/components/SearchType/SearchType.tsx @@ -24,11 +24,12 @@ import { Select, } from '@material-ui/core'; import React, { ChangeEvent } from 'react'; -import { useEffectOnce } from 'react-use'; +import useEffectOnce from 'react-use/lib/useEffectOnce'; import { SearchTypeAccordion, SearchTypeAccordionProps, } from './SearchType.Accordion'; +import { SearchTypeTabs, SearchTypeTabsProps } from './SearchType.Tabs'; import { useSearch } from '../SearchContext'; const useStyles = makeStyles(theme => ({ @@ -124,5 +125,14 @@ SearchType.Accordion = (props: SearchTypeAccordionProps) => { return ; }; +/** + * A control surface for the search query's "types" property, displayed as a + * tabs suitable for use in faceted search UIs. + * @public + */ +SearchType.Tabs = (props: SearchTypeTabsProps) => { + return ; +}; + export { SearchType }; -export type { SearchTypeAccordionProps }; +export type { SearchTypeAccordionProps, SearchTypeTabsProps }; diff --git a/plugins/search/src/components/SearchType/index.ts b/plugins/search/src/components/SearchType/index.ts index e605276455..37ccc0c781 100644 --- a/plugins/search/src/components/SearchType/index.ts +++ b/plugins/search/src/components/SearchType/index.ts @@ -15,4 +15,8 @@ */ export { SearchType } from './SearchType'; -export type { SearchTypeAccordionProps, SearchTypeProps } from './SearchType'; +export type { + SearchTypeAccordionProps, + SearchTypeTabsProps, + SearchTypeProps, +} from './SearchType'; diff --git a/plugins/search/src/index.ts b/plugins/search/src/index.ts index 2cd9130721..c386330937 100644 --- a/plugins/search/src/index.ts +++ b/plugins/search/src/index.ts @@ -40,6 +40,7 @@ export { SearchResultPager } from './components/SearchResultPager'; export { SearchType } from './components/SearchType'; export type { SearchTypeAccordionProps, + SearchTypeTabsProps, SearchTypeProps, } from './components/SearchType'; export { SidebarSearch } from './components/SidebarSearch'; diff --git a/plugins/sentry/CHANGELOG.md b/plugins/sentry/CHANGELOG.md index 4f959bfa48..e01cac2d53 100644 --- a/plugins/sentry/CHANGELOG.md +++ b/plugins/sentry/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-sentry +## 0.3.32 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.3.31 ### Patch Changes diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index 3b810b7bfc..20bfdf22b0 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-sentry", "description": "A Backstage plugin that integrates towards Sentry", - "version": "0.3.31", + "version": "0.3.32", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,9 +33,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -49,9 +49,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx b/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx index 00f7ad0b0b..54fc940074 100644 --- a/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx +++ b/plugins/sentry/src/components/SentryIssuesWidget/SentryIssuesWidget.tsx @@ -16,7 +16,7 @@ import { Entity } from '@backstage/catalog-model'; import React, { useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { sentryApiRef } from '../../api'; import SentryIssuesTable from '../SentryIssuesTable/SentryIssuesTable'; import { diff --git a/plugins/shortcuts/CHANGELOG.md b/plugins/shortcuts/CHANGELOG.md index 2b212c06ff..1378e08dc3 100644 --- a/plugins/shortcuts/CHANGELOG.md +++ b/plugins/shortcuts/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-shortcuts +## 0.1.18 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.1.17 ### Patch Changes diff --git a/plugins/shortcuts/package.json b/plugins/shortcuts/package.json index 1770fea044..b38d66f6b9 100644 --- a/plugins/shortcuts/package.json +++ b/plugins/shortcuts/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-shortcuts", "description": "A Backstage plugin that provides a shortcuts feature to the sidebar", - "version": "0.1.17", + "version": "0.1.18", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@backstage/types": "^0.1.1", "@material-ui/core": "^4.12.2", @@ -39,9 +39,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/shortcuts/src/Shortcuts.tsx b/plugins/shortcuts/src/Shortcuts.tsx index 69ab6a48ac..8b7e1628d3 100644 --- a/plugins/shortcuts/src/Shortcuts.tsx +++ b/plugins/shortcuts/src/Shortcuts.tsx @@ -15,7 +15,7 @@ */ import React, { useMemo } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import PlayListAddIcon from '@material-ui/icons/PlaylistAdd'; import { ShortcutItem } from './ShortcutItem'; import { AddShortcut } from './AddShortcut'; diff --git a/plugins/sonarqube/CHANGELOG.md b/plugins/sonarqube/CHANGELOG.md index f52e4ba897..0e83dcf0d7 100644 --- a/plugins/sonarqube/CHANGELOG.md +++ b/plugins/sonarqube/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-sonarqube +## 0.2.11 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.2.10 ### Patch Changes diff --git a/plugins/sonarqube/package.json b/plugins/sonarqube/package.json index 9eba8bcfb1..7523e79779 100644 --- a/plugins/sonarqube/package.json +++ b/plugins/sonarqube/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-sonarqube", "description": "", - "version": "0.2.10", + "version": "0.2.11", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,9 +34,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -50,9 +50,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx index dede699203..ca3ddbda76 100644 --- a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx +++ b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx @@ -23,7 +23,7 @@ import LockOpen from '@material-ui/icons/LockOpen'; import Security from '@material-ui/icons/Security'; import SentimentVeryDissatisfied from '@material-ui/icons/SentimentVeryDissatisfied'; import React, { useMemo } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { sonarQubeApiRef } from '../../api'; import { SONARQUBE_PROJECT_KEY_ANNOTATION, diff --git a/plugins/splunk-on-call/CHANGELOG.md b/plugins/splunk-on-call/CHANGELOG.md index 18174ec5f8..20b2171f55 100644 --- a/plugins/splunk-on-call/CHANGELOG.md +++ b/plugins/splunk-on-call/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-splunk-on-call +## 0.3.18 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.3.17 ### Patch Changes diff --git a/plugins/splunk-on-call/package.json b/plugins/splunk-on-call/package.json index 7277db6355..7f18330d7d 100644 --- a/plugins/splunk-on-call/package.json +++ b/plugins/splunk-on-call/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-splunk-on-call", "description": "A Backstage plugin that integrates towards Splunk On-Call", - "version": "0.3.17", + "version": "0.3.18", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -32,9 +32,9 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", - "@backstage/plugin-catalog-react": "^0.6.8", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -48,9 +48,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/splunk-on-call/src/assets/emptystate.svg b/plugins/splunk-on-call/src/assets/emptystate.svg index fa7f19123e..8a0490727f 100644 --- a/plugins/splunk-on-call/src/assets/emptystate.svg +++ b/plugins/splunk-on-call/src/assets/emptystate.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 5a645f0559..bca53a3b0a 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import React, { useCallback, useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Entity } from '@backstage/catalog-model'; import { useEntity } from '@backstage/plugin-catalog-react'; import { diff --git a/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx b/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx index 066fa954ad..9718aeacb7 100644 --- a/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx +++ b/plugins/splunk-on-call/src/components/Escalation/EscalationPolicy.tsx @@ -24,7 +24,7 @@ import { } from '@material-ui/core'; import { EscalationUsersEmptyState } from './EscalationUsersEmptyState'; import { EscalationUser } from './EscalationUser'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { splunkOnCallApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import { User } from '../types'; diff --git a/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx b/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx index 21bc7c35d2..570b47483f 100644 --- a/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx +++ b/plugins/splunk-on-call/src/components/Incident/IncidentListItem.tsx @@ -31,7 +31,7 @@ import { DateTime, Duration } from 'luxon'; import { Incident, IncidentPhase } from '../types'; import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser'; import { splunkOnCallApiRef } from '../../api/client'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { TriggerAlarmRequest } from '../../api/types'; import { diff --git a/plugins/splunk-on-call/src/components/Incident/Incidents.tsx b/plugins/splunk-on-call/src/components/Incident/Incidents.tsx index 7dd95179dd..3c557773fd 100644 --- a/plugins/splunk-on-call/src/components/Incident/Incidents.tsx +++ b/plugins/splunk-on-call/src/components/Incident/Incidents.tsx @@ -24,7 +24,7 @@ import { } from '@material-ui/core'; import { IncidentListItem } from './IncidentListItem'; import { IncidentsEmptyState } from './IncidentEmptyState'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { splunkOnCallApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; diff --git a/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx b/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx index 4d2c60f7b2..82dd2da74d 100644 --- a/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx +++ b/plugins/splunk-on-call/src/components/TriggerDialog/TriggerDialog.tsx @@ -32,7 +32,7 @@ import { FormControl, InputLabel, } from '@material-ui/core'; -import { useAsyncFn } from 'react-use'; +import useAsyncFn from 'react-use/lib/useAsyncFn'; import { splunkOnCallApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; import { TriggerAlarmRequest } from '../../api/types'; diff --git a/plugins/tech-insights/CHANGELOG.md b/plugins/tech-insights/CHANGELOG.md index e761faab97..47baf0943c 100644 --- a/plugins/tech-insights/CHANGELOG.md +++ b/plugins/tech-insights/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-tech-insights +## 0.1.4 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- 96fb10fe25: remove unnecessary http request when running all checks +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + ## 0.1.3 ### Patch Changes diff --git a/plugins/tech-insights/package.json b/plugins/tech-insights/package.json index d661f5846c..e6bf9d3947 100644 --- a/plugins/tech-insights/package.json +++ b/plugins/tech-insights/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-tech-insights", - "version": "0.1.3", + "version": "0.1.4", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.4", - "@backstage/plugin-catalog-react": "^0.6.9", + "@backstage/plugin-catalog-react": "^0.6.10", "@backstage/plugin-tech-insights-common": "^0.2.0", "@backstage/theme": "^0.2.14", "@backstage/types": "^0.1.1", @@ -39,9 +39,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/tech-insights/src/api/TechInsightsClient.ts b/plugins/tech-insights/src/api/TechInsightsClient.ts index 43979e60b0..2298f463f5 100644 --- a/plugins/tech-insights/src/api/TechInsightsClient.ts +++ b/plugins/tech-insights/src/api/TechInsightsClient.ts @@ -66,20 +66,20 @@ export class TechInsightsClient implements TechInsightsApi { async runChecks( entityParams: EntityName, - checks: Check[], + checks?: Check[], ): Promise { const url = await this.discoveryApi.getBaseUrl('tech-insights'); const token = await this.identityApi.getIdToken(); const { namespace, kind, name } = entityParams; - const allChecks = checks ? checks : await this.getAllChecks(); - const checkIds = allChecks.map((check: Check) => check.id); + const checkIds = checks ? checks.map(check => check.id) : []; + const requestBody = { checks: checkIds.length > 0 ? checkIds : undefined }; const response = await fetch( `${url}/checks/run/${encodeURIComponent(namespace)}/${encodeURIComponent( kind, )}/${encodeURIComponent(name)}`, { method: 'POST', - body: JSON.stringify({ checks: checkIds }), + body: JSON.stringify(requestBody), headers: { 'Content-Type': 'application/json', ...(token && { Authorization: `Bearer ${token}` }), diff --git a/plugins/tech-insights/src/components/ScorecardsOverview/ScorecardsOverview.tsx b/plugins/tech-insights/src/components/ScorecardsOverview/ScorecardsOverview.tsx index 92a57bd643..ecd9deffcc 100644 --- a/plugins/tech-insights/src/components/ScorecardsOverview/ScorecardsOverview.tsx +++ b/plugins/tech-insights/src/components/ScorecardsOverview/ScorecardsOverview.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Progress } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; import { ChecksOverview } from './ChecksOverview'; diff --git a/plugins/tech-radar/CHANGELOG.md b/plugins/tech-radar/CHANGELOG.md index 31012ebe36..cf7eb04197 100644 --- a/plugins/tech-radar/CHANGELOG.md +++ b/plugins/tech-radar/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-tech-radar +## 0.5.1 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.5.0 ### Minor Changes diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index 50968a6a2f..45df565b81 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-tech-radar", "description": "A Backstage plugin that lets you display a Tech Radar for your organization", - "version": "0.5.0", + "version": "0.5.1", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -31,8 +31,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -46,9 +46,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/tech-radar/src/components/RadarComponent.tsx b/plugins/tech-radar/src/components/RadarComponent.tsx index b439fb4d08..e26d44aa1a 100644 --- a/plugins/tech-radar/src/components/RadarComponent.tsx +++ b/plugins/tech-radar/src/components/RadarComponent.tsx @@ -17,7 +17,7 @@ import { Progress } from '@backstage/core-components'; import { errorApiRef, useApi } from '@backstage/core-plugin-api'; import React, { useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { RadarEntry, techRadarApiRef, TechRadarLoaderResponse } from '../api'; import Radar from '../components/Radar'; import { Entry } from '../utils/types'; diff --git a/plugins/techdocs/CHANGELOG.md b/plugins/techdocs/CHANGELOG.md index 2cfa8064e9..a72c3e3313 100644 --- a/plugins/techdocs/CHANGELOG.md +++ b/plugins/techdocs/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-techdocs +## 0.12.13 + +### Patch Changes + +- fe9de6c25b: Adds support for opening internal Techdocs links in a new tab with CTRL+Click or CMD+Click +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- e0271456d8: Updated Techdocs footer navigation to dynamically resize to the width of the dom, resolving an issue where a pinned sidebar causes navigation to go off of the screen +- Updated dependencies + - @backstage/plugin-search@0.5.4 + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-components@0.8.3 + - @backstage/plugin-catalog@0.7.7 + ## 0.12.12 ### Patch Changes diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index f45be5b4b7..300c662225 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-techdocs", "description": "The Backstage plugin that renders technical documentation for your components", - "version": "0.12.12", + "version": "0.12.13", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,14 +34,14 @@ "dependencies": { "@backstage/catalog-model": "^0.9.8", "@backstage/config": "^0.1.11", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.5", "@backstage/integration": "^0.7.0", "@backstage/integration-react": "^0.1.17", - "@backstage/plugin-catalog": "^0.7.6", - "@backstage/plugin-catalog-react": "^0.6.9", - "@backstage/plugin-search": "^0.5.3", + "@backstage/plugin-catalog": "^0.7.7", + "@backstage/plugin-catalog-react": "^0.6.10", + "@backstage/plugin-search": "^0.5.4", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -62,9 +62,9 @@ "react-dom": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/techdocs/src/home/components/DocsTable.tsx b/plugins/techdocs/src/home/components/DocsTable.tsx index 83d6f05788..a00d608b0f 100644 --- a/plugins/techdocs/src/home/components/DocsTable.tsx +++ b/plugins/techdocs/src/home/components/DocsTable.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; import { useRouteRef, useApi, configApiRef } from '@backstage/core-plugin-api'; import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model'; diff --git a/plugins/techdocs/src/home/components/EntityListDocsTable.tsx b/plugins/techdocs/src/home/components/EntityListDocsTable.tsx index b94e7adace..4d136591ff 100644 --- a/plugins/techdocs/src/home/components/EntityListDocsTable.tsx +++ b/plugins/techdocs/src/home/components/EntityListDocsTable.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { useCopyToClipboard } from 'react-use'; +import useCopyToClipboard from 'react-use/lib/useCopyToClipboard'; import { capitalize } from 'lodash'; import { CodeSnippet, diff --git a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx index 9400ca3205..b32cadaa05 100644 --- a/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx +++ b/plugins/techdocs/src/home/components/TechDocsCustomHome.tsx @@ -15,7 +15,7 @@ */ import React, { useState } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { makeStyles } from '@material-ui/core'; import { CSSProperties } from '@material-ui/styles'; import { diff --git a/plugins/techdocs/src/reader/components/LegacyTechDocsPage.tsx b/plugins/techdocs/src/reader/components/LegacyTechDocsPage.tsx index cf4a751296..f3384e21b3 100644 --- a/plugins/techdocs/src/reader/components/LegacyTechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/LegacyTechDocsPage.tsx @@ -16,7 +16,7 @@ import React, { useCallback, useState } from 'react'; import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { techdocsApiRef } from '../../api'; import { TechDocsNotFound } from './TechDocsNotFound'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index 264da9531a..eb8f4d39e9 100644 --- a/plugins/techdocs/src/reader/components/Reader.tsx +++ b/plugins/techdocs/src/reader/components/Reader.tsx @@ -167,6 +167,23 @@ export const useTechDocsReaderDom = (entityRef: EntityName): Element | null => { // an update to "state" might lead to an updated UI so we include it as a trigger }, [updateSidebarPosition, state]); + // dynamically set width of footer to accommodate for pinning of the sidebar + const updateFooterWidth = useCallback(() => { + if (!dom) return; + const footer = dom.querySelector('.md-footer') as HTMLElement; + if (footer) { + footer.style.width = `${dom.getBoundingClientRect().width}px`; + } + }, [dom]); + + useEffect(() => { + updateFooterWidth(); + window.addEventListener('resize', updateFooterWidth); + return () => { + window.removeEventListener('resize', updateFooterWidth); + }; + }); + // a function that performs transformations that are executed prior to adding it to the DOM const preRender = useCallback( (rawContent: string, contentPath: string) => @@ -199,7 +216,7 @@ export const useTechDocsReaderDom = (entityRef: EntityName): Element | null => { .md-sidebar { position: fixed; bottom: 100px; width: 20rem; } .md-sidebar--secondary { right: 2rem; } .md-content { margin-bottom: 50px } - .md-footer { position: fixed; bottom: 0px; width: 100vw; } + .md-footer { position: fixed; bottom: 0px; } .md-footer-nav__link { width: 20rem;} .md-content { margin-left: 20rem; max-width: calc(100% - 20rem * 2 - 3rem); } .md-typeset { font-size: 1rem; } @@ -240,8 +257,11 @@ export const useTechDocsReaderDom = (entityRef: EntityName): Element | null => { .md-content__inner { font-size: 0.9rem } .md-footer { position: static; - margin-left: 10rem; - width: calc(100% - 10rem); + padding-left: 10rem; + } + .md-footer-nav__link { + /* footer links begin to overlap at small sizes without setting width */ + width: 50%; } .md-nav--primary .md-nav__title { white-space: normal; @@ -338,21 +358,32 @@ export const useTechDocsReaderDom = (entityRef: EntityName): Element | null => { scrollIntoAnchor(), addLinkClickListener({ baseUrl: window.location.origin, - onClick: (_: MouseEvent, url: string) => { + onClick: (event: MouseEvent, url: string) => { + // detect if CTRL or META keys are pressed so that links can be opened in a new tab with `window.open` + const modifierActive = event.ctrlKey || event.metaKey; const parsedUrl = new URL(url); + // hash exists when anchor is clicked on secondary sidebar if (parsedUrl.hash) { - navigate(`${parsedUrl.pathname}${parsedUrl.hash}`); - // Scroll to hash if it's on the current page - transformedElement - ?.querySelector(`#${parsedUrl.hash.slice(1)}`) - ?.scrollIntoView(); + if (modifierActive) { + window.open(`${parsedUrl.pathname}${parsedUrl.hash}`, '_blank'); + } else { + navigate(`${parsedUrl.pathname}${parsedUrl.hash}`); + // Scroll to hash if it's on the current page + transformedElement + ?.querySelector(`#${parsedUrl.hash.slice(1)}`) + ?.scrollIntoView(); + } } else { - navigate(parsedUrl.pathname); - // Scroll to top of reader if primary sidebar link is clicked - transformedElement - ?.querySelector('.md-content__inner') - ?.scrollIntoView(); + if (modifierActive) { + window.open(parsedUrl.pathname, '_blank'); + } else { + navigate(parsedUrl.pathname); + // Scroll to top of reader if primary sidebar link is clicked + transformedElement + ?.querySelector('.md-content__inner') + ?.scrollIntoView(); + } } }, }), diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.tsx index a8db3e1d15..aae88d406e 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.tsx @@ -17,7 +17,7 @@ import React, { useCallback, useState } from 'react'; import { useOutlet } from 'react-router'; import { useParams } from 'react-router-dom'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { techdocsApiRef } from '../../api'; import { TechDocsNotFound } from './TechDocsNotFound'; import { LegacyTechDocsPage } from './LegacyTechDocsPage'; diff --git a/plugins/techdocs/src/reader/components/TechDocsSearch.tsx b/plugins/techdocs/src/reader/components/TechDocsSearch.tsx index 5bc1947ed6..0760eb47f8 100644 --- a/plugins/techdocs/src/reader/components/TechDocsSearch.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsSearch.tsx @@ -27,7 +27,7 @@ import SearchIcon from '@material-ui/icons/Search'; import Autocomplete from '@material-ui/lab/Autocomplete'; import React, { ChangeEvent, useEffect, useState } from 'react'; import { useNavigate } from 'react-router'; -import { useDebounce } from 'react-use'; +import useDebounce from 'react-use/lib/useDebounce'; import { DocsResultListItem } from '../../components/DocsResultListItem'; type TechDocsSearchProps = { diff --git a/plugins/techdocs/src/reader/components/useRawPage.ts b/plugins/techdocs/src/reader/components/useRawPage.ts index 377a2d23ef..61b04a5a82 100644 --- a/plugins/techdocs/src/reader/components/useRawPage.ts +++ b/plugins/techdocs/src/reader/components/useRawPage.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { EntityName } from '@backstage/catalog-model'; -import { useAsyncRetry } from 'react-use'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { AsyncState } from 'react-use/lib/useAsync'; import { techdocsStorageApiRef } from '../../api'; import { useApi } from '@backstage/core-plugin-api'; diff --git a/plugins/techdocs/src/reader/components/useReaderState.ts b/plugins/techdocs/src/reader/components/useReaderState.ts index 07bd338de9..8bccb3cdb8 100644 --- a/plugins/techdocs/src/reader/components/useReaderState.ts +++ b/plugins/techdocs/src/reader/components/useReaderState.ts @@ -16,7 +16,8 @@ import { useApi } from '@backstage/core-plugin-api'; import { useMemo, useReducer, useRef } from 'react'; -import { useAsync, useAsyncRetry } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useAsyncRetry from 'react-use/lib/useAsyncRetry'; import { techdocsStorageApiRef } from '../../api'; /** diff --git a/plugins/todo/package.json b/plugins/todo/package.json index a2a94d11b1..7d06199a64 100644 --- a/plugins/todo/package.json +++ b/plugins/todo/package.json @@ -28,8 +28,8 @@ }, "dependencies": { "@backstage/catalog-model": "^0.9.7", - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.3", "@backstage/plugin-catalog-react": "^0.6.8", "@backstage/theme": "^0.2.14", @@ -42,9 +42,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/user-settings/CHANGELOG.md b/plugins/user-settings/CHANGELOG.md index c8293a7e7e..feb61f79e8 100644 --- a/plugins/user-settings/CHANGELOG.md +++ b/plugins/user-settings/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-user-settings +## 0.3.15 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.3.14 ### Patch Changes diff --git a/plugins/user-settings/package.json b/plugins/user-settings/package.json index f43fc36e17..c8fa6d2070 100644 --- a/plugins/user-settings/package.json +++ b/plugins/user-settings/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-user-settings", "description": "A Backstage plugin that provides a settings page", - "version": "0.3.14", + "version": "0.3.15", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -31,8 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -44,9 +44,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx b/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx index 35850b9d82..333050f2a4 100644 --- a/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsThemeToggle.tsx @@ -15,7 +15,7 @@ */ import React, { cloneElement } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; import AutoIcon from '@material-ui/icons/BrightnessAuto'; import ToggleButton from '@material-ui/lab/ToggleButton'; import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup'; diff --git a/plugins/user-settings/src/components/useUserProfileInfo.ts b/plugins/user-settings/src/components/useUserProfileInfo.ts index 6f9b5c154e..f893520cd2 100644 --- a/plugins/user-settings/src/components/useUserProfileInfo.ts +++ b/plugins/user-settings/src/components/useUserProfileInfo.ts @@ -21,7 +21,7 @@ import { useApi, } from '@backstage/core-plugin-api'; import { useEffect } from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; export const useUserProfile = () => { const identityApi = useApi(identityApiRef); diff --git a/plugins/xcmetrics/CHANGELOG.md b/plugins/xcmetrics/CHANGELOG.md index bc54626243..7f66a5c224 100644 --- a/plugins/xcmetrics/CHANGELOG.md +++ b/plugins/xcmetrics/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-xcmetrics +## 0.2.14 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/core-components@0.8.3 + ## 0.2.13 ### Patch Changes diff --git a/plugins/xcmetrics/package.json b/plugins/xcmetrics/package.json index 88001a68db..333826ba87 100644 --- a/plugins/xcmetrics/package.json +++ b/plugins/xcmetrics/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-xcmetrics", "description": "A Backstage plugin that shows XCode build metrics for your components", - "version": "0.2.13", + "version": "0.2.14", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.2", - "@backstage/core-plugin-api": "^0.4.0", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/errors": "^0.1.3", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", @@ -37,9 +37,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.4", - "@backstage/core-app-api": "^0.3.0", - "@backstage/dev-utils": "^0.2.15", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/dev-utils": "^0.2.16", "@backstage/test-utils": "^0.2.1", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/xcmetrics/src/components/BuildDetails/BuildDetails.tsx b/plugins/xcmetrics/src/components/BuildDetails/BuildDetails.tsx index 8732bd92d8..949f430ce2 100644 --- a/plugins/xcmetrics/src/components/BuildDetails/BuildDetails.tsx +++ b/plugins/xcmetrics/src/components/BuildDetails/BuildDetails.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { BuildResponse, xcmetricsApiRef } from '../../api'; import { Progress, StructuredMetadataTable } from '@backstage/core-components'; import { Alert } from '@material-ui/lab'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { formatDuration, formatStatus, formatTime } from '../../utils'; import { StatusIcon } from '../StatusIcon'; diff --git a/plugins/xcmetrics/src/components/BuildListFilter/BuildListFilter.tsx b/plugins/xcmetrics/src/components/BuildListFilter/BuildListFilter.tsx index 8c1334f928..9a2b759235 100644 --- a/plugins/xcmetrics/src/components/BuildListFilter/BuildListFilter.tsx +++ b/plugins/xcmetrics/src/components/BuildListFilter/BuildListFilter.tsx @@ -20,7 +20,7 @@ import FilterList from '@material-ui/icons/FilterList'; import { InfoCard, Select } from '@backstage/core-components'; import { BackstageTheme } from '@backstage/theme'; import { useApi } from '@backstage/core-plugin-api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { BuildFilters, BuildStatus, xcmetricsApiRef } from '../../api'; import { DatePicker } from '../DatePicker'; diff --git a/plugins/xcmetrics/src/components/Overview/Overview.tsx b/plugins/xcmetrics/src/components/Overview/Overview.tsx index e7a9a1d705..22fd3185a0 100644 --- a/plugins/xcmetrics/src/components/Overview/Overview.tsx +++ b/plugins/xcmetrics/src/components/Overview/Overview.tsx @@ -24,7 +24,7 @@ import { } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; import { xcmetricsApiRef } from '../../api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { Alert } from '@material-ui/lab'; import { StatusMatrix } from '../StatusMatrix'; import { Grid } from '@material-ui/core'; diff --git a/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx b/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx index 8b16d689bb..4c791688be 100644 --- a/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx +++ b/plugins/xcmetrics/src/components/OverviewTrends/OverviewTrends.tsx @@ -19,7 +19,7 @@ import { Progress, Select } from '@backstage/core-components'; import { Trend } from '../Trend'; import { Alert, AlertTitle } from '@material-ui/lab'; import { xcmetricsApiRef } from '../../api'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { DataValueGridItem } from '../DataValue'; import { diff --git a/plugins/xcmetrics/src/components/StatusCell/StatusCell.tsx b/plugins/xcmetrics/src/components/StatusCell/StatusCell.tsx index 2cdb5c9d39..387879b3a0 100644 --- a/plugins/xcmetrics/src/components/StatusCell/StatusCell.tsx +++ b/plugins/xcmetrics/src/components/StatusCell/StatusCell.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { BackstageTheme } from '@backstage/theme'; import { BuildStatus, BuildStatusResult, xcmetricsApiRef } from '../../api'; import { cn, formatDuration, formatStatus } from '../../utils'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import { useApi } from '@backstage/core-plugin-api'; import { Progress } from '@backstage/core-components'; diff --git a/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx b/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx index e7f3294e6d..6e78c822ad 100644 --- a/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx +++ b/plugins/xcmetrics/src/components/StatusMatrix/StatusMatrix.tsx @@ -17,7 +17,8 @@ import React from 'react'; import { makeStyles } from '@material-ui/core'; import { BackstageTheme } from '@backstage/theme'; import { xcmetricsApiRef } from '../../api'; -import { useAsync, useMeasure } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; +import useMeasure from 'react-use/lib/useMeasure'; import { cn } from '../../utils'; import { useApi } from '@backstage/core-plugin-api'; import { Alert } from '@material-ui/lab'; diff --git a/scripts/verify-changesets.js b/scripts/verify-changesets.js new file mode 100755 index 0000000000..8d828ee058 --- /dev/null +++ b/scripts/verify-changesets.js @@ -0,0 +1,88 @@ +#!/usr/bin/env node +/* + * 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. + */ + +/* eslint-disable import/no-extraneous-dependencies */ + +const { resolve: resolvePath } = require('path'); +const fs = require('fs-extra'); +const { default: parseChangeset } = require('@changesets/parse'); + +const privatePackages = new Set([ + 'example-app', + 'example-backend', + 'e2e-test', + 'storybook', + 'embedded-techdocs-app', +]); + +async function main() { + process.chdir(resolvePath(__dirname, '../.changeset')); + + const fileNames = await fs.readdir('.'); + const changesetNames = fileNames.filter( + name => name.endsWith('.md') && name !== 'README.md', + ); + + const changesets = await Promise.all( + changesetNames.map(async name => { + const content = await fs.readFile(name, 'utf8'); + return { name, ...parseChangeset(content) }; + }), + ); + + const errors = []; + for (const changeset of changesets) { + const privateReleases = changeset.releases.filter(release => + privatePackages.has(release.name), + ); + if (privateReleases.length > 0) { + const names = privateReleases + .map(release => `'${release.name}'`) + .join(', '); + errors.push({ + name: changeset.name, + messages: [ + `Should not contain releases of the following packages since they are not published: ${names}`, + ], + }); + } + } + + if (errors.length) { + console.log(); + console.log('***********************************************************'); + console.log('* Changeset verification failed! *'); + console.log('***********************************************************'); + console.log(); + for (const error of errors) { + console.error(`Changeset '${error.name}' is invalid:`); + console.log(); + for (const message of error.messages) { + console.error(` ${message}`); + } + } + console.log(); + console.log('***********************************************************'); + console.log(); + process.exit(1); + } +} + +main().catch(error => { + console.error(error.stack); + process.exit(1); +}); diff --git a/yarn.lock b/yarn.lock index 7d9f2b2c99..7570e7b624 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2080,7 +2080,7 @@ core-js-pure "^3.16.0" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.0", "@babel/runtime@^7.10.1", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.4", "@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.0", "@babel/runtime@^7.14.6", "@babel/runtime@^7.14.8", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.0", "@babel/runtime@^7.10.1", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.4", "@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.0", "@babel/runtime@^7.14.6", "@babel/runtime@^7.14.8", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.16.3" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== @@ -2174,390 +2174,6 @@ "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" -"@backstage/catalog-client@^0.3.18": - version "0.3.19" - resolved "https://registry.npmjs.org/@backstage/catalog-client/-/catalog-client-0.3.19.tgz#109b0fde1cc2d9a306635f3775fc8f6174172b14" - integrity sha512-0ydcC/1ISNgR8SggOUnMNNHtsRwrKN5GX+AXgTVdZk4qpz1MqG1+fzrNld9V7KVvXdsbGDZAl/b5a7/FJEpCqg== - dependencies: - "@backstage/catalog-model" "^0.9.2" - "@backstage/config" "^0.1.9" - "@backstage/errors" "^0.1.2" - cross-fetch "^3.0.6" - -"@backstage/core-app-api@^0.1.13", "@backstage/core-app-api@^0.1.16", "@backstage/core-app-api@^0.1.3", "@backstage/core-app-api@^0.1.6": - version "0.1.24" - resolved "https://registry.npmjs.org/@backstage/core-app-api/-/core-app-api-0.1.24.tgz#4cfc366c56de3e698218770eacb59a0aa16c8f05" - integrity sha512-TJ2F+8UjwBQqlSd6y3RpPwdmJfLsvds2OaH3TuiFvjdpogqboIjWGq3nIgxzhe+vxYoWLhoHrMoJYP4IpF7VQQ== - dependencies: - "@backstage/app-defaults" "^0.1.1" - "@backstage/config" "^0.1.11" - "@backstage/core-components" "^0.7.6" - "@backstage/core-plugin-api" "^0.2.2" - "@backstage/theme" "^0.2.14" - "@backstage/types" "^0.1.1" - "@backstage/version-bridge" "^0.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@types/prop-types" "^15.7.3" - "@types/react" "*" - prop-types "^15.7.2" - react "^16.12.0" - react-router-dom "6.0.0-beta.0" - react-use "^17.2.4" - zen-observable "^0.8.15" - -"@backstage/core-app-api@^0.2.0": - version "0.2.1" - resolved "https://registry.npmjs.org/@backstage/core-app-api/-/core-app-api-0.2.1.tgz#cdaaee797834d0efaaf56110d3e48fa57f4195ce" - integrity sha512-883TxnfDWLgYd91NxEPMUnXQsvZRCObl/MTagErhkhRSty3VEf8Aeh2bAEzzv+oHq+Zde284zBs8PFnf3AN2vw== - dependencies: - "@backstage/app-defaults" "^0.1.2" - "@backstage/config" "^0.1.11" - "@backstage/core-components" "^0.8.1" - "@backstage/core-plugin-api" "^0.3.1" - "@backstage/theme" "^0.2.14" - "@backstage/types" "^0.1.1" - "@backstage/version-bridge" "^0.1.1" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@types/prop-types" "^15.7.3" - prop-types "^15.7.2" - react-router-dom "6.0.0-beta.0" - react-use "^17.2.4" - zen-observable "^0.8.15" - -"@backstage/core-components@^0.3.0": - version "0.3.3" - resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.3.3.tgz#ec63eac6d789303f90219857849fa1cefe4e0dde" - integrity sha512-u75+YiXu33NHSFT5MqTgY+uqtxyye4Tmy3I7D21wLUgeW6aFhmS1IUBGckCqv8UG1nqZS7gBmJLccm88tDsJaA== - dependencies: - "@backstage/config" "^0.1.8" - "@backstage/core-plugin-api" "^0.1.6" - "@backstage/errors" "^0.1.1" - "@backstage/theme" "^0.2.10" - "@material-table/core" "^3.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.45" - "@testing-library/react-hooks" "^3.4.2" - "@types/dagre" "^0.7.44" - "@types/prop-types" "^15.7.3" - "@types/react" "*" - "@types/react-sparklines" "^1.7.0" - "@types/react-text-truncate" "^0.14.0" - classnames "^2.2.6" - clsx "^1.1.0" - d3-selection "^2.0.0" - d3-shape "^2.0.0" - d3-zoom "^2.0.0" - dagre "^0.8.5" - immer "^9.0.1" - lodash "^4.17.15" - pluralize "^8.0.0" - prop-types "^15.7.2" - qs "^6.9.4" - rc-progress "^3.0.0" - react "^16.12.0" - react-dom "^16.12.0" - react-helmet "6.1.0" - react-hook-form "^6.15.4" - react-markdown "^5.0.2" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - react-sparklines "^1.7.0" - react-syntax-highlighter "^15.4.3" - react-text-truncate "^0.16.0" - react-use "^17.2.4" - remark-gfm "^1.0.0" - zen-observable "^0.8.15" - -"@backstage/core-components@^0.4.2": - version "0.4.2" - resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.4.2.tgz#a80dceabdfb43b794b43d6436919688ff4da15ca" - integrity sha512-WACyEaD+k2v2MEeJ52Kyj/Rw3a2agIqW9FXnYP+xCAWia8kw1cBX8eMXRblsEV8xwheTQzyd1lzeIpdkyGhhQg== - dependencies: - "@backstage/config" "^0.1.9" - "@backstage/core-plugin-api" "^0.1.8" - "@backstage/errors" "^0.1.2" - "@backstage/theme" "^0.2.10" - "@material-table/core" "^3.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.57" - "@testing-library/react-hooks" "^3.4.2" - "@types/dagre" "^0.7.44" - "@types/prop-types" "^15.7.3" - "@types/react" "*" - "@types/react-sparklines" "^1.7.0" - "@types/react-text-truncate" "^0.14.0" - classnames "^2.2.6" - clsx "^1.1.0" - d3-selection "^2.0.0" - d3-shape "^2.0.0" - d3-zoom "^2.0.0" - dagre "^0.8.5" - immer "^9.0.1" - lodash "^4.17.15" - pluralize "^8.0.0" - prop-types "^15.7.2" - qs "^6.9.4" - rc-progress "^3.0.0" - react "^16.12.0" - react-dom "^16.12.0" - react-helmet "6.1.0" - react-hook-form "^7.12.2" - react-markdown "^5.0.2" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - react-sparklines "^1.7.0" - react-syntax-highlighter "^15.4.3" - react-text-truncate "^0.16.0" - react-use "^17.2.4" - remark-gfm "^1.0.0" - zen-observable "^0.8.15" - -"@backstage/core-components@^0.5.0": - version "0.5.0" - resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.5.0.tgz#e81ea9371afbeb07276a6db66b5da6ceac701645" - integrity sha512-C5RXeK5Vd2N2dKXbiJVqVBTst3+hy3cuPA/mwOPed74W6T3hHWFe5DZGyPGzCRLz2ZTHWlCGRfwG2KLz66YjNw== - dependencies: - "@backstage/config" "^0.1.10" - "@backstage/core-plugin-api" "^0.1.8" - "@backstage/errors" "^0.1.2" - "@backstage/theme" "^0.2.10" - "@material-table/core" "^3.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.57" - "@testing-library/react-hooks" "^3.4.2" - "@types/dagre" "^0.7.44" - "@types/prop-types" "^15.7.3" - "@types/react" "*" - "@types/react-sparklines" "^1.7.0" - "@types/react-text-truncate" "^0.14.0" - classnames "^2.2.6" - clsx "^1.1.0" - d3-selection "^2.0.0" - d3-shape "^2.0.0" - d3-zoom "^2.0.0" - dagre "^0.8.5" - immer "^9.0.1" - lodash "^4.17.21" - pluralize "^8.0.0" - prop-types "^15.7.2" - qs "^6.9.4" - rc-progress "^3.0.0" - react "^16.12.0" - react-dom "^16.12.0" - react-helmet "6.1.0" - react-hook-form "^7.12.2" - react-markdown "^5.0.2" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - react-sparklines "^1.7.0" - react-syntax-highlighter "^15.4.3" - react-text-truncate "^0.16.0" - react-use "^17.2.4" - remark-gfm "^1.0.0" - zen-observable "^0.8.15" - -"@backstage/core-components@^0.6.1": - version "0.6.1" - resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.6.1.tgz#65cfc704828f76c48ad5115404779206bb6fe1bb" - integrity sha512-gQRRcYEv98BFLpVW5nu2MhuzgjoMVEhPMyUSRc9NYa58GA1D8Q7zV7xYdbfCanMOlKDmi+rQ3Cp2u6C60+uhNg== - dependencies: - "@backstage/config" "^0.1.10" - "@backstage/core-plugin-api" "^0.1.10" - "@backstage/errors" "^0.1.2" - "@backstage/theme" "^0.2.10" - "@material-table/core" "^3.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.57" - "@types/dagre" "^0.7.44" - "@types/react" "*" - "@types/react-sparklines" "^1.7.0" - "@types/react-text-truncate" "^0.14.0" - classnames "^2.2.6" - clsx "^1.1.0" - d3-selection "^2.0.0" - d3-shape "^2.0.0" - d3-zoom "^2.0.0" - dagre "^0.8.5" - immer "^9.0.1" - lodash "^4.17.21" - pluralize "^8.0.0" - prop-types "^15.7.2" - qs "^6.9.4" - rc-progress "^3.0.0" - react "^16.12.0" - react-dom "^16.12.0" - react-helmet "6.1.0" - react-hook-form "^7.12.2" - react-markdown "^5.0.2" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - react-sparklines "^1.7.0" - react-syntax-highlighter "^15.4.3" - react-text-truncate "^0.16.0" - react-use "^17.2.4" - remark-gfm "^1.0.0" - zen-observable "^0.8.15" - -"@backstage/core-components@^0.7.6": - version "0.7.6" - resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.7.6.tgz#2d29480b13c607c8ea8a2821a06326bd05ca3db8" - integrity sha512-aB0ndQDxjNW8Tkzs0rhABd8qF2wLC9f0PWKT3RMh5Tovmg6Y/OOhj+YDzlsPrYJFLwfIwFDC4iA+H1WdkFe7tg== - dependencies: - "@backstage/config" "^0.1.11" - "@backstage/core-plugin-api" "^0.2.2" - "@backstage/errors" "^0.1.5" - "@backstage/theme" "^0.2.14" - "@material-table/core" "^3.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.57" - "@types/react" "*" - "@types/react-sparklines" "^1.7.0" - "@types/react-text-truncate" "^0.14.0" - classnames "^2.2.6" - clsx "^1.1.0" - d3-selection "^3.0.0" - d3-shape "^3.0.0" - d3-zoom "^3.0.0" - dagre "^0.8.5" - immer "^9.0.1" - lodash "^4.17.21" - pluralize "^8.0.0" - prop-types "^15.7.2" - qs "^6.9.4" - rc-progress "^3.0.0" - react "^16.12.0" - react-dom "^16.12.0" - react-helmet "6.1.0" - react-hook-form "^7.12.2" - react-markdown "^7.0.1" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - react-sparklines "^1.7.0" - react-syntax-highlighter "^15.4.3" - react-text-truncate "^0.16.0" - react-use "^17.2.4" - remark-gfm "^2.0.0" - zen-observable "^0.8.15" - -"@backstage/core-plugin-api@^0.1.10", "@backstage/core-plugin-api@^0.1.3", "@backstage/core-plugin-api@^0.1.4", "@backstage/core-plugin-api@^0.1.6", "@backstage/core-plugin-api@^0.1.8": - version "0.1.13" - resolved "https://registry.npmjs.org/@backstage/core-plugin-api/-/core-plugin-api-0.1.13.tgz#583c0fe3440450c304f13dcc85eac3bd80f357d7" - integrity sha512-BWEqleTXR7m7nsCyt6cEnc+Gx/VT4vLdNr9fc1kXfzSAA7cUT4VKjlVmm5kdyih3BSQ4+0k7Pm/NIf0jfa7rlg== - dependencies: - "@backstage/config" "^0.1.11" - "@backstage/theme" "^0.2.13" - "@backstage/types" "^0.1.1" - "@backstage/version-bridge" "^0.1.0" - "@material-ui/core" "^4.12.2" - "@types/react" "*" - history "^5.0.0" - prop-types "^15.7.2" - react "^16.12.0" - react-router-dom "6.0.0-beta.0" - react-use "^17.2.4" - zen-observable "^0.8.15" - -"@backstage/core-plugin-api@^0.2.2": - version "0.2.2" - resolved "https://registry.npmjs.org/@backstage/core-plugin-api/-/core-plugin-api-0.2.2.tgz#e746b8595959a9d4acdbe4d6bc5b71d591d0cd1b" - integrity sha512-04TMAX75cBTOMYdKTIgp8FAz4BRrCC9s7YDIBpUM0z+d1UlfCWe48EmP2igPsCt/8apcw38gdR81BPlqzoD6UA== - dependencies: - "@backstage/config" "^0.1.11" - "@backstage/theme" "^0.2.14" - "@backstage/types" "^0.1.1" - "@backstage/version-bridge" "^0.1.0" - "@material-ui/core" "^4.12.2" - "@types/react" "*" - history "^5.0.0" - prop-types "^15.7.2" - react "^16.12.0" - react-router-dom "6.0.0-beta.0" - react-use "^17.2.4" - zen-observable "^0.8.15" - -"@backstage/core-plugin-api@^0.3.0", "@backstage/core-plugin-api@^0.3.1": - version "0.3.1" - resolved "https://registry.npmjs.org/@backstage/core-plugin-api/-/core-plugin-api-0.3.1.tgz#b26402b1570b532e3d61817e6e6fca3b6450e3d8" - integrity sha512-beHcA6LQH0sTqEV76hZOCGU+H0zVLC0p5nRF6uHGY23ogL/7/Ab5uJUVqKVijWrCBil3uCHN+XsSOQf2ZVN/Lw== - dependencies: - "@backstage/config" "^0.1.11" - "@backstage/theme" "^0.2.14" - "@backstage/types" "^0.1.1" - "@backstage/version-bridge" "^0.1.1" - "@material-ui/core" "^4.12.2" - history "^5.0.0" - prop-types "^15.7.2" - react-router-dom "6.0.0-beta.0" - react-use "^17.2.4" - zen-observable "^0.8.15" - -"@backstage/integration@^0.6.4", "@backstage/integration@^0.6.7": - version "0.6.10" - resolved "https://registry.npmjs.org/@backstage/integration/-/integration-0.6.10.tgz#e55a26f5124445de74e46944f63c263c9b985995" - integrity sha512-qGAZ7rflWdZdjUgxzLWmkrR1zPC5ep62d0fqtwg77MZsGwBNrbNOI2qJbk+IRPmOgym2Adg2C95O2UV7Hyde7g== - dependencies: - "@backstage/config" "^0.1.11" - "@octokit/auth-app" "^3.4.0" - "@octokit/rest" "^18.5.3" - cross-fetch "^3.0.6" - git-url-parse "^11.6.0" - lodash "^4.17.21" - luxon "^2.0.2" - -"@backstage/plugin-catalog-react@^0.4.0": - version "0.4.6" - resolved "https://registry.npmjs.org/@backstage/plugin-catalog-react/-/plugin-catalog-react-0.4.6.tgz#f33f3cd734f110d3c547f7eae4e25d14806ec796" - integrity sha512-DQO9/oE4mWty6cyUCHiDbf9jFOEPtS0HB+DHiXHHzI7nCC/89p05RiKZpo3ctd5p5oENAYmWO4G7eVJkf5NjiA== - dependencies: - "@backstage/catalog-client" "^0.3.18" - "@backstage/catalog-model" "^0.9.1" - "@backstage/core-app-api" "^0.1.13" - "@backstage/core-components" "^0.4.2" - "@backstage/core-plugin-api" "^0.1.8" - "@backstage/integration" "^0.6.4" - "@backstage/version-bridge" "^0.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.57" - "@types/react" "*" - jwt-decode "^3.1.0" - lodash "^4.17.15" - qs "^6.9.4" - react "^16.13.1" - react-router "6.0.0-beta.0" - react-router-dom "6.0.0-beta.0" - react-use "^17.2.4" - -"@backstage/plugin-catalog-react@^0.5.0": - version "0.5.2" - resolved "https://registry.npmjs.org/@backstage/plugin-catalog-react/-/plugin-catalog-react-0.5.2.tgz#7d1af3b0aa2397e4c62847fe78b8fe5afd90ee07" - integrity sha512-eoVGSrFyPWgMNZY9rMwEm0QS7B+FRLR2L+nRUlFjK4YnGQCYMXMZroJqSMRdBqBKlPiMgZO2AzZiFROcpSPwmA== - dependencies: - "@backstage/catalog-client" "^0.5.0" - "@backstage/catalog-model" "^0.9.4" - "@backstage/core-app-api" "^0.1.16" - "@backstage/core-components" "^0.6.1" - "@backstage/core-plugin-api" "^0.1.10" - "@backstage/integration" "^0.6.7" - "@backstage/version-bridge" "^0.1.0" - "@material-ui/core" "^4.12.2" - "@material-ui/icons" "^4.9.1" - "@material-ui/lab" "4.0.0-alpha.57" - "@types/react" "*" - jwt-decode "^3.1.0" - lodash "^4.17.21" - qs "^6.9.4" - react "^16.13.1" - react-router "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" @@ -3692,17 +3308,18 @@ tslib "~2.3.0" value-or-promise "1.0.11" -"@grpc/grpc-js@~1.3.0": - version "1.3.2" - resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.3.2.tgz#eae97e6daf5abd49a7818aadeca0744dfb1ebca1" - integrity sha512-UXepkOKCATJrhHGsxt+CGfpZy9zUn1q9mop5kfcXq1fBkTePxVNPOdnISlCbJFlCtld+pSLGyZCzr9/zVprFKA== +"@grpc/grpc-js@~1.4.0": + version "1.4.5" + resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.4.5.tgz#0cd840b47180624eeedf066f2cdc422d052401f8" + integrity sha512-A6cOzSu7dqXZ7rzvh/9JZf+Jg/MOpLEMP0IdT8pT8hrWJZ6TB4ydN/MRuqOtAugInJe/VQ9F8BPricUpYZSaZA== dependencies: + "@grpc/proto-loader" "^0.6.4" "@types/node" ">=12.12.47" -"@grpc/proto-loader@^0.6.1": - version "0.6.2" - resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.2.tgz#412575f3ff5ef0a9b79d4ea12c08cba5601041cb" - integrity sha512-q2Qle60Ht2OQBCp9S5hv1JbI4uBBq6/mqSevFNK3ZEgRDBCAkWqZPUhD/K9gXOHrHKluliHiVq2L9sw1mVyAIg== +"@grpc/proto-loader@^0.6.1", "@grpc/proto-loader@^0.6.4": + version "0.6.7" + resolved "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.7.tgz#e62a202f4cf5897bdd0e244dec1dbc80d84bdfa1" + integrity sha512-QzTPIyJxU0u+r2qGe8VMl3j/W2ryhEvBv7hc42OjYfthSj370fUrb7na65rG6w3YLZS/fb8p89iTBobfWGDgdw== dependencies: "@types/long" "^4.0.1" lodash.camelcase "^4.3.0" @@ -5568,15 +5185,15 @@ resolved "https://registry.npmjs.org/@rjsf/material-ui/-/material-ui-3.2.1.tgz#84fbf322485aee3a84101e189161f0687779ec8d" integrity sha512-8UiDeDbjCImFSfOegGu13otQ7OdP9FOYpcLjeouppnhs+MPeIEAtYS+jCcBKmi3reyTagC15/KVSRhde1wS1vg== -"@roadiehq/backstage-plugin-github-insights@^1.2.2": - version "1.3.4" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-insights/-/backstage-plugin-github-insights-1.3.4.tgz#dc7b8e50186f52c704964c06a77604b512e83444" - integrity sha512-wVri2Z5sKgyVQDt68WAi3H2IdkAzRljMLnuwYu/CWnCQkprcIJlIknzZK5aNjtMnNhKZDY+mHMgEPydl85Tjxw== +"@roadiehq/backstage-plugin-github-insights@^1.4.2": + version "1.4.2" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-insights/-/backstage-plugin-github-insights-1.4.2.tgz#462e2868a1b4cee338032e4715ad797db71ebd22" + integrity sha512-hIGOhzyK1rC3JI+y/yI303whdRJTN4KXCYHekcdchjlTKB31SMU4lER0sBacCyiov1vAl+LkDmdubESSLou/Hw== dependencies: "@backstage/catalog-model" "^0.9.7" - "@backstage/core-app-api" "^0.2.0" + "@backstage/core-app-api" "^0.3.0" "@backstage/core-components" "^0.8.0" - "@backstage/core-plugin-api" "^0.3.0" + "@backstage/core-plugin-api" "^0.4.0" "@backstage/integration-react" "^0.1.10" "@backstage/plugin-catalog-react" "^0.6.5" "@backstage/theme" "^0.2.7" @@ -5592,16 +5209,16 @@ react-router "^6.0.0-beta.0" react-use "^17.2.4" -"@roadiehq/backstage-plugin-github-pull-requests@^1.0.13": - version "1.0.15" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-1.0.15.tgz#a60a59d825dc4cb5373263228ca546ebff6b6313" - integrity sha512-cNlSJgbRAE8HWsx/uHOhmQiQjLHynUB9Nq6IzovCbJmXU13JYkXit+jlrw+tMbPaTB826VEKXkOO+u2pNvkV9A== +"@roadiehq/backstage-plugin-github-pull-requests@^1.3.2": + version "1.3.2" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-1.3.2.tgz#1804206853dd5305c98e571112f87b85ae1ebcfd" + integrity sha512-oUZVcBjOtEWKKzV4JyoDYL11m2evUAxlB/D/MyMvNZaKc/rk4VtXMSRtP9ceh9mRusC2aKwJItYqByQWHXwXdg== dependencies: - "@backstage/catalog-model" "^0.9.0" - "@backstage/core-app-api" "^0.1.3" - "@backstage/core-components" "^0.5.0" - "@backstage/core-plugin-api" "^0.1.3" - "@backstage/plugin-catalog-react" "^0.5.0" + "@backstage/catalog-model" "^0.9.7" + "@backstage/core-app-api" "^0.3.0" + "@backstage/core-components" "^0.8.0" + "@backstage/core-plugin-api" "^0.4.0" + "@backstage/plugin-catalog-react" "^0.6.5" "@material-ui/core" "^4.11.0" "@material-ui/icons" "^4.9.1" "@octokit/rest" "^18.5.3" @@ -5615,16 +5232,16 @@ react-router "6.0.0-beta.0" react-use "^17.2.4" -"@roadiehq/backstage-plugin-travis-ci@^1.0.11": - version "1.0.11" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-travis-ci/-/backstage-plugin-travis-ci-1.0.11.tgz#427c14a93a9f1f62ab42c5f149ab1beba1178fd2" - integrity sha512-EAWIyprpjm6tkHX3AFqZFFf6B74soAbwwO0RJhTfGIPTa/t8H7g5AR5tUF283rmuA2KupYutT5ywXY2Bqcjfyw== +"@roadiehq/backstage-plugin-travis-ci@^1.3.2": + version "1.3.2" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-travis-ci/-/backstage-plugin-travis-ci-1.3.2.tgz#f49d46475cd09776a6cb8c10c07805bb003d7e75" + integrity sha512-weaUg8s6oQ4x2FtH3ruKjhgi6+bBkYPoRmAbVBRxtMvB+sPNuSUmbliuwJbA9wEyrXxsPyi0VYHbAj6CKCf+Tg== dependencies: - "@backstage/catalog-model" "^0.9.0" - "@backstage/core-app-api" "^0.1.6" - "@backstage/core-components" "^0.3.0" - "@backstage/core-plugin-api" "^0.1.4" - "@backstage/plugin-catalog-react" "^0.4.0" + "@backstage/catalog-model" "^0.9.7" + "@backstage/core-app-api" "^0.3.0" + "@backstage/core-components" "^0.8.0" + "@backstage/core-plugin-api" "^0.4.0" + "@backstage/plugin-catalog-react" "^0.6.5" "@backstage/theme" "^0.2.9" "@material-ui/core" "^4.11.3" "@material-ui/icons" "^4.11.2" @@ -7094,14 +6711,6 @@ lodash "^4.17.15" redent "^3.0.0" -"@testing-library/react-hooks@^3.4.2": - version "3.4.2" - resolved "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-3.4.2.tgz#8deb94f7684e0d896edd84a4c90e5b79a0810bc2" - integrity sha512-RfPG0ckOzUIVeIqlOc1YztKgFW+ON8Y5xaSPbiBkfj9nMkkiLhLeBXT5icfPX65oJV/zCZu4z8EVnUc6GY9C5A== - dependencies: - "@babel/runtime" "^7.5.4" - "@types/testing-library__react-hooks" "^3.4.0" - "@testing-library/react-hooks@^7.0.2": version "7.0.2" resolved "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-7.0.2.tgz#3388d07f562d91e7f2431a4a21b5186062ecfee0" @@ -7187,20 +6796,13 @@ dependencies: ansi-regex "*" -"@types/archiver@^5.1.0": +"@types/archiver@^5.1.0", "@types/archiver@^5.1.1": version "5.3.0" resolved "https://registry.npmjs.org/@types/archiver/-/archiver-5.3.0.tgz#2b34ba56d4d7102d256b922c7e91e09eab79db6f" integrity sha512-qJ79qsmq7O/k9FYwsF6O1xVA1PeLV+9Bh3TYkVCu3VzMR6vN9JQkgEOh/rrQ0R+F4Ta+R3thHGewxQtFglwVfg== dependencies: "@types/glob" "*" -"@types/archiver@^5.1.1": - version "5.1.1" - resolved "https://registry.npmjs.org/@types/archiver/-/archiver-5.1.1.tgz#d6d7610de4386b293abd5c1cb1875e0a4f4e1c30" - integrity sha512-heuaCk0YH5m274NOLSi66H1zX6GtZoMsdE6TYFcpFFjBjg0FoU4i4/M/a/kNlgNg26Xk3g364mNOYe1JaiEPOQ== - dependencies: - "@types/glob" "*" - "@types/argparse@1.0.38": version "1.0.38" resolved "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9" @@ -7992,6 +7594,11 @@ resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== +"@types/minimatch@^3.0.5": + version "3.0.5" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== + "@types/minimist@^1.2.0": version "1.2.2" resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" @@ -8272,7 +7879,7 @@ dependencies: "@types/react" "*" -"@types/react-test-renderer@*", "@types/react-test-renderer@>=16.9.0": +"@types/react-test-renderer@>=16.9.0": version "16.9.2" resolved "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-16.9.2.tgz#e1c408831e8183e5ad748fdece02214a7c2ab6c5" integrity sha512-4eJr1JFLIAlWhzDkBCkhrOIWOvOxcCAfQh+jiKg7l/nNZcCIL2MHl2dZhogIFKyHzedVWHaVP1Yydq/Ruu4agw== @@ -8317,9 +7924,9 @@ csstype "^3.0.2" "@types/recharts@^1.8.14", "@types/recharts@^1.8.15": - version "1.8.19" - resolved "https://registry.npmjs.org/@types/recharts/-/recharts-1.8.19.tgz#047f72cf4c25df545aa1085fe3a085e58a2483c1" - integrity sha512-Fd2cYnBlWz/ga8rLmjwsZNBAc4CzXZiuTYPPqMIgrtQ02yI/OTm8WPM6ZyUuYlSdyangtsvFmHWzZ7W4tuknDA== + version "1.8.23" + resolved "https://registry.npmjs.org/@types/recharts/-/recharts-1.8.23.tgz#eeb6c52c6b2b916e9383bd5cf8fb5fd941c9c6fe" + integrity sha512-O/mIPm9f6dwRWfenOI3GQwsGta3x1YWjwqXOCZqC0MATQ6C+A+Jc8VxFnSUr4N3uYv64zkq90RwXFaMNbhJKvg== dependencies: "@types/d3-shape" "^1" "@types/react" "*" @@ -8557,13 +8164,6 @@ dependencies: "@types/jest" "*" -"@types/testing-library__react-hooks@^3.4.0": - version "3.4.1" - resolved "https://registry.npmjs.org/@types/testing-library__react-hooks/-/testing-library__react-hooks-3.4.1.tgz#b8d7311c6c1f7db3103e94095fe901f8fef6e433" - integrity sha512-G4JdzEcq61fUyV6wVW9ebHWEiLK2iQvaBuCHHn9eMSbZzVh4Z4wHnUGIvQOYCCYeu5DnUtFyNYuAAgbSaO/43Q== - dependencies: - "@types/react-test-renderer" "*" - "@types/through@*": version "0.0.30" resolved "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz#e0e42ce77e897bd6aead6f6ea62aeb135b8a3895" @@ -10183,9 +9783,9 @@ axobject-query@^2.2.0: integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== azure-devops-node-api@^11.0.1: - version "11.0.1" - resolved "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.0.1.tgz#b7ec4783230e1de8fc972b23effe7ed2ebac17ff" - integrity sha512-YMdjAw9l5p/6leiyIloxj3k7VIvYThKjvqgiQn88r3nhT93ENwsoDS3A83CyJ4uTWzCZ5f5jCi6c27rTU5Pz+A== + version "11.1.0" + resolved "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.1.0.tgz#ea3ca49de8583b0366d000f3c3f8a75b8104055f" + integrity sha512-6/2YZuf+lJzJLrjXNYEA5RXAkMCb8j/4VcHD0qJQRsgG/KsRMYo0HgDh0by1FGHyZkQWY5LmQyJqCwRVUB3Y7Q== dependencies: tunnel "0.0.6" typed-rest-client "^1.8.4" @@ -11671,7 +11271,7 @@ cloneable-readable@^1.0.0: process-nextick-args "^2.0.0" readable-stream "^2.3.5" -clsx@^1.0.2, clsx@^1.0.4, clsx@^1.1.0: +clsx@^1.0.2, clsx@^1.0.4: version "1.1.1" resolved "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== @@ -12566,20 +12166,18 @@ css-loader@^3.6.0: schema-utils "^2.7.0" semver "^6.3.0" -css-loader@^5.2.6: - version "5.2.6" - resolved "https://registry.npmjs.org/css-loader/-/css-loader-5.2.6.tgz#c3c82ab77fea1f360e587d871a6811f4450cc8d1" - integrity sha512-0wyN5vXMQZu6BvjbrPdUJvkCzGEO24HC7IS7nW4llc6BBFC+zwR9CKtYGv63Puzsg10L/o12inMY5/2ByzfD6w== +css-loader@^6.5.1: + version "6.5.1" + resolved "https://registry.npmjs.org/css-loader/-/css-loader-6.5.1.tgz#0c43d4fbe0d97f699c91e9818cb585759091d1b1" + integrity sha512-gEy2w9AnJNnD9Kuo4XAP9VflW/ujKoS9c/syO+uWMlm5igc7LysKzPXaDoR2vroROkSwsTS2tGr1yGGEbZOYZQ== dependencies: icss-utils "^5.1.0" - loader-utils "^2.0.0" postcss "^8.2.15" postcss-modules-extract-imports "^3.0.0" postcss-modules-local-by-default "^4.0.0" postcss-modules-scope "^3.0.0" postcss-modules-values "^4.0.0" postcss-value-parser "^4.1.0" - schema-utils "^3.0.0" semver "^7.3.5" css-select-base-adapter@^0.1.1: @@ -12867,11 +12465,6 @@ d3-color@1: resolved "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz#c52002bf8846ada4424d55d97982fef26eb3bc8a" integrity sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q== -"d3-color@1 - 2": - version "2.0.0" - resolved "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz#8d625cab42ed9b8f601a1760a389f7ea9189d62e" - integrity sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ== - "d3-color@1 - 3": version "3.0.1" resolved "https://registry.npmjs.org/d3-color/-/d3-color-3.0.1.tgz#03316e595955d1fcd39d9f3610ad41bb90194d0a" @@ -12887,14 +12480,6 @@ d3-color@1: resolved "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz#5fc75284e9c2375c36c839411a0cf550cbfc4d5e" integrity sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg== -d3-drag@2: - version "2.0.0" - resolved "https://registry.npmjs.org/d3-drag/-/d3-drag-2.0.0.tgz#9eaf046ce9ed1c25c88661911c1d5a4d8eb7ea6d" - integrity sha512-g9y9WbMnF5uqB9qKqwIIa/921RYWzlUDv9Jl1/yONQwxbOfszAWTCm8u7HOTgJgRDXiRZN56cHT9pd24dmXs8w== - dependencies: - d3-dispatch "1 - 2" - d3-selection "2" - "d3-drag@2 - 3": version "3.0.0" resolved "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz#994aae9cd23c719f53b5e10e3a0a6108c69607ba" @@ -12903,11 +12488,6 @@ d3-drag@2: d3-dispatch "1 - 3" d3-selection "3" -"d3-ease@1 - 2": - version "2.0.0" - resolved "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz#fd1762bfca00dae4bacea504b1d628ff290ac563" - integrity sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ== - "d3-ease@1 - 3": version "3.0.1" resolved "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz#9658ac38a2140d59d346160f1f6c30fda0bd12f4" @@ -12934,13 +12514,6 @@ d3-interpolate@1, d3-interpolate@^1.3.0: dependencies: d3-color "1" -"d3-interpolate@1 - 2": - version "2.0.1" - resolved "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz#98be499cfb8a3b94d4ff616900501a64abc91163" - integrity sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ== - dependencies: - d3-color "1 - 2" - "d3-interpolate@1 - 3": version "3.0.1" resolved "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz#3c47aa5b32c5b3dfb56ef3fd4342078a632b400d" @@ -12953,11 +12526,6 @@ d3-path@1: resolved "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz#48c050bb1fe8c262493a8caf5524e3e9591701cf" integrity sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg== -"d3-path@1 - 2": - version "2.0.0" - resolved "https://registry.npmjs.org/d3-path/-/d3-path-2.0.0.tgz#55d86ac131a0548adae241eebfb56b4582dd09d8" - integrity sha512-ZwZQxKhBnv9yHaiWd6ZU4x5BtCQ7pXszEV9CU6kRgwIQVQGLMv1oiL4M+MK/n79sYzsj+gcgpPQSctJUsLN7fA== - "d3-path@1 - 3": version "3.0.1" resolved "https://registry.npmjs.org/d3-path/-/d3-path-3.0.1.tgz#f09dec0aaffd770b7995f1a399152bf93052321e" @@ -12980,11 +12548,6 @@ d3-scale@^2.1.0: d3-time "1" d3-time-format "2" -d3-selection@2, d3-selection@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz#94a11638ea2141b7565f883780dabc7ef6a61066" - integrity sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA== - "d3-selection@2 - 3", d3-selection@3, d3-selection@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz#c25338207efa72cc5b9bd1458a1a41901f1e1b31" @@ -12997,13 +12560,6 @@ d3-shape@^1.2.0: dependencies: d3-path "1" -d3-shape@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/d3-shape/-/d3-shape-2.0.0.tgz#2331b62fa784a2a1daac47a7233cfd69301381fd" - integrity sha512-djpGlA779ua+rImicYyyjnOjeubyhql1Jyn1HK0bTyawuH76UQRWXd+pftr67H6Fa8hSwetkgb/0id3agKWykw== - dependencies: - d3-path "1 - 2" - d3-shape@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/d3-shape/-/d3-shape-3.0.1.tgz#9ccdfb28fd9b0d12f2d8aec234cd5c4a9ea27931" @@ -13033,17 +12589,6 @@ d3-time@1: resolved "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz#6284d2a2708285b1abb7e201eda4380af35e63b0" integrity sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA== -d3-transition@2: - version "2.0.0" - resolved "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz#366ef70c22ef88d1e34105f507516991a291c94c" - integrity sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog== - dependencies: - d3-color "1 - 2" - d3-dispatch "1 - 2" - d3-ease "1 - 2" - d3-interpolate "1 - 2" - d3-timer "1 - 2" - "d3-transition@2 - 3": version "3.0.1" resolved "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz#6869fdde1448868077fdd5989200cb61b2a1645f" @@ -13055,17 +12600,6 @@ d3-transition@2: d3-interpolate "1 - 3" d3-timer "1 - 3" -d3-zoom@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/d3-zoom/-/d3-zoom-2.0.0.tgz#f04d0afd05518becce879d04709c47ecd93fba54" - integrity sha512-fFg7aoaEm9/jf+qfstak0IYpnesZLiMX6GZvXtUSdv8RH2o4E2qeelgdU09eKS6wGuiGMfcnMI0nTIqWzRHGpw== - dependencies: - d3-dispatch "1 - 2" - d3-drag "2" - d3-interpolate "1 - 2" - d3-selection "2" - d3-transition "2" - d3-zoom@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz#d13f4165c73217ffeaa54295cd6969b3e7aee8f3" @@ -13669,13 +13203,6 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -domhandler@^3.0, domhandler@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/domhandler/-/domhandler-3.0.0.tgz#51cd13efca31da95bbb0c5bee3a48300e333b3e9" - integrity sha512-eKLdI5v9m67kbXQbJSNn1zjh0SDzvzWVWtX+qEI3eMjZw8daH9k8rlj1FZY9memPwjiskQFbe7vHVVJIAqoEhw== - dependencies: - domelementtype "^2.0.1" - domhandler@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/domhandler/-/domhandler-4.0.0.tgz#01ea7821de996d85f69029e81fa873c21833098e" @@ -13703,15 +13230,6 @@ domutils@^1.7.0: dom-serializer "0" domelementtype "1" -domutils@^2.0.0: - version "2.4.4" - resolved "https://registry.npmjs.org/domutils/-/domutils-2.4.4.tgz#282739c4b150d022d34699797369aad8d19bbbd3" - integrity sha512-jBC0vOsECI4OMdD0GC9mGn7NXPLb+Qt6KW1YDQzeQYRUFKmNG8lh7mO5HiELfr+lLQE7loDVI4QcAxV80HS+RA== - dependencies: - dom-serializer "^1.0.1" - domelementtype "^2.0.1" - domhandler "^4.0.0" - domutils@^2.5.2, domutils@^2.6.0: version "2.8.0" resolved "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" @@ -14181,113 +13699,119 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -esbuild-android-arm64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.1.tgz#470b99c1c4b49f33fd0a20ed153b15008173fd63" - integrity sha512-elQd3hTg93nU2GQ5PPCDAFe5+utxZX96RG8RixqIPxf8pzmyIzcpKG76L/9FabPf3LT1z+nLF1sajCU8eVRDyg== +esbuild-android-arm64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.10.tgz#c854db57dc2d4df6f4f62185ca812f26a132bf1e" + integrity sha512-vzkTafHKoiMX4uIN1kBnE/HXYLpNT95EgGanVk6DHGeYgDolU0NBxjO7yZpq4ZGFPOx8384eAdDrBYhO11TAlQ== -esbuild-darwin-64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.1.tgz#135f48f299f2ce3eb3ca1b1f3ec03d81108ab79e" - integrity sha512-PR3HZgbPRwsQbbOR1fJrfkt/Cs0JDyI3yzOKg2PPWk0H1AseZDBqPUY9b/0+BIjFwA5Jz/aAiq832hppsuJtNw== +esbuild-darwin-64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.10.tgz#c44fab6b8bfc83e5d083f513e4acbff14fb82eac" + integrity sha512-DJwzFVB95ZV7C3PQbf052WqaUuuMFXJeZJ0LKdnP1w+QOU0rlbKfX0tzuhoS//rOXUj1TFIwRuRsd0FX6skR7A== -esbuild-darwin-arm64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.1.tgz#7117a857bac99ece28ebba859a47dce47f565f9f" - integrity sha512-/fiSSOkOEa3co6yYtwgXouz8jZrG0qnXPEKiktFf2BQE8NON3ARTw43ZegaH+xMRFNgYBJEOOZIdzI3sIFEAxw== +esbuild-darwin-arm64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.10.tgz#9454b3763b36407dc395c4c3529fb5ddd4a6225f" + integrity sha512-RNaaoZDg3nsqs5z56vYCjk/VJ76npf752W0rOaCl5lO5TsgV9zecfdYgt7dtUrIx8b7APhVaNYud+tGsDOVC9g== -esbuild-freebsd-64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.1.tgz#2b7ca5ec572f2800b1ec88988affc4482c5ac4b7" - integrity sha512-ZJV+nfa8E8PdXnRc05PO3YMfgSj7Ko+kdHyGDE6OaNo1cO8ZyfacqLaWkY35shDDaeacklhD8ZR4qq5nbJKX1A== +esbuild-freebsd-64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.10.tgz#04eef46d5d5e4152c6b5a6a12f432db0fe7c89de" + integrity sha512-10B3AzW894u6bGZZhWiJOHw1uEHb4AFbUuBdyml1Ht0vIqd+KqWW+iY/yMwQAzILr2WJZqEhbOXRkJtY8aRqOw== -esbuild-freebsd-arm64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.1.tgz#63e8b77643ea8270d878cfab7dd9201a114f20fb" - integrity sha512-6N9zTD+SecJr2g9Ohl9C10WIk5FpQ+52bNamRy0sJoHwP31G5ObzKzq8jAtg1Jeggpu6P8auz3P/UL+3YioSwQ== +esbuild-freebsd-arm64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.10.tgz#67ca88529543ada948737c95819253ead16494a7" + integrity sha512-mSQrKB7UaWvuryBTCo9leOfY2uEUSimAvcKIaUWbk5Hth9Sg+Try+qNA/NibPgs/vHkX0KFo/Rce6RPea+P15g== -esbuild-linux-32@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.1.tgz#f00ae7f12d2abc0dc37e2a7e7c7c29764da87093" - integrity sha512-RtPgE6e7WefbAxRjVryisKFJ0nUwR2DMjwmYW/a1a0F1+Ge6FR+RqvgiY0DrM9TtxSUU0eryDXNF4n3UfxX3mg== +esbuild-linux-32@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.10.tgz#8f3d5fb0b9b616d6b604da781d71767d7679f64f" + integrity sha512-lktF09JgJLZ63ANYHIPdYe339PDuVn19Q/FcGKkXWf+jSPkn5xkYzAabboNGZNUgNqSJ/vY7VrOn6UrBbJjgYA== -esbuild-linux-64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.1.tgz#2ee9dd76be1185abb1e967052e3b6ab16a1d3da4" - integrity sha512-JpxM0ar6Z+2v3vfFrxP7bFb8Wzb6gcGL9MxRqAJplDfGnee8HbfPge6svaazXeX9XJceeEqwxwWGB0qyCcxo7A== +esbuild-linux-64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.10.tgz#c1c60a079c4709164bdd89fbb007a2edeea7c34a" + integrity sha512-K+gCQz2oLIIBI8ZM77e9sYD5/DwEpeYCrOQ2SYXx+R4OU2CT9QjJDi4/OpE7ko4AcYMlMW7qrOCuLSgAlEj4Wg== -esbuild-linux-arm64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.1.tgz#601e855b78e0636e120771296b43eb4f7d68a314" - integrity sha512-cFbeZf171bIf+PPLlQDBzagK85lCCxxVdMV1IVUA96Y3kvEgqcy2n9mha+QE1M/T+lIOPDsmLRgH1XqMFwLTSg== +esbuild-linux-arm64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.10.tgz#d8f1f89190f6d8b6e06a1214aafba454e5daa990" + integrity sha512-+qocQuQvcp5wo/V+OLXxqHPc+gxHttJEvbU/xrCGE03vIMqraL4wMua8JQx0SWEnJCWP+Nhf//v8OSwz1Xr5kA== -esbuild-linux-arm@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.1.tgz#c0d364a20f12a653bdd2f41436788b99502dc287" - integrity sha512-eBRHexCijAYWzcvQLGHxyxIlYOkYhXvcb/O7HvzJfCAVWCnTx9TxxYJ3UppBC6dDFbAq4HwKhskvmesQdKMeBg== +esbuild-linux-arm@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.10.tgz#43192a00019a4553fb44e67f628fff0f560f16c2" + integrity sha512-BYa60dZ/KPmNKYxtHa3LSEdfKWHcm/RzP0MjB4AeBPhjS0D6/okhaBesZIY9kVIGDyeenKsJNOmnVt4+dhNnvQ== -esbuild-linux-mips64le@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.1.tgz#a5f6e9c6e7950a3fad08bb3653bc3f5d71b4e249" - integrity sha512-UGb+sqHkL7wOQFLH0RoFhcRAlJNqbqs6GtJd1It5jJ2juOGqAkCv8V12aGDX9oRB6a+Om7cdHcH+6AMZ+qlaww== +esbuild-linux-mips64le@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.10.tgz#f57bb8b2f1a3063cc91cfd787c8a9130cf863c16" + integrity sha512-nmUd2xoBXpGo4NJCEWoaBj+n4EtDoLEvEYc8Z3aSJrY0Oa6s04czD1flmhd0I/d6QEU8b7GQ9U0g/rtBfhtxBg== -esbuild-linux-ppc64le@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.1.tgz#762cec24cf5afeee3f805a4679a3f5e29702173a" - integrity sha512-LIHGkGdy9wYlmkkoVHm6feWhkoi4VBXDiEVyNjXEhlzsBcP/CaRy+B8IJulzaU1ALLiGcsCQ2MC5UbFn/iTvmA== +esbuild-linux-ppc64le@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.10.tgz#becd965bfe3425d41e026f1c4678b393127fecbd" + integrity sha512-vsOWZjm0rZix7HSmqwPph9arRVCyPtUpcURdayQDuIhMG2/UxJxpbdRaa//w4zYqcJzAWwuyH2PAlyy0ZNuxqQ== -esbuild-netbsd-64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.1.tgz#66ec7ac0b3eeb84f8c1ac27eecf16f59d93706a8" - integrity sha512-TWc1QIgtPwaK5nC1GT2ASTuy/CJhNKHN4h5PJRP1186VfI+k2uvXakS7bqO/M26F6jAMy8jDeCtilacqpwsvfA== +esbuild-linux-s390x@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.10.tgz#cc4228ac842febc48b84757814bed964a619be62" + integrity sha512-knArKKZm0ypIYWOWyOT7+accVwbVV1LZnl2FWWy05u9Tyv5oqJ2F5+X2Vqe/gqd61enJXQWqoufXopvG3zULOg== -esbuild-openbsd-64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.1.tgz#7515049bc7032ca2fb6811dc260f5ec9e1d9fe65" - integrity sha512-Z9/Zb77K+pK9s7mAsvwS56K8tCbLvNZ9UI4QVJSYqDgOmmDJOBT4owWnCqZ5cJI+2y4/F9KwCpFFTNUdPglPKA== +esbuild-netbsd-64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.10.tgz#6ec50d9e4547a7579f447307b19f66bbedfd868b" + integrity sha512-6Gg8neVcLeyq0yt9bZpReb8ntZ8LBEjthxrcYWVrBElcltnDjIy1hrzsujt0+sC2rL+TlSsE9dzgyuvlDdPp2w== -esbuild-sunos-64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.1.tgz#795f6bc7ce8c5177afb65f8d6c161a02f0c3e125" - integrity sha512-c4sF8146kNW8529wfkB6vO0ZqPgokyS2hORqKa4p/QKZdp+xrF2NPmvX5aN+Zt14oe6wVZuhYo6LGv7V4Gg04g== +esbuild-openbsd-64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.10.tgz#925ac3d2326cc219d514e1ca806e80e5143aa043" + integrity sha512-9rkHZzp10zI90CfKbFrwmQjqZaeDmyQ6s9/hvCwRkbOCHuto6RvMYH9ghQpcr5cUxD5OQIA+sHXi0zokRNXjcg== -esbuild-windows-32@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.1.tgz#ffffa6378733eeaa23ed5cfe539e2fbe1e635ef6" - integrity sha512-XP8yElaJtLGGjH7D72t5IWtP0jmc1Jqm4IjQARB17l0LTJO/n+N2X64rDWePJv6qimYxa5p2vTjkZc5v+YZTSQ== +esbuild-sunos-64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.10.tgz#8d3576d8cac5c4f9f2a84be81b9078d424dbc739" + integrity sha512-mEU+pqkhkhbwpJj5DiN3vL0GUFR/yrL3qj8ER1amIVyRibKbj02VM1QaIuk1sy5DRVIKiFXXgCaHvH3RNWCHIw== -esbuild-windows-64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.1.tgz#46f3b4a90f937a8ad6456cd70478ebfc6771814f" - integrity sha512-fe+ShdyfiuGcCEdVKW//6MaM4MwikiWBWSBn8mebNAbjRqicH0injDOFVI7aUovAfrEt7+FGkf402s//hi0BVg== +esbuild-windows-32@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.10.tgz#8a67fca4cb594a340566d66eef3f568f65057a48" + integrity sha512-Z5DieUL1N6s78dOSdL95KWf8Y89RtPGxIoMF+LEy8ChDsX+pZpz6uAVCn+YaWpqQXO+2TnrcbgBIoprq2Mco1g== -esbuild-windows-arm64@0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.1.tgz#c7067389d28139e6a18db1996178c3a3e07a22b3" - integrity sha512-wBVakhcIzQ3NZ33DFM6TjIObXPHaXOsqzvPwefXHvwBSC/N/e/g6fBeM7N/Moj3AmxLjKaB+vePvTGdxk6RPCg== +esbuild-windows-64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.10.tgz#5e6d7c475ff6a71ad0aa4046894364e6c40a9249" + integrity sha512-LE5Mm62y0Bilu7RDryBhHIX8rK3at5VwJ6IGM3BsASidCfOBTzqcs7Yy0/Vkq39VKeTmy9/66BAfVoZRNznoDw== + +esbuild-windows-arm64@0.14.10: + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.10.tgz#50ab9a83f6ccf71c272e58489ecc4d7375075f32" + integrity sha512-OJOyxDtabvcUYTc+O4dR0JMzLBz6G9+gXIHA7Oc5d5Fv1xiYa0nUeo8+W5s2e6ZkPRdIwOseYoL70rZz80S5BA== esbuild@^0.14.1: - version "0.14.1" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.14.1.tgz#b834da3aa5858073205a6d4f948ffde0d650e4e3" - integrity sha512-J/LhUwELcmz0+CJfiaKzu7Rnj9ffWFLvMx+dKvdOfg+fQmoP6q9glla26LCm9BxpnPUjXChHeubLiMlKab/PYg== + version "0.14.10" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.14.10.tgz#10268d2b576b25ed6f8554553413988628a7767b" + integrity sha512-ibZb+NwFqBwHHJlpnFMtg4aNmVK+LUtYMFC9CuKs6lDCBEvCHpqCFZFEirpqt1jOugwKGx8gALNGvX56lQyfew== optionalDependencies: - esbuild-android-arm64 "0.14.1" - esbuild-darwin-64 "0.14.1" - esbuild-darwin-arm64 "0.14.1" - esbuild-freebsd-64 "0.14.1" - esbuild-freebsd-arm64 "0.14.1" - esbuild-linux-32 "0.14.1" - esbuild-linux-64 "0.14.1" - esbuild-linux-arm "0.14.1" - esbuild-linux-arm64 "0.14.1" - esbuild-linux-mips64le "0.14.1" - esbuild-linux-ppc64le "0.14.1" - esbuild-netbsd-64 "0.14.1" - esbuild-openbsd-64 "0.14.1" - esbuild-sunos-64 "0.14.1" - esbuild-windows-32 "0.14.1" - esbuild-windows-64 "0.14.1" - esbuild-windows-arm64 "0.14.1" + esbuild-android-arm64 "0.14.10" + esbuild-darwin-64 "0.14.10" + esbuild-darwin-arm64 "0.14.10" + esbuild-freebsd-64 "0.14.10" + esbuild-freebsd-arm64 "0.14.10" + esbuild-linux-32 "0.14.10" + esbuild-linux-64 "0.14.10" + esbuild-linux-arm "0.14.10" + esbuild-linux-arm64 "0.14.10" + esbuild-linux-mips64le "0.14.10" + esbuild-linux-ppc64le "0.14.10" + esbuild-linux-s390x "0.14.10" + esbuild-netbsd-64 "0.14.10" + esbuild-openbsd-64 "0.14.10" + esbuild-sunos-64 "0.14.10" + esbuild-windows-32 "0.14.10" + esbuild-windows-64 "0.14.10" + esbuild-windows-arm64 "0.14.10" escalade@^3.0.2, escalade@^3.1.1: version "3.1.1" @@ -15952,14 +15476,7 @@ git-up@^4.0.0: is-ssh "^1.3.0" parse-url "^5.0.0" -git-url-parse@^11.4.4: - version "11.4.4" - resolved "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.4.4.tgz#5d747debc2469c17bc385719f7d0427802d83d77" - integrity sha512-Y4o9o7vQngQDIU9IjyCmRJBin5iYjI5u9ZITnddRZpD7dcCFQj2sL2XuMNbLRE4b4B/4ENPsp2Q8P44fjAZ0Pw== - dependencies: - git-up "^4.0.0" - -git-url-parse@^11.6.0: +git-url-parse@^11.4.4, git-url-parse@^11.6.0: version "11.6.0" resolved "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.6.0.tgz#c634b8de7faa66498a2b88932df31702c67df605" integrity sha512-WWUxvJs5HsyHL6L08wOusa/IXYtMuCAhrMmnTjQPpBU0TTHyDhnOATNH3xNQz7YOQUsqIIPTGr4xiVti1Hsk5g== @@ -16136,19 +15653,7 @@ globby@11.0.3: merge2 "^1.3.0" slash "^3.0.0" -globby@^11.0.0, globby@^11.0.1, globby@^11.0.2: - version "11.0.2" - resolved "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" - integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - -globby@^11.0.3: +globby@^11.0.0, globby@^11.0.1, globby@^11.0.2, globby@^11.0.3: version "11.0.4" resolved "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== @@ -16186,10 +15691,10 @@ globby@^9.2.0: pify "^4.0.1" slash "^2.0.0" -google-auth-library@^7.0.0, google-auth-library@^7.0.2: - version "7.0.2" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.0.2.tgz#cab6fc7f94ebecc97be6133d6519d9946ccf3e9d" - integrity sha512-vjyNZR3pDLC0u7GHLfj+Hw9tGprrJwoMwkYGqURCXYITjCrP9HprOyxVV+KekdLgATtWGuDkQG2MTh0qpUPUgg== +google-auth-library@^7.0.0, google-auth-library@^7.0.2, google-auth-library@^7.6.1: + version "7.11.0" + resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.11.0.tgz#b63699c65037310a424128a854ba7e736704cbdb" + integrity sha512-3S5jn2quRumvh9F/Ubf7GFrIq71HZ5a6vqosgdIu105kkk0WtSqc2jGCRqtWWOLRS8SX3AHACMOEDxhyWAQIcg== dependencies: arrify "^2.0.0" base64-js "^1.3.0" @@ -16201,45 +15706,12 @@ google-auth-library@^7.0.0, google-auth-library@^7.0.2: jws "^4.0.0" lru-cache "^6.0.0" -google-auth-library@^7.6.1: - version "7.10.0" - resolved "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.10.0.tgz#6ab852f8e1abbe425aec695ac6501f80bd5eba56" - integrity sha512-ICsqaU+lxMHVlDUzMrfVIEqnARw2AwBiZ/2KnNM6BcTf9Nott+Af87DTIzmlnW865p3REUP2MVL0xkPC3a61aQ== +google-gax@^2.12.0, google-gax@^2.24.1: + version "2.28.1" + resolved "https://registry.npmjs.org/google-gax/-/google-gax-2.28.1.tgz#99bc234b5769d901d70959d40bd1651729eb4a34" + integrity sha512-2Xjd3FrjlVd6Cmw2B2Aicpc/q92SwTpIOvxPUlnRg9w+Do8nu7UR+eQrgoKlo2FIUcUuDTvppvcx8toND0pK9g== dependencies: - arrify "^2.0.0" - base64-js "^1.3.0" - ecdsa-sig-formatter "^1.0.11" - fast-text-encoding "^1.0.0" - gaxios "^4.0.0" - gcp-metadata "^4.2.0" - gtoken "^5.0.4" - jws "^4.0.0" - lru-cache "^6.0.0" - -google-gax@^2.12.0: - version "2.14.1" - resolved "https://registry.npmjs.org/google-gax/-/google-gax-2.14.1.tgz#74885c5d9f01db412917fc49bbf20c4884828d36" - integrity sha512-I5RDEN7MEptrCxeHX3ht7nKFGfyjgYX4hQKI9eVMBohMzVbFSwWUndo0CcKXu8es7NhB4gt2XYLm1AHkXhtHpA== - dependencies: - "@grpc/grpc-js" "~1.3.0" - "@grpc/proto-loader" "^0.6.1" - "@types/long" "^4.0.0" - abort-controller "^3.0.0" - duplexify "^4.0.0" - fast-text-encoding "^1.0.3" - google-auth-library "^7.0.2" - is-stream-ended "^0.1.4" - node-fetch "^2.6.1" - object-hash "^2.1.1" - protobufjs "^6.10.2" - retry-request "^4.0.0" - -google-gax@^2.24.1: - version "2.27.0" - resolved "https://registry.npmjs.org/google-gax/-/google-gax-2.27.0.tgz#78ba655ae7707cb92ba37c35932381b5970c1772" - integrity sha512-xcLCeNKCqNm/w0At7/vdZHV/zol/iRS+PSAZTu7i6xNGBra/kWI3cfn4M6ZLQXeUEGbTVLJ4zGm53TVc4lvbDA== - dependencies: - "@grpc/grpc-js" "~1.3.0" + "@grpc/grpc-js" "~1.4.0" "@grpc/proto-loader" "^0.6.1" "@types/long" "^4.0.0" abort-controller "^3.0.0" @@ -16249,7 +15721,7 @@ google-gax@^2.24.1: is-stream-ended "^0.1.4" node-fetch "^2.6.1" object-hash "^2.1.1" - proto3-json-serializer "^0.1.1" + proto3-json-serializer "^0.1.5" protobufjs "6.11.2" retry-request "^4.0.0" @@ -16483,15 +15955,10 @@ graphql-ws@^5.4.1: resolved "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.5.5.tgz#f375486d3f196e2a2527b503644693ae3a8670a9" integrity sha512-hvyIS71vs4Tu/yUYHPvGXsTgo0t3arU820+lT5VjZS2go0ewp2LqyCgxEN56CzOG7Iys52eRhHBiD1gGRdiQtw== -graphql@^15.3.0: - version "15.5.1" - resolved "https://registry.npmjs.org/graphql/-/graphql-15.5.1.tgz#f2f84415d8985e7b84731e7f3536f8bb9d383aad" - integrity sha512-FeTRX67T3LoE3LWAxxOlW2K3Bz+rMYAC18rRguK4wgXaTZMiJwSUwDmPFo3UadAKbzirKIg5Qy+sNJXbpPRnQw== - -graphql@^15.5.1: - version "15.6.1" - resolved "https://registry.npmjs.org/graphql/-/graphql-15.6.1.tgz#9125bdf057553525da251e19e96dab3d3855ddfc" - integrity sha512-3i5lu0z6dRvJ48QP9kFxBkJ7h4Kso7PS8eahyTFz5Jm6CvQfLtNIE8LX9N6JLnXTuwR+sIYnXzaWp6anOg0QQw== +graphql@^15.3.0, graphql@^15.5.1: + version "15.8.0" + resolved "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38" + integrity sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw== graphql@^16.0.0: version "16.0.1" @@ -16794,14 +16261,7 @@ history@5.0.0: dependencies: "@babel/runtime" "^7.7.6" -history@^5.0.0: - version "5.1.0" - resolved "https://registry.npmjs.org/history/-/history-5.1.0.tgz#2e93c09c064194d38d52ed62afd0afc9d9b01ece" - integrity sha512-zPuQgPacm2vH2xdORvGGz1wQMuHSIB56yNAy5FnLuwOwgSYyPKptJtcMm6Ev+hRGeS+GzhbmRacHzvlESbFwDg== - dependencies: - "@babel/runtime" "^7.7.6" - -history@^5.2.0: +history@^5.0.0, history@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/history/-/history-5.2.0.tgz#7cdd31cf9bac3c5d31f09c231c9928fad0007b7c" integrity sha512-uPSF6lAJb3nSePJ43hN3eKj1dTWpN9gMod0ZssbFTIsen+WehTmEadgL+kg78xLJFdRfrrC//SavDzmRVdE+Ig== @@ -16898,16 +16358,6 @@ html-minifier-terser@^5.0.1: relateurl "^0.2.7" terser "^4.6.3" -html-to-react@^1.3.4: - version "1.4.2" - resolved "https://registry.npmjs.org/html-to-react/-/html-to-react-1.4.2.tgz#7b628ab56cd63a52f2d0b79d0fa838a51f088a57" - integrity sha512-TdTfxd95sRCo6QL8admCkE7mvNNrXtGoVr1dyS+7uvc8XCqAymnf/6ckclvnVbQNUo2Nh21VPwtfEHd0khiV7g== - dependencies: - domhandler "^3.0" - htmlparser2 "^4.0" - lodash.camelcase "^4.3.0" - ramda "^0.26" - html-void-elements@^1.0.0: version "1.0.5" resolved "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" @@ -16939,16 +16389,6 @@ html-webpack-plugin@^5.3.1: pretty-error "^2.1.1" tapable "^2.0.0" -htmlparser2@^4.0: - version "4.1.0" - resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz#9a4ef161f2e4625ebf7dfbe6c0a2f52d18a59e78" - integrity sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q== - dependencies: - domelementtype "^2.0.1" - domhandler "^3.0.0" - domutils "^2.0.0" - entities "^2.0.0" - htmlparser2@^6.1.0: version "6.1.0" resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" @@ -20138,11 +19578,6 @@ long@^4.0.0: resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== -longest-streak@^2.0.0: - version "2.0.4" - resolved "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" - integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== - longest-streak@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/longest-streak/-/longest-streak-3.0.0.tgz#f127e2bded83caa6a35ac5f7a2f2b2f94b36f3dc" @@ -20381,13 +19816,6 @@ markdown-it@^12.2.0: mdurl "^1.0.1" uc.micro "^1.0.5" -markdown-table@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b" - integrity sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A== - dependencies: - repeat-string "^1.0.0" - markdown-table@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.1.tgz#88c48957aaf2a8014ccb2ba026776a1d736fe3dc" @@ -20433,13 +19861,6 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -mdast-add-list-metadata@1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/mdast-add-list-metadata/-/mdast-add-list-metadata-1.0.1.tgz#95e73640ce2fc1fa2dcb7ec443d09e2bfe7db4cf" - integrity sha512-fB/VP4MJ0LaRsog7hGPxgOrSL3gE/2uEdZyDuSEnKCv/8IkYHiDkIQSbChiJoHyxZZXZ9bzckyRk+vNxFzh8rA== - dependencies: - unist-util-visit-parents "1.1.2" - mdast-squeeze-paragraphs@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" @@ -20472,16 +19893,6 @@ mdast-util-find-and-replace@^2.0.0: unist-util-is "^5.0.0" unist-util-visit-parents "^4.0.0" -mdast-util-from-markdown@^0.8.0: - version "0.8.1" - resolved "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.1.tgz#781371d493cac11212947226190270c15dc97116" - integrity sha512-qJXNcFcuCSPqUF0Tb0uYcFDIq67qwB3sxo9RPdf9vG8T90ViKnksFqdB/Coq2a7sTnxL/Ify2y7aIQXDkQFH0w== - dependencies: - "@types/mdast" "^3.0.0" - mdast-util-to-string "^1.0.0" - micromark "~2.10.0" - parse-entities "^2.0.0" - mdast-util-from-markdown@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.0.2.tgz#7c793bb96b053d12f032e37382ae989efb70ee66" @@ -20499,11 +19910,6 @@ mdast-util-from-markdown@^1.0.0: parse-entities "^3.0.0" unist-util-stringify-position "^3.0.0" -mdast-util-gfm-autolink-literal@^0.1.0: - version "0.1.1" - resolved "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.1.tgz#94675074d725ed7254b3172fa7e7c3252960de39" - integrity sha512-gJ2xSpqKCetSr22GEWpZH3f5ffb4pPn/72m4piY0v7T/S+O7n7rw+sfoPLhb2b4O7WdnERoYdALRcmD68FMtlw== - mdast-util-gfm-autolink-literal@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.2.tgz#4032dcbaddaef7d4f2f3768ed830475bb22d3970" @@ -20514,13 +19920,6 @@ mdast-util-gfm-autolink-literal@^1.0.0: mdast-util-find-and-replace "^2.0.0" micromark-util-character "^1.0.0" -mdast-util-gfm-strikethrough@^0.2.0: - version "0.2.2" - resolved "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.2.tgz#6e9ddd33ce41b06a60463e817f6ef4cf7bfa0655" - integrity sha512-T37ZbaokJcRbHROXmoVAieWnesPD5N21tv2ifYzaGRLbkh1gknItUGhZzHefUn5Zc/eaO/iTDSAFOBrn/E8kWw== - dependencies: - mdast-util-to-markdown "^0.5.0" - mdast-util-gfm-strikethrough@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.0.tgz#6cc72ef5d9539f4cee76af3f15dd0daa9e3af40f" @@ -20529,14 +19928,6 @@ mdast-util-gfm-strikethrough@^1.0.0: "@types/mdast" "^3.0.3" mdast-util-to-markdown "^1.0.0" -mdast-util-gfm-table@^0.1.0: - version "0.1.4" - resolved "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.4.tgz#5b3d71d16294c6fae1c2c424d3a081ffc7407b83" - integrity sha512-T4xFSON9kUb/IpYA5N+KGWcsdGczAvILvKiXQwUGind6V9fvjPCR9yhZnIeaLdBWXaz3m/Gq77ZtuLMjtFR4IQ== - dependencies: - markdown-table "^2.0.0" - mdast-util-to-markdown "^0.5.0" - mdast-util-gfm-table@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.1.tgz#07c269a219d66ec2deb6de38aed0ba1d1f9442df" @@ -20545,13 +19936,6 @@ mdast-util-gfm-table@^1.0.0: markdown-table "^3.0.0" mdast-util-to-markdown "^1.0.0" -mdast-util-gfm-task-list-item@^0.1.0: - version "0.1.4" - resolved "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.4.tgz#5899b1320d1b826f7658ac3171babf4ae1e626a2" - integrity sha512-AMiHyBHvaYN2p3ztFv7gDgTF7keZDaA9plTixRXWT0aqL0QdN43QaG5+hzcRNbjCsEWBxWhpcNk1Diq0TiIEvw== - dependencies: - mdast-util-to-markdown "^0.5.0" - mdast-util-gfm-task-list-item@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.0.tgz#a0aa2a00c893f9f006d13ba096cbc64608559c7f" @@ -20560,16 +19944,6 @@ mdast-util-gfm-task-list-item@^1.0.0: "@types/mdast" "^3.0.3" mdast-util-to-markdown "^1.0.0" -mdast-util-gfm@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-0.1.0.tgz#bac0efe703670d1b40474e6be13dbdd887273a04" - integrity sha512-HLfygQL6HdhJhFbLta4Ki9hClrzyAxRjyRvpm5caN65QZL+NyHPmqFlnF9vm1Rn58JT2+AbLwNcEDY4MEvkk8Q== - dependencies: - mdast-util-gfm-autolink-literal "^0.1.0" - mdast-util-gfm-strikethrough "^0.2.0" - mdast-util-gfm-table "^0.1.0" - mdast-util-gfm-task-list-item "^0.1.0" - mdast-util-gfm@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-1.0.0.tgz#5cbedeabae72be2c3dff1ec958394e2f9553ec43" @@ -20609,18 +19983,6 @@ mdast-util-to-hast@^11.0.0: unist-util-position "^4.0.0" unist-util-visit "^4.0.0" -mdast-util-to-markdown@^0.5.0: - version "0.5.3" - resolved "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.5.3.tgz#e05c54a3ccd239bab63c48a1e5b5747f0dcd5aca" - integrity sha512-sr8q7fQJ1xoCqZSXW6dO/MYu2Md+a4Hfk9uO+XHCfiBhVM0EgWtfAV7BuN+ff6otUeu2xDyt1o7vhZGwOG3+BA== - dependencies: - "@types/unist" "^2.0.0" - longest-streak "^2.0.0" - mdast-util-to-string "^1.0.0" - parse-entities "^2.0.0" - repeat-string "^1.0.0" - zwitch "^1.0.0" - mdast-util-to-markdown@^1.0.0: version "1.2.3" resolved "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.2.3.tgz#2b3af92bf0e29080927eb59a8a10cd0a7398e093" @@ -20634,11 +19996,6 @@ mdast-util-to-markdown@^1.0.0: unist-util-visit "^4.0.0" zwitch "^2.0.0" -mdast-util-to-string@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz#27055500103f51637bd07d01da01eb1967a43527" - integrity sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A== - mdast-util-to-string@^3.0.0, mdast-util-to-string@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz#56c506d065fbf769515235e577b5a261552d56e9" @@ -20874,13 +20231,6 @@ micromark-extension-gfm-autolink-literal@^1.0.0: micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" -micromark-extension-gfm-autolink-literal@~0.5.0: - version "0.5.1" - resolved "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.1.tgz#5326fc86f3ae0fbba57bb0bfc2f158c9456528ce" - integrity sha512-j30923tDp0faCNDjwqe4cMi+slegbGfc3VEAExEU8d54Q/F6pR6YxCVH+6xV0ItRoj3lCn1XkUWcy6FC3S9BOw== - dependencies: - micromark "~2.10.0" - micromark-extension-gfm-strikethrough@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.1.tgz#9f53ab4f5dc8c0525a889850bae615f074a98a27" @@ -20892,13 +20242,6 @@ micromark-extension-gfm-strikethrough@^1.0.0: micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" -micromark-extension-gfm-strikethrough@~0.6.0: - version "0.6.2" - resolved "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.2.tgz#754788bdd13046e7f69edaa0d3f3d555d23128d6" - integrity sha512-aehEEqtTn3JekJNwZZxa7ZJVfzmuaWp4ew6x6sl3VAKIwdDZdqYeYSQIrNKwNgH7hX0g56fAwnSDLusJggjlCQ== - dependencies: - micromark "~2.10.0" - micromark-extension-gfm-table@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.0.tgz#f0d35dbf008b6182311049f9137323d34a54c7a0" @@ -20909,13 +20252,6 @@ micromark-extension-gfm-table@^1.0.0: micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" -micromark-extension-gfm-table@~0.4.0: - version "0.4.1" - resolved "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.1.tgz#79cc37da82d6ae0cc3901c1c6264b97a72372fbd" - integrity sha512-xVpqOnfFaa2OtC/Y7rlt4tdVFlUHdoLH3RXAZgb/KP3DDyKsAOx6BRS3UxiiyvmD/p2l6VUpD4bMIniuP4o4JA== - dependencies: - micromark "~2.10.0" - micromark-extension-gfm-tagfilter@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.0.tgz#a38c7c462c2007b534fcb485e9310165879654a7" @@ -20923,11 +20259,6 @@ micromark-extension-gfm-tagfilter@^1.0.0: dependencies: micromark-util-types "^1.0.0" -micromark-extension-gfm-tagfilter@~0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-0.3.0.tgz#d9f26a65adee984c9ccdd7e182220493562841ad" - integrity sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q== - micromark-extension-gfm-task-list-item@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.0.tgz#ab38b2b4ead4e746189d6323c32cacab2c63599d" @@ -20938,23 +20269,6 @@ micromark-extension-gfm-task-list-item@^1.0.0: micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" -micromark-extension-gfm-task-list-item@~0.3.0: - version "0.3.1" - resolved "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.1.tgz#24b7f54936a609179595f87a0e5279d1c6cf346c" - integrity sha512-3ZiolwyLEF+t2KvGqKdBNEybiacQCsBgDx4PRZz/dttwo0PkcVKh7jpxc6UdHQuNMJ/YRUNuCSal0WuoAlefAA== - -micromark-extension-gfm@^0.3.0: - version "0.3.1" - resolved "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-0.3.1.tgz#30b8706bd2a3f7fd31aa37873d743946a9e856c3" - integrity sha512-lJlhcOqzoJdjQg+LMumVHdUQ61LjtqGdmZtrAdfvatRUnJTqZlRwXXHdLQgNDYlFw4mycZ4NSTKlya5QcQXl1A== - dependencies: - micromark "~2.10.0" - micromark-extension-gfm-autolink-literal "~0.5.0" - micromark-extension-gfm-strikethrough "~0.6.0" - micromark-extension-gfm-table "~0.4.0" - micromark-extension-gfm-tagfilter "~0.3.0" - micromark-extension-gfm-task-list-item "~0.3.0" - micromark-extension-gfm@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-1.0.0.tgz#7a1cee0df200e3f2ab14cb63d7a5ea6820a82f1d" @@ -21136,14 +20450,6 @@ micromark@^3.0.0: micromark-util-types "^1.0.1" parse-entities "^3.0.0" -micromark@~2.10.0: - version "2.10.1" - resolved "https://registry.npmjs.org/micromark/-/micromark-2.10.1.tgz#cd73f54e0656f10e633073db26b663a221a442a7" - integrity sha512-fUuVF8sC1X7wsCS29SYQ2ZfIZYbTymp0EYr6sab3idFjigFFjGa5UwoniPlV9tAgntjuapW1t9U+S0yDYeGKHQ== - dependencies: - debug "^4.0.0" - parse-entities "^2.0.0" - micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -23831,16 +23137,7 @@ postcss-value-parser@^4.0.0, postcss-value-parser@^4.0.2, postcss-value-parser@^ resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== -"postcss@5 - 7", postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.32" - resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz#4310d6ee347053da3433db2be492883d62cec59d" - integrity sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw== - dependencies: - chalk "^2.4.2" - source-map "^0.6.1" - supports-color "^6.1.0" - -postcss@^7.0.36: +"postcss@5 - 7", postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.36, postcss@^7.0.5, postcss@^7.0.6: version "7.0.36" resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz#056f8cffa939662a8f5905950c07d5285644dfcb" integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw== @@ -24112,6 +23409,13 @@ prop-types@^15.0.0, prop-types@^15.5.10, prop-types@^15.5.7, prop-types@^15.5.8, object-assign "^4.1.1" react-is "^16.13.1" +properties-reader@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/properties-reader/-/properties-reader-2.2.0.tgz#41d837fe143d8d5f2386b6a869a1975c0b2c595c" + integrity sha512-CgVcr8MwGoBKK24r9TwHfZkLLaNFHQ6y4wgT9w/XzdpacOOi5ciH4hcuLechSDAwXsfrGQtI2JTutY2djOx2Ow== + dependencies: + mkdirp "^1.0.4" + property-expr@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/property-expr/-/property-expr-2.0.4.tgz#37b925478e58965031bb612ec5b3260f8241e910" @@ -24141,12 +23445,14 @@ proto-list@~1.2.1: resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= -proto3-json-serializer@^0.1.1: - version "0.1.4" - resolved "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-0.1.4.tgz#aa2dc4c9c9b7ea05631354b2c2e52c227539a7f0" - integrity sha512-bFzdsKU/zaTobWrRxRniMZIzzcgKYlmBWL1gAcTXZ2M7TQTGPI0JoYYs6bN7tpWj59ZCfwg7Ii/A2e8BbQGYnQ== +proto3-json-serializer@^0.1.5: + version "0.1.6" + resolved "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-0.1.6.tgz#67cf3b8d5f4c8bebfc410698ad3b1ed64da39c7b" + integrity sha512-tGbV6m6Kad8NqxMh5hw87euPS0YoZSAOIfvR01zYkQV8Gpx1V/8yU/0gCKCvfCkhAJsjvzzhnnsdQxA1w7PSog== + dependencies: + protobufjs "^6.11.2" -protobufjs@6.11.2, protobufjs@^6.10.0, protobufjs@^6.10.2, protobufjs@^6.8.6: +protobufjs@6.11.2, protobufjs@^6.10.0, protobufjs@^6.11.2, protobufjs@^6.8.6: version "6.11.2" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== @@ -24385,11 +23691,6 @@ ramda@^0.21.0: resolved "https://registry.npmjs.org/ramda/-/ramda-0.21.0.tgz#a001abedb3ff61077d4ff1d577d44de77e8d0a35" integrity sha1-oAGr7bP/YQd9T/HVd9RN536NCjU= -ramda@^0.26: - version "0.26.1" - resolved "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" - integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== - ramda@~0.27.1: version "0.27.1" resolved "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" @@ -24453,7 +23754,7 @@ raw-loader@^4.0.2: loader-utils "^2.0.0" schema-utils "^3.0.0" -rc-progress@3.1.4, rc-progress@^3.0.0: +rc-progress@3.1.4: version "3.1.4" resolved "https://registry.npmjs.org/rc-progress/-/rc-progress-3.1.4.tgz#66040d0fae7d8ced2b38588378eccb2864bad615" integrity sha512-XBAif08eunHssGeIdxMXOmRQRULdHaDdIFENQ578CMb4dyewahmmfJRyab+hw4KH4XssEzzYOkAInTLS7JJG+Q== @@ -24655,11 +23956,6 @@ react-helmet@6.1.0: react-fast-compare "^3.1.1" react-side-effect "^2.1.0" -react-hook-form@^6.15.4: - version "6.15.8" - resolved "https://registry.npmjs.org/react-hook-form/-/react-hook-form-6.15.8.tgz#725c139d308c431c4611e4b9d85a49f01cfc0e7a" - integrity sha512-prq82ofMbnRyj5wqDe8hsTRcdR25jQ+B8KtCS7BLCzjFHAwNuCjRwzPuP4eYLsEBjEIeYd6try+pdLdw0kPkpg== - react-hook-form@^7.12.2: version "7.16.1" resolved "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.16.1.tgz#669046df378a71949e5cf8a2398cbe20d5cb27bc" @@ -24720,22 +24016,6 @@ react-lifecycles-compat@^3.0.4: resolved "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== -react-markdown@^5.0.2: - version "5.0.3" - resolved "https://registry.npmjs.org/react-markdown/-/react-markdown-5.0.3.tgz#41040ea7a9324b564b328fb81dd6c04f2a5373ac" - integrity sha512-jDWOc1AvWn0WahpjW6NK64mtx6cwjM4iSsLHJPNBqoAgGOVoIdJMqaKX4++plhOtdd4JksdqzlDibgPx6B/M2w== - dependencies: - "@types/mdast" "^3.0.3" - "@types/unist" "^2.0.3" - html-to-react "^1.3.4" - mdast-add-list-metadata "1.0.1" - prop-types "^15.7.2" - react-is "^16.8.6" - remark-parse "^9.0.0" - unified "^9.0.0" - unist-util-visit "^2.0.0" - xtend "^4.0.1" - react-markdown@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/react-markdown/-/react-markdown-7.0.1.tgz#c7365fcd7d1813b3ae68f2200e8f92d47d865627" @@ -24799,7 +24079,7 @@ react-resize-detector@^2.3.0: prop-types "^15.6.0" resize-observer-polyfill "^1.5.0" -react-router-dom@6.0.0-beta.0, react-router-dom@^6.0.0-beta.0: +react-router-dom@6.0.0-beta.0: version "6.0.0-beta.0" resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.0.0-beta.0.tgz#9dcc8555365f22f7fbd09f26b6b82543f3eb97d6" integrity sha512-36yNNGMT8RB9FRPL9nKJi6HKDkgOakU+o/2hHpSzR6e37gN70MpOU6QQlmif4oAWWBwjyGc3ZNOMFCsFuHUY5w== @@ -24807,7 +24087,7 @@ react-router-dom@6.0.0-beta.0, react-router-dom@^6.0.0-beta.0: prop-types "^15.7.2" react-router "6.0.0-beta.0" -react-router-dom@^6.0.0: +react-router-dom@^6.0.0, react-router-dom@^6.0.0-beta.0: version "6.2.1" resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.2.1.tgz#32ec81829152fbb8a7b045bf593a22eadf019bec" integrity sha512-I6Zax+/TH/cZMDpj3/4Fl2eaNdcvoxxHoH1tYOREsQ22OKDYofGebrNm6CTPUcvLvZm63NL/vzCYdjf9CUhqmA== @@ -24815,14 +24095,14 @@ react-router-dom@^6.0.0: history "^5.2.0" react-router "6.2.1" -react-router@6.0.0-beta.0, react-router@^6.0.0-beta.0: +react-router@6.0.0-beta.0: version "6.0.0-beta.0" resolved "https://registry.npmjs.org/react-router/-/react-router-6.0.0-beta.0.tgz#3e11f39b6ded4412c2fed9e4f989dd4c8156724d" integrity sha512-VgMdfpVcmFQki/LZuLh8E/MNACekDetz4xqft+a6fBZvvJnVqKbLqebF7hyoawGrV1HcO5tVaUang2Og4W2j1Q== dependencies: prop-types "^15.7.2" -react-router@6.2.1, react-router@^6.0.0: +react-router@6.2.1, react-router@^6.0.0, react-router@^6.0.0-beta.0: version "6.2.1" resolved "https://registry.npmjs.org/react-router/-/react-router-6.2.1.tgz#be2a97a6006ce1d9123c28934e604faef51448a3" integrity sha512-2fG0udBtxou9lXtK97eJeET2ki5//UWfQSl1rlJ7quwe6jrktK9FCCc8dQb5QY6jAv3jua8bBQRhhDOM/kVRsg== @@ -25428,14 +24708,6 @@ remark-footnotes@2.0.0: resolved "https://registry.npmjs.org/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f" integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ== -remark-gfm@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/remark-gfm/-/remark-gfm-1.0.0.tgz#9213643001be3f277da6256464d56fd28c3b3c0d" - integrity sha512-KfexHJCiqvrdBZVbQ6RopMZGwaXz6wFJEfByIuEwGf0arvITHjiKKZ1dpXujjH9KZdm1//XJQwgfnJ3lmXaDPA== - dependencies: - mdast-util-gfm "^0.1.0" - micromark-extension-gfm "^0.3.0" - remark-gfm@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/remark-gfm/-/remark-gfm-2.0.0.tgz#4fef4d7b35afa2bd3cd0410d313d32169634051c" @@ -25491,13 +24763,6 @@ remark-parse@^10.0.0: mdast-util-from-markdown "^1.0.0" unified "^10.0.0" -remark-parse@^9.0.0: - version "9.0.0" - resolved "https://registry.npmjs.org/remark-parse/-/remark-parse-9.0.0.tgz#4d20a299665880e4f4af5d90b7c7b8a935853640" - integrity sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw== - dependencies: - mdast-util-from-markdown "^0.8.0" - remark-rehype@^9.0.0: version "9.1.0" resolved "https://registry.npmjs.org/remark-rehype/-/remark-rehype-9.1.0.tgz#e4b5b6e19c125b3780343eb66c3e9b99b0f06a81" @@ -25554,7 +24819,7 @@ repeat-element@^1.1.2: resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== -repeat-string@^1.0.0, repeat-string@^1.5.2, repeat-string@^1.5.4, repeat-string@^1.6.1: +repeat-string@^1.5.2, repeat-string@^1.5.4, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= @@ -27898,10 +27163,10 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -testcontainers@^7.23.0: - version "7.23.0" - resolved "https://registry.npmjs.org/testcontainers/-/testcontainers-7.23.0.tgz#7d73a5e219a970fb75ff6a23a28dace8b7f3f232" - integrity sha512-90H1iijeIjOLp7WVNYKTNkM1sd+dlW5019ns45hSPcOET43WebEZQVJl8/Ag9vwSZD2mjomMum9a/EXk/st4sQ== +testcontainers@^8.1.2: + version "8.1.2" + resolved "https://registry.npmjs.org/testcontainers/-/testcontainers-8.1.2.tgz#f679d908a295715a1d5eda8975d5e91891204406" + integrity sha512-/b3dWUjyTI+2qnWusAMcNSrQsCC5f2zhwn1c+fS/mwopx3xbkb0Q+glXKIs28hJryXk50QDPXOoIi2PF77HGdg== dependencies: "@types/archiver" "^5.1.1" "@types/dockerode" "^3.2.5" @@ -27912,6 +27177,7 @@ testcontainers@^7.23.0: dockerode "^3.3.1" get-port "^5.1.1" glob "^7.2.0" + properties-reader "^2.2.0" slash "^3.0.0" ssh-remote-port-forward "^1.0.4" tar-fs "^2.1.1" @@ -28662,7 +27928,7 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== -unified@9.2.0, unified@^9.0.0: +unified@9.2.0: version "9.2.0" resolved "https://registry.npmjs.org/unified/-/unified-9.2.0.tgz#67a62c627c40589edebbf60f53edfd4d822027f8" integrity sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg== @@ -28793,11 +28059,6 @@ unist-util-stringify-position@^3.0.0: dependencies: "@types/unist" "^2.0.0" -unist-util-visit-parents@1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-1.1.2.tgz#f6e3afee8bdbf961c0e6f028ea3c0480028c3d06" - integrity sha512-yvo+MMLjEwdc3RhhPYSximset7rwjMrdt9E41Smmvg25UQIenzrN83cRnF1JMzoMi9zZOQeYXHSDf7p+IQkW3Q== - unist-util-visit-parents@^3.0.0: version "3.1.1" resolved "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6"