From 2dcac58fa0ccc06c9cc45fdb8a88be6fc47f25af Mon Sep 17 00:00:00 2001 From: LvffY Date: Wed, 30 Mar 2022 17:11:35 +0200 Subject: [PATCH] =?UTF-8?q?[#10432]=20=E2=9C=A8=20Pass=20prettier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: LvffY --- ADOPTERS.md | 2 +- packages/core-app-api/src/app/AppContext.test.tsx | 5 +++-- .../core-app-api/src/routing/RoutingProvider.tsx | 5 +++-- .../src/analytics/AnalyticsContext.tsx | 5 +++-- packages/core-plugin-api/src/app/useApp.tsx | 5 +++-- .../core-plugin-api/src/routing/useRouteRef.tsx | 5 +++-- plugins/catalog-react/src/hooks/useEntity.tsx | 15 +++++++++------ 7 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ADOPTERS.md b/ADOPTERS.md index 9630ee8c9a..439a2d40be 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -34,7 +34,7 @@ _If you're using Backstage in your organization, please try to add your company | [Netflix](https://www.netflix.com/) | [bleathem](https://github.com/bleathem) | Our Backstage implementation will be the front door to a unified experience connecting our internal platform products across important workflows with integrated knowledge and support. | | [b.well](https://www.icanbwell.com/) | [Jacob Rosales](https://github.com/jrosales) | Foundation for our engineering portal and cloud insights. | | [PagerDuty](https://www.pagerduty.com/) | [Mark Shaw](https://github.com/markshawtoronto) | Developer portal, initially focused on software templates and tech-docs. | -| [MoonShiner](https://moonshiner.at) | [Fabian Hippmann](https://github.com/FabianHippmann) | Developer portal - helps us keep track of our customer projects, onboard new developers & improve our development process 🌕🚀🧑‍🚀 | +| [MoonShiner](https://moonshiner.at) | [Fabian Hippmann](https://github.com/FabianHippmann) | Developer portal - helps us keep track of our customer projects, onboard new developers & improve our development process 🌕🚀🧑‍🚀 | | [FundApps](https://www.fundapps.co/) | [Elliot Greenwood](https://github.com/egnwd) | Developer Portal - A place for us to keep track of our projects and documentation for all services and processes | | [DAZN](https://dazn.com/) | [Lou Bichard](https://twitter.com/loujaybee), [Marco Crivellaro](https://github.com/crivetechie), [Alex Hollerith](mailto:alex.hollerith@dazn.com) | Ingesting all of DAZN's repos for the catalog, migrating our internal platform apps (pull request boards, release information, inner source marketplace etc) to Backstage plugins (where applicable). | | [HelloFresh](https://www.hellofresh.de/) | [@iammuho](https://github.com/iammuho), [@ElenaForester](https://github.com/ElenaForester), [@diegomarangoni](https://github.com/diegomarangoni) | Our developer portal at HelloFresh - Spread across an organisation of 500+ engineers globally. | diff --git a/packages/core-app-api/src/app/AppContext.test.tsx b/packages/core-app-api/src/app/AppContext.test.tsx index a1131969f2..bc67ee3a9e 100644 --- a/packages/core-app-api/src/app/AppContext.test.tsx +++ b/packages/core-app-api/src/app/AppContext.test.tsx @@ -22,8 +22,9 @@ import { AppContextProvider } from './AppContext'; describe('v1 consumer', () => { function useMockAppV1(): AppContextV1 { - const impl = - useVersionedContext<{ 1: AppContextV1 }>('app-context')?.atVersion(1); + const impl = useVersionedContext<{ 1: AppContextV1 }>( + 'app-context', + )?.atVersion(1); if (!impl) { throw new Error('no impl'); } diff --git a/packages/core-app-api/src/routing/RoutingProvider.tsx b/packages/core-app-api/src/routing/RoutingProvider.tsx index 2ab1686368..3d8a274922 100644 --- a/packages/core-app-api/src/routing/RoutingProvider.tsx +++ b/packages/core-app-api/src/routing/RoutingProvider.tsx @@ -27,8 +27,9 @@ import { import { RouteResolver } from './RouteResolver'; import { BackstageRouteObject } from './types'; -const RoutingContext = - createVersionedContext<{ 1: RouteResolver }>('routing-context'); +const RoutingContext = createVersionedContext<{ 1: RouteResolver }>( + 'routing-context', +); type ProviderProps = { routePaths: Map; diff --git a/packages/core-plugin-api/src/analytics/AnalyticsContext.tsx b/packages/core-plugin-api/src/analytics/AnalyticsContext.tsx index af362cd921..e3bf616d74 100644 --- a/packages/core-plugin-api/src/analytics/AnalyticsContext.tsx +++ b/packages/core-plugin-api/src/analytics/AnalyticsContext.tsx @@ -21,8 +21,9 @@ import { import React, { ReactNode, useContext } from 'react'; import { AnalyticsContextValue } from './types'; -const AnalyticsReactContext = - createVersionedContext<{ 1: AnalyticsContextValue }>('analytics-context'); +const AnalyticsReactContext = createVersionedContext<{ + 1: AnalyticsContextValue; +}>('analytics-context'); /** * A "private" (to this package) hook that enables context inheritance and a diff --git a/packages/core-plugin-api/src/app/useApp.tsx b/packages/core-plugin-api/src/app/useApp.tsx index f2175a0969..05723ee387 100644 --- a/packages/core-plugin-api/src/app/useApp.tsx +++ b/packages/core-plugin-api/src/app/useApp.tsx @@ -23,8 +23,9 @@ import { AppContext as AppContextV1 } from './types'; * @public */ export const useApp = (): AppContextV1 => { - const versionedContext = - useVersionedContext<{ 1: AppContextV1 }>('app-context'); + const versionedContext = useVersionedContext<{ 1: AppContextV1 }>( + 'app-context', + ); if (!versionedContext) { throw new Error('App context is not available'); } diff --git a/packages/core-plugin-api/src/routing/useRouteRef.tsx b/packages/core-plugin-api/src/routing/useRouteRef.tsx index 50cfb3bdfb..563bb2035c 100644 --- a/packages/core-plugin-api/src/routing/useRouteRef.tsx +++ b/packages/core-plugin-api/src/routing/useRouteRef.tsx @@ -86,8 +86,9 @@ export function useRouteRef( | ExternalRouteRef, ): RouteFunc | undefined { const sourceLocation = useLocation(); - const versionedContext = - useVersionedContext<{ 1: RouteResolver }>('routing-context'); + const versionedContext = useVersionedContext<{ 1: RouteResolver }>( + 'routing-context', + ); if (!versionedContext) { throw new Error('Routing context is not available'); } diff --git a/plugins/catalog-react/src/hooks/useEntity.tsx b/plugins/catalog-react/src/hooks/useEntity.tsx index 580faf487e..6206c52f56 100644 --- a/plugins/catalog-react/src/hooks/useEntity.tsx +++ b/plugins/catalog-react/src/hooks/useEntity.tsx @@ -32,8 +32,9 @@ export type EntityLoadingStatus = { // This context has support for multiple concurrent versions of this package. // It is currently used in parallel with the old context in order to provide // a smooth transition, but will eventually be the only context we use. -const NewEntityContext = - createVersionedContext<{ 1: EntityLoadingStatus }>('entity-context'); +const NewEntityContext = createVersionedContext<{ 1: EntityLoadingStatus }>( + 'entity-context', +); /** * Properties for the AsyncEntityProvider component. @@ -104,8 +105,9 @@ export const EntityProvider = ({ entity, children }: EntityProviderProps) => ( export function useEntity(): { entity: TEntity; } { - const versionedHolder = - useVersionedContext<{ 1: EntityLoadingStatus }>('entity-context'); + const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>( + 'entity-context', + ); if (!versionedHolder) { throw new Error('Entity context is not available'); @@ -133,8 +135,9 @@ export function useEntity(): { export function useAsyncEntity< TEntity extends Entity = Entity, >(): EntityLoadingStatus { - const versionedHolder = - useVersionedContext<{ 1: EntityLoadingStatus }>('entity-context'); + const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>( + 'entity-context', + ); if (!versionedHolder) { throw new Error('Entity context is not available');