From 8542af998a323480b80805b70aead82572c8cc69 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Sun, 28 Jul 2024 03:15:00 -0400 Subject: [PATCH 001/268] fix errors with auth redirect flow Signed-off-by: Stephen Glass --- packages/core-app-api/package.json | 57 ++++++++++--------- .../auth/microsoft/MicrosoftAuth.ts | 4 ++ .../implementations/auth/oauth2/OAuth2.ts | 11 +++- .../implementations/auth/saml/SamlAuth.ts | 9 ++- packages/core-app-api/src/lib/index.ts | 1 + .../core-app-api/src/lib/signInAuthError.ts | 29 ++++++++++ .../src/layout/SignInPage/SignInPage.tsx | 19 ++++++- .../src/apis/definitions/auth.ts | 5 ++ .../createCookieAuthErrorMiddleware.ts | 44 ++++++++++++++ plugins/auth-backend/src/service/router.ts | 8 ++- .../src/oauth/createAuthErrorCookie.ts | 56 ++++++++++++++++++ .../src/oauth/createOAuthRouteHandlers.ts | 28 +++++++-- 12 files changed, 232 insertions(+), 39 deletions(-) create mode 100644 packages/core-app-api/src/lib/signInAuthError.ts create mode 100644 plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts create mode 100644 plugins/auth-node/src/oauth/createAuthErrorCookie.ts diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index 5f297b16d5..31b3cd22fc 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -1,14 +1,30 @@ { "name": "@backstage/core-app-api", - "description": "Core app API used by Backstage apps", "version": "1.14.0", + "description": "Core app API used by Backstage apps", + "backstage": { + "role": "web-library" + }, "publishConfig": { "access": "public" }, + "keywords": [ + "backstage" + ], + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/core-app-api" + }, + "license": "Apache-2.0", + "sideEffects": false, "exports": { ".": "./src/index.ts", "./package.json": "./package.json" }, + "main": "src/index.ts", + "types": "src/index.ts", "typesVersions": { "*": { "package.json": [ @@ -16,34 +32,23 @@ ] } }, - "backstage": { - "role": "web-library" - }, - "homepage": "https://backstage.io", - "repository": { - "type": "git", - "url": "https://github.com/backstage/backstage", - "directory": "packages/core-app-api" - }, - "keywords": [ - "backstage" + "files": [ + "dist", + "config.d.ts" ], - "license": "Apache-2.0", - "main": "src/index.ts", - "types": "src/index.ts", - "sideEffects": false, "scripts": { "build": "backstage-cli package build", + "clean": "backstage-cli package clean", "lint": "backstage-cli package lint", - "test": "backstage-cli package test", "prepack": "backstage-cli package prepack", "postpack": "backstage-cli package postpack", - "clean": "backstage-cli package clean", - "start": "backstage-cli package start" + "start": "backstage-cli package start", + "test": "backstage-cli package test" }, "dependencies": { "@backstage/config": "workspace:^", "@backstage/core-plugin-api": "workspace:^", + "@backstage/errors": "workspace:^", "@backstage/types": "workspace:^", "@backstage/version-bridge": "workspace:^", "@types/prop-types": "^15.7.3", @@ -56,11 +61,6 @@ "zen-observable": "^0.10.0", "zod": "^3.22.4" }, - "peerDependencies": { - "react": "^16.13.1 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0", - "react-router-dom": "6.0.0-beta.0 || ^6.3.0" - }, "devDependencies": { "@backstage/cli": "workspace:^", "@backstage/test-utils": "workspace:^", @@ -76,9 +76,10 @@ "react-router-dom-stable": "npm:react-router-dom@^6.3.0", "react-router-stable": "npm:react-router@^6.3.0" }, - "files": [ - "dist", - "config.d.ts" - ], + "peerDependencies": { + "react": "^16.13.1 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0", + "react-router-dom": "6.0.0-beta.0 || ^6.3.0" + }, "configSchema": "config.d.ts" } diff --git a/packages/core-app-api/src/apis/implementations/auth/microsoft/MicrosoftAuth.ts b/packages/core-app-api/src/apis/implementations/auth/microsoft/MicrosoftAuth.ts index c57c65d830..049022702e 100644 --- a/packages/core-app-api/src/apis/implementations/auth/microsoft/MicrosoftAuth.ts +++ b/packages/core-app-api/src/apis/implementations/auth/microsoft/MicrosoftAuth.ts @@ -175,6 +175,10 @@ export default class MicrosoftAuth { return this.microsoftGraph().signOut(); } + getSignInAuthError() { + return this.microsoftGraph().getSignInAuthError(); + } + sessionState$() { return this.microsoftGraph().sessionState$(); } diff --git a/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts b/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts index dbad031652..1ac5199b8f 100644 --- a/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts +++ b/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts @@ -31,10 +31,12 @@ import { SessionApi, BackstageIdentityApi, BackstageUserIdentity, + DiscoveryApi, } from '@backstage/core-plugin-api'; import { Observable } from '@backstage/types'; import { OAuth2Session } from './types'; import { OAuthApiCreateOptions } from '../types'; +import { getSignInAuthError } from '../../../../lib'; /** * OAuth2 create options. @@ -152,18 +154,21 @@ export default class OAuth2 }, }); - return new OAuth2({ sessionManager, scopeTransform }); + return new OAuth2({ sessionManager, scopeTransform, discoveryApi }); } private readonly sessionManager: SessionManager; private readonly scopeTransform: (scopes: string[]) => string[]; + private readonly discoveryApi: DiscoveryApi; private constructor(options: { sessionManager: SessionManager; scopeTransform: (scopes: string[]) => string[]; + discoveryApi: DiscoveryApi; }) { this.sessionManager = options.sessionManager; this.scopeTransform = options.scopeTransform; + this.discoveryApi = options.discoveryApi; } async signIn() { @@ -224,4 +229,8 @@ export default class OAuth2 return new Set(scopeTransform(scopeList)); } + + async getSignInAuthError() { + return getSignInAuthError(this.discoveryApi); + } } diff --git a/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts b/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts index dad62f1d06..325be93c4c 100644 --- a/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts +++ b/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts @@ -22,6 +22,7 @@ import { SessionApi, SessionState, BackstageIdentityResponse, + DiscoveryApi, } from '@backstage/core-plugin-api'; import { Observable } from '@backstage/types'; import { DirectAuthConnector } from '../../../../lib/AuthConnector'; @@ -32,6 +33,7 @@ import { import { SessionManager } from '../../../../lib/AuthSessionManager/types'; import { AuthApiCreateOptions } from '../types'; import { SamlSession, samlSessionSchema } from './types'; +import { getSignInAuthError } from '../../../../lib'; export type SamlAuthResponse = { profile: ProfileInfo; @@ -75,7 +77,7 @@ export default class SamlAuth schema: samlSessionSchema, }); - return new SamlAuth(authSessionStore); + return new SamlAuth(authSessionStore, discoveryApi); } sessionState$(): Observable { @@ -84,6 +86,7 @@ export default class SamlAuth private constructor( private readonly sessionManager: SessionManager, + private readonly discoveryApi: DiscoveryApi, ) {} async signIn() { @@ -104,4 +107,8 @@ export default class SamlAuth const session = await this.sessionManager.getSession(options); return session?.profile; } + + async getSignInAuthError() { + return getSignInAuthError(this.discoveryApi); + } } diff --git a/packages/core-app-api/src/lib/index.ts b/packages/core-app-api/src/lib/index.ts index 1327aab4c2..d5aa2b9e3b 100644 --- a/packages/core-app-api/src/lib/index.ts +++ b/packages/core-app-api/src/lib/index.ts @@ -16,5 +16,6 @@ export * from './subjects'; export * from './loginPopup'; +export * from './signInAuthError'; export * from './AuthConnector'; export * from './AuthSessionManager'; diff --git a/packages/core-app-api/src/lib/signInAuthError.ts b/packages/core-app-api/src/lib/signInAuthError.ts new file mode 100644 index 0000000000..a86a55ee4c --- /dev/null +++ b/packages/core-app-api/src/lib/signInAuthError.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2024 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 { DiscoveryApi } from '@backstage/core-plugin-api'; +import { deserializeError } from '@backstage/errors'; + +export async function getSignInAuthError( + discoveryApi: DiscoveryApi, +): Promise { + const baseUrl = await discoveryApi.getBaseUrl('auth'); + const response = await fetch(`${baseUrl}/.backstage/error`, { + credentials: 'include', + }); + const data = await response.json(); + + return data ? deserializeError(data) : undefined; +} diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index 95d96b701a..207d7e664e 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 { useMountEffect } from '@react-hookz/web'; +import { useAsync, useMountEffect } from '@react-hookz/web'; import { Progress } from '../../components/Progress'; import { Content } from '../Content/Content'; import { ContentHeader } from '../ContentHeader/ContentHeader'; @@ -37,6 +37,7 @@ import { GridItem, useStyles } from './styles'; import { IdentityProviders, SignInProviderConfig } from './types'; import { coreComponentsTranslationRef } from '../../translation'; import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; +import { useSearchParams } from 'react-router-dom'; type MultiSignInPageProps = SignInPageProps & { providers: IdentityProviders; @@ -106,6 +107,8 @@ export const SingleSignInPage = ({ // displayed for a split second when the user is already logged-in. const [showLoginPage, setShowLoginPage] = useState(false); + const [searchParams, _setSearchParams] = useSearchParams(); + type LoginOpts = { checkExisting?: boolean; showPopup?: boolean }; const login = async ({ checkExisting, showPopup }: LoginOpts) => { try { @@ -152,7 +155,19 @@ export const SingleSignInPage = ({ } }; - useMountEffect(() => login({ checkExisting: true })); + const [_state, actions] = useAsync(async () => { + if (searchParams.get('error') !== 'false') { + const errorResponse = await authApi.getSignInAuthError(); + if (errorResponse) { + setError(errorResponse); + } + } + }); + + useMountEffect(() => { + actions.execute(); + login({ checkExisting: true }); + }); return showLoginPage ? ( diff --git a/packages/core-plugin-api/src/apis/definitions/auth.ts b/packages/core-plugin-api/src/apis/definitions/auth.ts index d89544cf68..c29d965890 100644 --- a/packages/core-plugin-api/src/apis/definitions/auth.ts +++ b/packages/core-plugin-api/src/apis/definitions/auth.ts @@ -291,6 +291,11 @@ export type SessionApi = { */ signOut(): Promise; + /** + * Get any caught errors during the auth redirect flow + */ + getSignInAuthError(): Promise; + /** * Observe the current state of the auth session. Emits the current state on subscription. */ diff --git a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts new file mode 100644 index 0000000000..9b1d20431d --- /dev/null +++ b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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 Router from 'express-promise-router'; + +const AUTH_ERROR_COOKIE = 'auth-error'; + +/** + * @public + * Creates a middleware that can be used to get auth errors in redirect flow + */ +export function createCookieAuthErrorMiddleware(authUrl: string) { + const router = Router(); + + router.get('/.backstage/error', async (req, res) => { + const error = req.cookies[AUTH_ERROR_COOKIE]; + if (error) { + const { hostname: domain } = new URL(authUrl); + + res.clearCookie('auth-error', { + path: '/api/auth/.backstage/error', + domain, + }); + res.status(200).json(error); + } else { + res.status(404); + } + }); + + return router; +} diff --git a/plugins/auth-backend/src/service/router.ts b/plugins/auth-backend/src/service/router.ts index 4bb42c3abd..0f6e7d201a 100644 --- a/plugins/auth-backend/src/service/router.ts +++ b/plugins/auth-backend/src/service/router.ts @@ -48,6 +48,7 @@ import { StaticTokenIssuer } from '../identity/StaticTokenIssuer'; import { StaticKeyStore } from '../identity/StaticKeyStore'; import { Config } from '@backstage/config'; import { bindProviderRouters, ProviderFactories } from '../providers/router'; +import { createCookieAuthErrorMiddleware } from './createCookieAuthErrorMiddleware'; /** @public */ export interface RouterOptions { @@ -170,10 +171,15 @@ export async function createRouter( }); // Gives a more helpful error message than a plain 404 - router.use('/:provider/', req => { + router.use('/:provider/', (req, _, next) => { const { provider } = req.params; + if (provider.startsWith('.backstage')) { + return next('route'); + } throw new NotFoundError(`Unknown auth provider '${provider}'`); }); + router.use(createCookieAuthErrorMiddleware(authUrl)); + return router; } diff --git a/plugins/auth-node/src/oauth/createAuthErrorCookie.ts b/plugins/auth-node/src/oauth/createAuthErrorCookie.ts new file mode 100644 index 0000000000..05b1c99cee --- /dev/null +++ b/plugins/auth-node/src/oauth/createAuthErrorCookie.ts @@ -0,0 +1,56 @@ +/* + * Copyright 2024 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 { Response } from 'express'; +import { CookieConfigurer } from '../types'; +import { serializeError } from '@backstage/errors'; + +const ONE_MINUTE_MS = 60 * 1000; + +const AUTH_ERROR_COOKIE = 'auth-error'; + +function configureAuthErrorCookie(redirectUrl: string, appOrigin: string) { + const { hostname: domain, pathname: path, protocol } = new URL(redirectUrl); + const secure = protocol === 'https:'; + + // For situations where the auth-backend is running on a + // different domain than the app, we set the SameSite attribute + // to 'none' to allow third-party access to the cookie, but + // only if it's in a secure context (https). + let sameSite: ReturnType['sameSite'] = 'lax'; + if (new URL(appOrigin).hostname !== domain && secure) { + sameSite = 'none'; + } + + return { domain, path, secure, sameSite }; +} + +export function createAuthErrorCookie( + res: Response, + origin: string, + options: { + error: Error; + redirectUrl: string; + }, +) { + const { error, redirectUrl } = options; + const jsonData = serializeError(error); + + res.cookie(AUTH_ERROR_COOKIE, jsonData, { + maxAge: ONE_MINUTE_MS, + httpOnly: true, + ...configureAuthErrorCookie(redirectUrl, origin), + }); +} diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts index 82bfa2f02c..649c094dba 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts @@ -42,6 +42,7 @@ import { import { OAuthAuthenticator, OAuthAuthenticatorResult } from './types'; import { Config } from '@backstage/config'; import { CookieScopeManager } from './CookieScopeManager'; +import { createAuthErrorCookie } from './createAuthErrorCookie'; /** @public */ export interface OAuthRouteHandlersOptions { @@ -164,9 +165,10 @@ export function createOAuthRouteHandlers( res: express.Response, ): Promise { let origin = defaultAppOrigin; + let state; try { - const state = decodeOAuthState(req.query.state?.toString() ?? ''); + state = decodeOAuthState(req.query.state?.toString() ?? ''); if (state.origin) { try { @@ -248,11 +250,25 @@ export function createOAuthRouteHandlers( const { name, message } = isError(error) ? error : new Error('Encountered invalid error'); // Being a bit safe and not forwarding the bad value - // post error message back to popup if failure - sendWebMessageResponse(res, origin, { - type: 'authorization_response', - error: { name, message }, - }); + + if (state?.flow === 'redirect' && state?.redirectUrl) { + createAuthErrorCookie(res, state?.redirectUrl, { + error: { name, message }, + redirectUrl: `${baseUrl}/.backstage/error`, + }); + + const redirectUrl = new URL(state.redirectUrl); + redirectUrl.searchParams.set('error', 'true'); + + // set the error in a cookie and redirect user back to sign in where the error can be rendered + res.redirect(redirectUrl.toString()); + } else { + // post error message back to popup if failure + sendWebMessageResponse(res, origin, { + type: 'authorization_response', + error: { name, message }, + }); + } } }, From 5c11d3f97039785cc52bb8c68b54483b8d4aba85 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Sun, 28 Jul 2024 03:21:05 -0400 Subject: [PATCH 002/268] fix formatting Signed-off-by: Stephen Glass --- packages/core-app-api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index 31b3cd22fc..547dd47654 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/core-app-api", - "version": "1.14.0", + "version": "1.14.1-next.0", "description": "Core app API used by Backstage apps", "backstage": { "role": "web-library" From 0625085c2fe946cf7091f7633b15c29fde435ee6 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Sun, 28 Jul 2024 03:29:31 -0400 Subject: [PATCH 003/268] update clear cookie to use var name Signed-off-by: Stephen Glass --- .../auth-backend/src/service/createCookieAuthErrorMiddleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts index 9b1d20431d..cf7645b081 100644 --- a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts +++ b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts @@ -30,7 +30,7 @@ export function createCookieAuthErrorMiddleware(authUrl: string) { if (error) { const { hostname: domain } = new URL(authUrl); - res.clearCookie('auth-error', { + res.clearCookie(AUTH_ERROR_COOKIE, { path: '/api/auth/.backstage/error', domain, }); From 31edacd9b153209670a5e97a998c434e19d07a41 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Sun, 28 Jul 2024 03:29:58 -0400 Subject: [PATCH 004/268] yarn lock Signed-off-by: Stephen Glass --- yarn.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/yarn.lock b/yarn.lock index c6a1d2139a..c3d1f83de5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4123,6 +4123,7 @@ __metadata: "@backstage/cli": "workspace:^" "@backstage/config": "workspace:^" "@backstage/core-plugin-api": "workspace:^" + "@backstage/errors": "workspace:^" "@backstage/test-utils": "workspace:^" "@backstage/types": "workspace:^" "@backstage/version-bridge": "workspace:^" From e1caa7bc85b886f6e585ed9b66747ff199d751b6 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Sun, 28 Jul 2024 14:12:12 -0400 Subject: [PATCH 005/268] create auth error api ref Signed-off-by: Stephen Glass --- packages/app-defaults/src/defaults/apis.ts | 9 ++++ .../AuthErrorApi/SignInAuthErrorApi.ts | 41 +++++++++++++++++ .../implementations/AuthErrorApi/index.ts} | 14 +----- .../auth/microsoft/MicrosoftAuth.ts | 4 -- .../implementations/auth/oauth2/OAuth2.ts | 11 +---- .../implementations/auth/saml/SamlAuth.ts | 9 +--- .../src/apis/implementations/index.ts | 1 + packages/core-app-api/src/lib/index.ts | 1 - .../src/layout/SignInPage/SignInPage.tsx | 8 ++-- .../src/layout/SignInPage/providers.tsx | 17 +++++++ .../src/apis/definitions/AuthErrorApi.ts | 45 +++++++++++++++++++ .../src/apis/definitions/auth.ts | 5 --- .../src/apis/definitions/index.ts | 1 + 13 files changed, 122 insertions(+), 44 deletions(-) create mode 100644 packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts rename packages/core-app-api/src/{lib/signInAuthError.ts => apis/implementations/AuthErrorApi/index.ts} (56%) create mode 100644 packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts diff --git a/packages/app-defaults/src/defaults/apis.ts b/packages/app-defaults/src/defaults/apis.ts index 4e9e1a492c..84902b9f52 100644 --- a/packages/app-defaults/src/defaults/apis.ts +++ b/packages/app-defaults/src/defaults/apis.ts @@ -35,6 +35,7 @@ import { createFetchApi, FetchMiddlewares, VMwareCloudAuth, + SignInAuthErrorApi, } from '@backstage/core-app-api'; import { @@ -58,6 +59,7 @@ import { bitbucketServerAuthApiRef, atlassianAuthApiRef, vmwareCloudAuthApiRef, + authErrorApiRef, } from '@backstage/core-plugin-api'; import { permissionApiRef, @@ -287,4 +289,11 @@ export const apis = [ factory: ({ config, discovery, identity }) => IdentityPermissionApi.create({ config, discovery, identity }), }), + createApiFactory({ + api: authErrorApiRef, + deps: { + discovery: discoveryApiRef, + }, + factory: ({ discovery }) => SignInAuthErrorApi.create({ discovery }), + }), ]; diff --git a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts b/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts new file mode 100644 index 0000000000..0197f253ab --- /dev/null +++ b/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.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 { DiscoveryApi, AuthErrorApi } from '@backstage/core-plugin-api'; +import { deserializeError } from '@backstage/errors'; + +/** + * The default implementation of the AuthErrorApi, which simply calls auth error endpoint. + * @public + */ +export class SignInAuthErrorApi implements AuthErrorApi { + private constructor(private readonly discoveryApi: DiscoveryApi) {} + + static create(options: { discovery: DiscoveryApi }) { + const { discovery } = options; + return new SignInAuthErrorApi(discovery); + } + + async getSignInAuthError(): Promise { + const baseUrl = await this.discoveryApi.getBaseUrl('auth'); + const response = await fetch(`${baseUrl}/.backstage/error`, { + credentials: 'include', + }); + const data = await response.json(); + + return data ? deserializeError(data) : undefined; + } +} diff --git a/packages/core-app-api/src/lib/signInAuthError.ts b/packages/core-app-api/src/apis/implementations/AuthErrorApi/index.ts similarity index 56% rename from packages/core-app-api/src/lib/signInAuthError.ts rename to packages/core-app-api/src/apis/implementations/AuthErrorApi/index.ts index a86a55ee4c..6f3a3ae269 100644 --- a/packages/core-app-api/src/lib/signInAuthError.ts +++ b/packages/core-app-api/src/apis/implementations/AuthErrorApi/index.ts @@ -13,17 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { DiscoveryApi } from '@backstage/core-plugin-api'; -import { deserializeError } from '@backstage/errors'; -export async function getSignInAuthError( - discoveryApi: DiscoveryApi, -): Promise { - const baseUrl = await discoveryApi.getBaseUrl('auth'); - const response = await fetch(`${baseUrl}/.backstage/error`, { - credentials: 'include', - }); - const data = await response.json(); - - return data ? deserializeError(data) : undefined; -} +export { SignInAuthErrorApi } from './SignInAuthErrorApi'; diff --git a/packages/core-app-api/src/apis/implementations/auth/microsoft/MicrosoftAuth.ts b/packages/core-app-api/src/apis/implementations/auth/microsoft/MicrosoftAuth.ts index 049022702e..c57c65d830 100644 --- a/packages/core-app-api/src/apis/implementations/auth/microsoft/MicrosoftAuth.ts +++ b/packages/core-app-api/src/apis/implementations/auth/microsoft/MicrosoftAuth.ts @@ -175,10 +175,6 @@ export default class MicrosoftAuth { return this.microsoftGraph().signOut(); } - getSignInAuthError() { - return this.microsoftGraph().getSignInAuthError(); - } - sessionState$() { return this.microsoftGraph().sessionState$(); } diff --git a/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts b/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts index 1ac5199b8f..dbad031652 100644 --- a/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts +++ b/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts @@ -31,12 +31,10 @@ import { SessionApi, BackstageIdentityApi, BackstageUserIdentity, - DiscoveryApi, } from '@backstage/core-plugin-api'; import { Observable } from '@backstage/types'; import { OAuth2Session } from './types'; import { OAuthApiCreateOptions } from '../types'; -import { getSignInAuthError } from '../../../../lib'; /** * OAuth2 create options. @@ -154,21 +152,18 @@ export default class OAuth2 }, }); - return new OAuth2({ sessionManager, scopeTransform, discoveryApi }); + return new OAuth2({ sessionManager, scopeTransform }); } private readonly sessionManager: SessionManager; private readonly scopeTransform: (scopes: string[]) => string[]; - private readonly discoveryApi: DiscoveryApi; private constructor(options: { sessionManager: SessionManager; scopeTransform: (scopes: string[]) => string[]; - discoveryApi: DiscoveryApi; }) { this.sessionManager = options.sessionManager; this.scopeTransform = options.scopeTransform; - this.discoveryApi = options.discoveryApi; } async signIn() { @@ -229,8 +224,4 @@ export default class OAuth2 return new Set(scopeTransform(scopeList)); } - - async getSignInAuthError() { - return getSignInAuthError(this.discoveryApi); - } } diff --git a/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts b/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts index 325be93c4c..dad62f1d06 100644 --- a/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts +++ b/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts @@ -22,7 +22,6 @@ import { SessionApi, SessionState, BackstageIdentityResponse, - DiscoveryApi, } from '@backstage/core-plugin-api'; import { Observable } from '@backstage/types'; import { DirectAuthConnector } from '../../../../lib/AuthConnector'; @@ -33,7 +32,6 @@ import { import { SessionManager } from '../../../../lib/AuthSessionManager/types'; import { AuthApiCreateOptions } from '../types'; import { SamlSession, samlSessionSchema } from './types'; -import { getSignInAuthError } from '../../../../lib'; export type SamlAuthResponse = { profile: ProfileInfo; @@ -77,7 +75,7 @@ export default class SamlAuth schema: samlSessionSchema, }); - return new SamlAuth(authSessionStore, discoveryApi); + return new SamlAuth(authSessionStore); } sessionState$(): Observable { @@ -86,7 +84,6 @@ export default class SamlAuth private constructor( private readonly sessionManager: SessionManager, - private readonly discoveryApi: DiscoveryApi, ) {} async signIn() { @@ -107,8 +104,4 @@ export default class SamlAuth const session = await this.sessionManager.getSession(options); return session?.profile; } - - async getSignInAuthError() { - return getSignInAuthError(this.discoveryApi); - } } diff --git a/packages/core-app-api/src/apis/implementations/index.ts b/packages/core-app-api/src/apis/implementations/index.ts index 1c79d3d164..7643dfcd82 100644 --- a/packages/core-app-api/src/apis/implementations/index.ts +++ b/packages/core-app-api/src/apis/implementations/index.ts @@ -30,3 +30,4 @@ export * from './FeatureFlagsApi'; export * from './FetchApi'; export * from './OAuthRequestApi'; export * from './StorageApi'; +export * from './AuthErrorApi'; diff --git a/packages/core-app-api/src/lib/index.ts b/packages/core-app-api/src/lib/index.ts index d5aa2b9e3b..1327aab4c2 100644 --- a/packages/core-app-api/src/lib/index.ts +++ b/packages/core-app-api/src/lib/index.ts @@ -16,6 +16,5 @@ export * from './subjects'; export * from './loginPopup'; -export * from './signInAuthError'; export * from './AuthConnector'; export * from './AuthSessionManager'; diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index 207d7e664e..f0af0c5d35 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -19,6 +19,7 @@ import { configApiRef, SignInPageProps, useApi, + authErrorApiRef, } from '@backstage/core-plugin-api'; import { UserIdentity } from './UserIdentity'; import Button from '@material-ui/core/Button'; @@ -98,6 +99,7 @@ export const SingleSignInPage = ({ const classes = useStyles(); const authApi = useApi(provider.apiRef); const configApi = useApi(configApiRef); + const authErrorApi = useApi(authErrorApiRef); const { t } = useTranslationRef(coreComponentsTranslationRef); const [error, setError] = useState(); @@ -155,9 +157,9 @@ export const SingleSignInPage = ({ } }; - const [_state, actions] = useAsync(async () => { + const [_, { execute }] = useAsync(async () => { if (searchParams.get('error') !== 'false') { - const errorResponse = await authApi.getSignInAuthError(); + const errorResponse = await authErrorApi.getSignInAuthError(); if (errorResponse) { setError(errorResponse); } @@ -165,7 +167,7 @@ export const SingleSignInPage = ({ }); useMountEffect(() => { - actions.execute(); + execute(); login({ checkExisting: true }); }); diff --git a/packages/core-components/src/layout/SignInPage/providers.tsx b/packages/core-components/src/layout/SignInPage/providers.tsx index e456a6948b..9b73cfc561 100644 --- a/packages/core-components/src/layout/SignInPage/providers.tsx +++ b/packages/core-components/src/layout/SignInPage/providers.tsx @@ -21,6 +21,7 @@ import { useApiHolder, errorApiRef, IdentityApi, + authErrorApiRef, } from '@backstage/core-plugin-api'; import { IdentityProviders, @@ -31,6 +32,8 @@ import { commonProvider } from './commonProvider'; import { guestProvider } from './guestProvider'; import { customProvider } from './customProvider'; import { IdentityApiSignOutProxy } from './IdentityApiSignOutProxy'; +import { useSearchParams } from 'react-router-dom'; +import { useMountEffect, useAsync } from '@react-hookz/web'; const PROVIDER_STORAGE_KEY = '@backstage/core:SignInPage:provider'; @@ -86,8 +89,22 @@ export const useSignInProviders = ( ) => { const errorApi = useApi(errorApiRef); const apiHolder = useApiHolder(); + const authErrorApi = useApi(authErrorApiRef); const [loading, setLoading] = useState(true); + const [searchParams, _setSearchParams] = useSearchParams(); + + const [_, { execute }] = useAsync(async () => { + if (searchParams.get('error') !== 'false') { + const errorResponse = await authErrorApi.getSignInAuthError(); + if (errorResponse) { + errorApi.post(errorResponse); + } + } + }); + + useMountEffect(execute); + // This decorates the result with sign out logic from this hook const handleWrappedResult = useCallback( (identityApi: IdentityApi) => { diff --git a/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts b/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts new file mode 100644 index 0000000000..57c6b1088f --- /dev/null +++ b/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2024 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 { ApiRef, createApiRef } from '../system'; + +/** + * A wrapper for retrieving any errors caught in authentication redirect flow + * + * @public + */ +export type AuthErrorApi = { + /** + * Get any caught errors during the auth redirect flow + */ + getSignInAuthError(): Promise; +}; + +/** + * The {@link ApiRef} of {@link AuthErrorApi}. + * + * @remarks + * + * This is a wrapper that uses fetch to retrieve any caught errors + * in the authentication redirect flow process. This API calls a + * Backstage endpoint to read any error stored in authentication error + * cookie and returns it to the user. + * + * @public + */ +export const authErrorApiRef: ApiRef = createApiRef({ + id: 'core.authError', +}); diff --git a/packages/core-plugin-api/src/apis/definitions/auth.ts b/packages/core-plugin-api/src/apis/definitions/auth.ts index c29d965890..d89544cf68 100644 --- a/packages/core-plugin-api/src/apis/definitions/auth.ts +++ b/packages/core-plugin-api/src/apis/definitions/auth.ts @@ -291,11 +291,6 @@ export type SessionApi = { */ signOut(): Promise; - /** - * Get any caught errors during the auth redirect flow - */ - getSignInAuthError(): Promise; - /** * Observe the current state of the auth session. Emits the current state on subscription. */ diff --git a/packages/core-plugin-api/src/apis/definitions/index.ts b/packages/core-plugin-api/src/apis/definitions/index.ts index 67d442587d..406dc1980e 100644 --- a/packages/core-plugin-api/src/apis/definitions/index.ts +++ b/packages/core-plugin-api/src/apis/definitions/index.ts @@ -33,3 +33,4 @@ export * from './FetchApi'; export * from './IdentityApi'; export * from './OAuthRequestApi'; export * from './StorageApi'; +export * from './AuthErrorApi'; From 40064678e0e5b4f24ff9558ba3efd700c0e9cd07 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Sun, 28 Jul 2024 14:15:08 -0400 Subject: [PATCH 006/268] rename async execute Signed-off-by: Stephen Glass --- packages/core-components/src/layout/SignInPage/SignInPage.tsx | 4 ++-- packages/core-components/src/layout/SignInPage/providers.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index f0af0c5d35..a0d5ec232e 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -157,7 +157,7 @@ export const SingleSignInPage = ({ } }; - const [_, { execute }] = useAsync(async () => { + const [_, { execute: checkAuthErrors }] = useAsync(async () => { if (searchParams.get('error') !== 'false') { const errorResponse = await authErrorApi.getSignInAuthError(); if (errorResponse) { @@ -167,7 +167,7 @@ export const SingleSignInPage = ({ }); useMountEffect(() => { - execute(); + checkAuthErrors(); login({ checkExisting: true }); }); diff --git a/packages/core-components/src/layout/SignInPage/providers.tsx b/packages/core-components/src/layout/SignInPage/providers.tsx index 9b73cfc561..4b6c251e7b 100644 --- a/packages/core-components/src/layout/SignInPage/providers.tsx +++ b/packages/core-components/src/layout/SignInPage/providers.tsx @@ -94,7 +94,7 @@ export const useSignInProviders = ( const [searchParams, _setSearchParams] = useSearchParams(); - const [_, { execute }] = useAsync(async () => { + const [_, { execute: checkAuthErrors }] = useAsync(async () => { if (searchParams.get('error') !== 'false') { const errorResponse = await authErrorApi.getSignInAuthError(); if (errorResponse) { @@ -103,7 +103,7 @@ export const useSignInProviders = ( } }); - useMountEffect(execute); + useMountEffect(checkAuthErrors); // This decorates the result with sign out logic from this hook const handleWrappedResult = useCallback( From 5d8649d7757c665ca76b9fc687d3b0e28c98f4da Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Sun, 28 Jul 2024 23:28:13 -0400 Subject: [PATCH 007/268] update param name Signed-off-by: Stephen Glass --- .../implementations/AuthErrorApi/SignInAuthErrorApi.ts | 3 +++ plugins/auth-node/src/oauth/createAuthErrorCookie.ts | 10 +++++----- .../auth-node/src/oauth/createOAuthRouteHandlers.ts | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts b/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts index 0197f253ab..2f2ba9cb09 100644 --- a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts +++ b/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts @@ -31,6 +31,9 @@ export class SignInAuthErrorApi implements AuthErrorApi { async getSignInAuthError(): Promise { const baseUrl = await this.discoveryApi.getBaseUrl('auth'); + + // use native fetch instead of depending on fetchApi because + // we are not signed in and are calling an unauthenticated endpoint const response = await fetch(`${baseUrl}/.backstage/error`, { credentials: 'include', }); diff --git a/plugins/auth-node/src/oauth/createAuthErrorCookie.ts b/plugins/auth-node/src/oauth/createAuthErrorCookie.ts index 05b1c99cee..61914e7c05 100644 --- a/plugins/auth-node/src/oauth/createAuthErrorCookie.ts +++ b/plugins/auth-node/src/oauth/createAuthErrorCookie.ts @@ -21,8 +21,8 @@ const ONE_MINUTE_MS = 60 * 1000; const AUTH_ERROR_COOKIE = 'auth-error'; -function configureAuthErrorCookie(redirectUrl: string, appOrigin: string) { - const { hostname: domain, pathname: path, protocol } = new URL(redirectUrl); +function configureAuthErrorCookie(apiUrl: string, appOrigin: string) { + const { hostname: domain, pathname: path, protocol } = new URL(apiUrl); const secure = protocol === 'https:'; // For situations where the auth-backend is running on a @@ -42,15 +42,15 @@ export function createAuthErrorCookie( origin: string, options: { error: Error; - redirectUrl: string; + apiUrl: string; }, ) { - const { error, redirectUrl } = options; + const { error, apiUrl } = options; const jsonData = serializeError(error); res.cookie(AUTH_ERROR_COOKIE, jsonData, { maxAge: ONE_MINUTE_MS, httpOnly: true, - ...configureAuthErrorCookie(redirectUrl, origin), + ...configureAuthErrorCookie(apiUrl, origin), }); } diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts index 649c094dba..847dc4844f 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts @@ -254,7 +254,7 @@ export function createOAuthRouteHandlers( if (state?.flow === 'redirect' && state?.redirectUrl) { createAuthErrorCookie(res, state?.redirectUrl, { error: { name, message }, - redirectUrl: `${baseUrl}/.backstage/error`, + apiUrl: `${baseUrl}/.backstage/error`, }); const redirectUrl = new URL(state.redirectUrl); From 41b0d71313f5804b890f39d5f258325ab838a718 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Sun, 28 Jul 2024 23:54:30 -0400 Subject: [PATCH 008/268] fix warning on cookie clear Signed-off-by: Stephen Glass --- .../src/apis/definitions/AuthErrorApi.ts | 2 +- .../src/service/createCookieAuthErrorMiddleware.ts | 12 ++++++++++-- plugins/auth-backend/src/service/router.ts | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts b/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts index 57c6b1088f..558c1202a8 100644 --- a/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts +++ b/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts @@ -41,5 +41,5 @@ export type AuthErrorApi = { * @public */ export const authErrorApiRef: ApiRef = createApiRef({ - id: 'core.authError', + id: 'core.auth-error', }); diff --git a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts index cf7645b081..325126d831 100644 --- a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts +++ b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts @@ -22,17 +22,25 @@ const AUTH_ERROR_COOKIE = 'auth-error'; * @public * Creates a middleware that can be used to get auth errors in redirect flow */ -export function createCookieAuthErrorMiddleware(authUrl: string) { +export function createCookieAuthErrorMiddleware( + appUrl: string, + authUrl: string, +) { const router = Router(); router.get('/.backstage/error', async (req, res) => { const error = req.cookies[AUTH_ERROR_COOKIE]; if (error) { - const { hostname: domain } = new URL(authUrl); + const { hostname: domain, protocol } = new URL(authUrl); + const secure = protocol === 'https:'; + const sameSite = + new URL(appUrl).hostname !== domain && secure ? 'none' : 'lax'; res.clearCookie(AUTH_ERROR_COOKIE, { path: '/api/auth/.backstage/error', domain, + sameSite, + secure, }); res.status(200).json(error); } else { diff --git a/plugins/auth-backend/src/service/router.ts b/plugins/auth-backend/src/service/router.ts index 0f6e7d201a..b1952755ca 100644 --- a/plugins/auth-backend/src/service/router.ts +++ b/plugins/auth-backend/src/service/router.ts @@ -179,7 +179,7 @@ export async function createRouter( throw new NotFoundError(`Unknown auth provider '${provider}'`); }); - router.use(createCookieAuthErrorMiddleware(authUrl)); + router.use(createCookieAuthErrorMiddleware(appUrl, authUrl)); return router; } From 672a4b4876db0eb3ba8756503b1252e42f49cf01 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 00:06:51 -0400 Subject: [PATCH 009/268] update middleware order Signed-off-by: Stephen Glass --- .../implementations/AuthErrorApi/SignInAuthErrorApi.ts | 2 +- plugins/auth-backend/src/service/router.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts b/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts index 2f2ba9cb09..77b3c53f14 100644 --- a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts +++ b/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Backstage Authors + * Copyright 2024 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. diff --git a/plugins/auth-backend/src/service/router.ts b/plugins/auth-backend/src/service/router.ts index b1952755ca..57f01cfba1 100644 --- a/plugins/auth-backend/src/service/router.ts +++ b/plugins/auth-backend/src/service/router.ts @@ -170,16 +170,13 @@ export async function createRouter( userInfoDatabaseHandler, }); + router.use(createCookieAuthErrorMiddleware(appUrl, authUrl)); + // Gives a more helpful error message than a plain 404 - router.use('/:provider/', (req, _, next) => { + router.use('/:provider/', req => { const { provider } = req.params; - if (provider.startsWith('.backstage')) { - return next('route'); - } throw new NotFoundError(`Unknown auth provider '${provider}'`); }); - router.use(createCookieAuthErrorMiddleware(appUrl, authUrl)); - return router; } From 17c9a1a330b509817d749f1944d91d58483a6efe Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 00:45:41 -0400 Subject: [PATCH 010/268] add test Signed-off-by: Stephen Glass --- .../src/oauth/createAuthErrorCookie.ts | 3 +-- .../oauth/createOAuthRouteHandlers.test.ts | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/plugins/auth-node/src/oauth/createAuthErrorCookie.ts b/plugins/auth-node/src/oauth/createAuthErrorCookie.ts index 61914e7c05..46ef4c4a1c 100644 --- a/plugins/auth-node/src/oauth/createAuthErrorCookie.ts +++ b/plugins/auth-node/src/oauth/createAuthErrorCookie.ts @@ -14,7 +14,6 @@ * limitations under the License. */ import { Response } from 'express'; -import { CookieConfigurer } from '../types'; import { serializeError } from '@backstage/errors'; const ONE_MINUTE_MS = 60 * 1000; @@ -29,7 +28,7 @@ function configureAuthErrorCookie(apiUrl: string, appOrigin: string) { // different domain than the app, we set the SameSite attribute // to 'none' to allow third-party access to the cookie, but // only if it's in a secure context (https). - let sameSite: ReturnType['sameSite'] = 'lax'; + let sameSite: 'lax' | 'none' = 'lax'; if (new URL(appOrigin).hostname !== domain && secure) { sameSite = 'none'; } diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts index 7da5519655..2f3eb360cc 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts @@ -742,5 +742,29 @@ describe('createOAuthRouteHandlers', () => { }, }); }); + + it('should set cookie on caught error redirect', async () => { + const app = wrapInApp(createOAuthRouteHandlers(baseConfig)); + const res = await request(app) + .get('/my-provider/handler/frame') + .query({ + state: encodeOAuthState({ + env: 'development', + nonce: '123', + flow: 'redirect', + redirectUrl: 'http://localhost:3000', + }), + }); + + // redirects on error with auth error cookie + expect(res.status).toBe(302); + const setCookieHeader = res.header['set-cookie']; + expect(setCookieHeader).toBeDefined(); + + const authErrorCookie = setCookieHeader.find((cookie: string) => + cookie.startsWith('auth-error='), + ); + expect(authErrorCookie).toBeDefined(); + }); }); }); From 155b9018980f71a3d88cd83bde430000656f6fd2 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 00:47:32 -0400 Subject: [PATCH 011/268] update test name Signed-off-by: Stephen Glass --- plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts index 2f3eb360cc..b54de50881 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts @@ -743,7 +743,7 @@ describe('createOAuthRouteHandlers', () => { }); }); - it('should set cookie on caught error redirect', async () => { + it('should set cookie and redirect on caught error', async () => { const app = wrapInApp(createOAuthRouteHandlers(baseConfig)); const res = await request(app) .get('/my-provider/handler/frame') From cc2642d69633e20561280bd048fe71b0a5cd1840 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 14:23:13 -0400 Subject: [PATCH 012/268] add tests Signed-off-by: Stephen Glass --- .../AuthErrorApi/SignInAuthErrorApi.test.ts | 94 +++++++++++++++++++ .../createCookieAuthErrorMiddleware.test.ts | 67 +++++++++++++ .../createCookieAuthErrorMiddleware.ts | 2 +- 3 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.test.ts create mode 100644 plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts diff --git a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.test.ts b/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.test.ts new file mode 100644 index 0000000000..c4d6fe83de --- /dev/null +++ b/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.test.ts @@ -0,0 +1,94 @@ +/* + * Copyright 2024 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 { DiscoveryApi } from '@backstage/core-plugin-api'; +import { serializeError } from '@backstage/errors'; +import { SignInAuthErrorApi } from './SignInAuthErrorApi'; + +describe('SignInAuthErrorApi', () => { + const mockDiscoveryApi = { + getBaseUrl: jest.fn(), + } as unknown as jest.Mocked; + + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('should create an instance of SignInAuthErrorApi', async () => { + const api = SignInAuthErrorApi.create({ + discovery: mockDiscoveryApi, + }); + + mockDiscoveryApi.getBaseUrl.mockResolvedValue( + 'http://localhost:7007/api/auth', + ); + + expect(api).toBeInstanceOf(SignInAuthErrorApi); + }); + + it('should return an error when the cookie returns an error object', async () => { + const errorObject = { + name: 'TestError', + message: 'This is a test error', + }; + const serializedError = serializeError(errorObject); + mockDiscoveryApi.getBaseUrl.mockResolvedValue( + 'http://localhost:7000/api/auth', + ); + + global.fetch = jest.fn().mockResolvedValue({ + ok: true, + json: jest.fn().mockResolvedValue(serializedError), + } as unknown as Response); + + const api = SignInAuthErrorApi.create({ discovery: mockDiscoveryApi }); + const error = await api.getSignInAuthError(); + + expect(mockDiscoveryApi.getBaseUrl).toHaveBeenCalledWith('auth'); + expect(fetch).toHaveBeenCalledWith( + 'http://localhost:7000/api/auth/.backstage/error', + { + credentials: 'include', + }, + ); + expect(error).toBeInstanceOf(Error); + expect((error as Error).name).toEqual(errorObject.name); + expect((error as Error).message).toEqual(errorObject.message); + }); + + it('should return undefined when the backend does not return an error object', async () => { + mockDiscoveryApi.getBaseUrl.mockResolvedValue( + 'http://localhost:7000/api/auth', + ); + + global.fetch = jest.fn().mockResolvedValue({ + ok: true, + json: jest.fn().mockResolvedValue(undefined), + } as unknown as Response); + + const api = SignInAuthErrorApi.create({ discovery: mockDiscoveryApi }); + const error = await api.getSignInAuthError(); + + expect(mockDiscoveryApi.getBaseUrl).toHaveBeenCalledWith('auth'); + expect(fetch).toHaveBeenCalledWith( + 'http://localhost:7000/api/auth/.backstage/error', + { + credentials: 'include', + }, + ); + expect(error).toBeUndefined(); + }); +}); diff --git a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts new file mode 100644 index 0000000000..1d270a953f --- /dev/null +++ b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts @@ -0,0 +1,67 @@ +/* + * Copyright 2024 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 express from 'express'; +import request from 'supertest'; +import { createCookieAuthErrorMiddleware } from './createCookieAuthErrorMiddleware'; + +const AUTH_ERROR_COOKIE = 'auth-error'; + +describe('createCookieAuthErrorMiddleware', () => { + let app: express.Express; + + beforeEach(() => { + app = express(); + app.use(express.json()); + app.use(express.urlencoded({ extended: true })); + + // Mock cookie parser middleware + app.use((req, _, next) => { + req.cookies = {}; + const cookieHeader = req.headers.cookie; + if (cookieHeader) { + const cookies = cookieHeader.split(';'); + cookies.forEach(cookie => { + const [name, ...rest] = cookie.split('='); + req.cookies[name.trim()] = decodeURIComponent(rest.join('=')); + }); + } + next(); + }); + + app.use( + createCookieAuthErrorMiddleware( + 'http://localhost:3000', + 'http://localhost:7000', + ), + ); + }); + + it('should return cookie content if error cookie exists', async () => { + const error = 'test'; + const res = await request(app) + .get('/.backstage/error') + .set('Cookie', `${AUTH_ERROR_COOKIE}=${encodeURIComponent(error)}`); + + expect(res.status).toBe(200); + expect(res.body).toEqual('test'); + }); + + it('should return 404 if error cookie does not exist', async () => { + const res = await request(app).get('/.backstage/error'); + expect(res.status).toBe(404); + }); +}); diff --git a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts index 325126d831..30724fc3cd 100644 --- a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts +++ b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts @@ -44,7 +44,7 @@ export function createCookieAuthErrorMiddleware( }); res.status(200).json(error); } else { - res.status(404); + res.status(404).end(); } }); From b73387a1118bd7b3cce712753a7820073b6d0a97 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 14:38:48 -0400 Subject: [PATCH 013/268] fix formatting Signed-off-by: Stephen Glass --- packages/core-app-api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index e68faa0b6b..6025fd5677 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -82,4 +82,4 @@ "config.d.ts" ], "configSchema": "config.d.ts" -} \ No newline at end of file +} From e4ad29ad8b4d84590b81519f5382ad7e15383e1c Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 15:16:31 -0400 Subject: [PATCH 014/268] add changeset Signed-off-by: Stephen Glass --- .changeset/violet-beds-promise.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .changeset/violet-beds-promise.md diff --git a/.changeset/violet-beds-promise.md b/.changeset/violet-beds-promise.md new file mode 100644 index 0000000000..9fa03646c4 --- /dev/null +++ b/.changeset/violet-beds-promise.md @@ -0,0 +1,17 @@ +--- +'@backstage/core-components': patch +'@backstage/core-plugin-api': patch +'@backstage/app-defaults': patch +'@backstage/core-app-api': patch +'@backstage/plugin-auth-backend': patch +'@backstage/plugin-auth-node': patch +--- + +Fix error handling using authentication redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `AuthErrorApi` and `getSignInError()` implementation. Example: + +```ts +import { useApi, authErrorApiRef } from '@backstage/core-plugin-api'; + +const authErrorApi = useApi(authErrorApiRef); +const errorResponse = await authErrorApi.getSignInAuthError(); +``` From b6591fa45a0fd23a1d713b21d11cacef64f516f8 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 15:39:29 -0400 Subject: [PATCH 015/268] update changeset Signed-off-by: Stephen Glass --- .changeset/violet-beds-promise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/violet-beds-promise.md b/.changeset/violet-beds-promise.md index 9fa03646c4..ea5f478543 100644 --- a/.changeset/violet-beds-promise.md +++ b/.changeset/violet-beds-promise.md @@ -7,7 +7,7 @@ '@backstage/plugin-auth-node': patch --- -Fix error handling using authentication redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `AuthErrorApi` and `getSignInError()` implementation. Example: +Fix error handling using authentication redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `AuthErrorApi`. Example: ```ts import { useApi, authErrorApiRef } from '@backstage/core-plugin-api'; From d576de7f9e2313270d0f9750c6169ffa9663e3d1 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 16:11:58 -0400 Subject: [PATCH 016/268] build api reports Signed-off-by: Stephen Glass --- packages/core-app-api/api-report.md | 9 +++++++++ packages/core-plugin-api/api-report.md | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index 8b8cc991c8..ae9d709c88 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -16,6 +16,7 @@ import { AppConfig } from '@backstage/config'; import { AppTheme } from '@backstage/core-plugin-api'; import { AppThemeApi } from '@backstage/core-plugin-api'; import { atlassianAuthApiRef } from '@backstage/core-plugin-api'; +import { AuthErrorApi } from '@backstage/core-plugin-api'; import { AuthProviderInfo } from '@backstage/core-plugin-api'; import { AuthRequestOptions } from '@backstage/core-plugin-api'; import { BackstageIdentityApi } from '@backstage/core-plugin-api'; @@ -635,6 +636,14 @@ export class SamlAuth signOut(): Promise; } +// @public +export class SignInAuthErrorApi implements AuthErrorApi { + // (undocumented) + static create(options: { discovery: DiscoveryApi }): SignInAuthErrorApi; + // (undocumented) + getSignInAuthError(): Promise; +} + // @public export type SignInPageProps = PropsWithChildren<{ onSignInSuccess(identityApi: IdentityApi): void; diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 134b338c92..22e254cc29 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -194,6 +194,14 @@ export function attachComponentData

( data: unknown, ): void; +// @public +export type AuthErrorApi = { + getSignInAuthError(): Promise; +}; + +// @public +export const authErrorApiRef: ApiRef; + // @public export type AuthProviderInfo = { id: string; From 7fd44657053a75b337f79c7fb41349e7e7fca9cc Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 16:39:23 -0400 Subject: [PATCH 017/268] fix createApp test case Signed-off-by: Stephen Glass --- packages/frontend-app-api/src/wiring/createApp.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/frontend-app-api/src/wiring/createApp.test.tsx b/packages/frontend-app-api/src/wiring/createApp.test.tsx index 94254a2e01..6bff2d6d10 100644 --- a/packages/frontend-app-api/src/wiring/createApp.test.tsx +++ b/packages/frontend-app-api/src/wiring/createApp.test.tsx @@ -293,6 +293,7 @@ describe('createApp', () => { + ] " `); From cf15b1f53d894e8960495cbe8265b3453e22c15d Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Mon, 29 Jul 2024 17:12:28 -0400 Subject: [PATCH 018/268] use cookie parser in test instead of mock Signed-off-by: Stephen Glass --- .../createCookieAuthErrorMiddleware.test.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts index 1d270a953f..f0c547842a 100644 --- a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts +++ b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts @@ -16,6 +16,7 @@ import express from 'express'; import request from 'supertest'; +import cookieParser from 'cookie-parser'; import { createCookieAuthErrorMiddleware } from './createCookieAuthErrorMiddleware'; const AUTH_ERROR_COOKIE = 'auth-error'; @@ -28,19 +29,7 @@ describe('createCookieAuthErrorMiddleware', () => { app.use(express.json()); app.use(express.urlencoded({ extended: true })); - // Mock cookie parser middleware - app.use((req, _, next) => { - req.cookies = {}; - const cookieHeader = req.headers.cookie; - if (cookieHeader) { - const cookies = cookieHeader.split(';'); - cookies.forEach(cookie => { - const [name, ...rest] = cookie.split('='); - req.cookies[name.trim()] = decodeURIComponent(rest.join('=')); - }); - } - next(); - }); + app.use(cookieParser()); app.use( createCookieAuthErrorMiddleware( From 32fe26a57ff6ad31f2543275967b630dd37113f3 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Thu, 1 Aug 2024 09:51:30 -0400 Subject: [PATCH 019/268] fix redirect loop using auto prop in signin component Signed-off-by: Stephen Glass --- .../core-components/src/layout/SignInPage/SignInPage.tsx | 7 +++++-- .../core-components/src/layout/SignInPage/providers.tsx | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index a0d5ec232e..932266cdc7 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -109,7 +109,10 @@ export const SingleSignInPage = ({ // displayed for a split second when the user is already logged-in. const [showLoginPage, setShowLoginPage] = useState(false); + // User was redirected back to sign in page with error from auth redirect flow const [searchParams, _setSearchParams] = useSearchParams(); + const errorParam = searchParams.get('error'); + const hasErrorSearchParam = errorParam !== 'false' && errorParam !== null; type LoginOpts = { checkExisting?: boolean; showPopup?: boolean }; const login = async ({ checkExisting, showPopup }: LoginOpts) => { @@ -123,7 +126,7 @@ export const SingleSignInPage = ({ } // If no session exists, show the sign-in page - if (!identityResponse && (showPopup || auto)) { + if (!identityResponse && (showPopup || auto) && !hasErrorSearchParam) { // Unless auto is set to true, this step should not happen. // When user intentionally clicks the Sign In button, autoShowPopup is set to true setShowLoginPage(true); @@ -158,7 +161,7 @@ export const SingleSignInPage = ({ }; const [_, { execute: checkAuthErrors }] = useAsync(async () => { - if (searchParams.get('error') !== 'false') { + if (hasErrorSearchParam) { const errorResponse = await authErrorApi.getSignInAuthError(); if (errorResponse) { setError(errorResponse); diff --git a/packages/core-components/src/layout/SignInPage/providers.tsx b/packages/core-components/src/layout/SignInPage/providers.tsx index 4b6c251e7b..1cf4ad54bf 100644 --- a/packages/core-components/src/layout/SignInPage/providers.tsx +++ b/packages/core-components/src/layout/SignInPage/providers.tsx @@ -92,10 +92,13 @@ export const useSignInProviders = ( const authErrorApi = useApi(authErrorApiRef); const [loading, setLoading] = useState(true); + // User was redirected back to sign in page with error from auth redirect flow const [searchParams, _setSearchParams] = useSearchParams(); + const errorParam = searchParams.get('error'); + const hasErrorSearchParam = errorParam !== 'false' && errorParam !== null; const [_, { execute: checkAuthErrors }] = useAsync(async () => { - if (searchParams.get('error') !== 'false') { + if (hasErrorSearchParam) { const errorResponse = await authErrorApi.getSignInAuthError(); if (errorResponse) { errorApi.post(errorResponse); From d8e6b69baeb028abb87ce1d86013d7cea12f0a4d Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Tue, 13 Aug 2024 23:43:41 -0400 Subject: [PATCH 020/268] change api auth utility to hook Signed-off-by: Stephen Glass --- packages/app-defaults/src/defaults/apis.ts | 9 --- packages/core-app-api/api-report.md | 9 --- packages/core-app-api/package.json | 1 - .../src/apis/implementations/index.ts | 1 - packages/core-components/package.json | 1 + .../src/layout/SignInPage/SignInPage.tsx | 27 ++++--- .../src/layout/SignInPage/providers.tsx | 29 +++---- packages/core-plugin-api/api-report.md | 8 -- .../src/apis/definitions/AuthErrorApi.ts | 45 ----------- .../src/apis/definitions/index.ts | 1 - plugins/auth-react/src/hooks/index.ts | 1 + .../src/hooks/useSignInAuthError/index.tsx | 2 +- .../useSignInAuthError.test.tsx | 76 ++++++++++--------- .../useSignInAuthError/useSignInAuthError.tsx | 29 ++++--- yarn.lock | 2 +- 15 files changed, 86 insertions(+), 155 deletions(-) delete mode 100644 packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts rename packages/core-app-api/src/apis/implementations/AuthErrorApi/index.ts => plugins/auth-react/src/hooks/useSignInAuthError/index.tsx (91%) rename packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.test.ts => plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx (53%) rename packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts => plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx (59%) diff --git a/packages/app-defaults/src/defaults/apis.ts b/packages/app-defaults/src/defaults/apis.ts index 84902b9f52..4e9e1a492c 100644 --- a/packages/app-defaults/src/defaults/apis.ts +++ b/packages/app-defaults/src/defaults/apis.ts @@ -35,7 +35,6 @@ import { createFetchApi, FetchMiddlewares, VMwareCloudAuth, - SignInAuthErrorApi, } from '@backstage/core-app-api'; import { @@ -59,7 +58,6 @@ import { bitbucketServerAuthApiRef, atlassianAuthApiRef, vmwareCloudAuthApiRef, - authErrorApiRef, } from '@backstage/core-plugin-api'; import { permissionApiRef, @@ -289,11 +287,4 @@ export const apis = [ factory: ({ config, discovery, identity }) => IdentityPermissionApi.create({ config, discovery, identity }), }), - createApiFactory({ - api: authErrorApiRef, - deps: { - discovery: discoveryApiRef, - }, - factory: ({ discovery }) => SignInAuthErrorApi.create({ discovery }), - }), ]; diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index ae9d709c88..8b8cc991c8 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -16,7 +16,6 @@ import { AppConfig } from '@backstage/config'; import { AppTheme } from '@backstage/core-plugin-api'; import { AppThemeApi } from '@backstage/core-plugin-api'; import { atlassianAuthApiRef } from '@backstage/core-plugin-api'; -import { AuthErrorApi } from '@backstage/core-plugin-api'; import { AuthProviderInfo } from '@backstage/core-plugin-api'; import { AuthRequestOptions } from '@backstage/core-plugin-api'; import { BackstageIdentityApi } from '@backstage/core-plugin-api'; @@ -636,14 +635,6 @@ export class SamlAuth signOut(): Promise; } -// @public -export class SignInAuthErrorApi implements AuthErrorApi { - // (undocumented) - static create(options: { discovery: DiscoveryApi }): SignInAuthErrorApi; - // (undocumented) - getSignInAuthError(): Promise; -} - // @public export type SignInPageProps = PropsWithChildren<{ onSignInSuccess(identityApi: IdentityApi): void; diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index 6025fd5677..0f78b11f98 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -44,7 +44,6 @@ "dependencies": { "@backstage/config": "workspace:^", "@backstage/core-plugin-api": "workspace:^", - "@backstage/errors": "workspace:^", "@backstage/types": "workspace:^", "@backstage/version-bridge": "workspace:^", "@types/prop-types": "^15.7.3", diff --git a/packages/core-app-api/src/apis/implementations/index.ts b/packages/core-app-api/src/apis/implementations/index.ts index 7643dfcd82..1c79d3d164 100644 --- a/packages/core-app-api/src/apis/implementations/index.ts +++ b/packages/core-app-api/src/apis/implementations/index.ts @@ -30,4 +30,3 @@ export * from './FeatureFlagsApi'; export * from './FetchApi'; export * from './OAuthRequestApi'; export * from './StorageApi'; -export * from './AuthErrorApi'; diff --git a/packages/core-components/package.json b/packages/core-components/package.json index a2688a0037..49cecfbb21 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -57,6 +57,7 @@ "@backstage/config": "workspace:^", "@backstage/core-plugin-api": "workspace:^", "@backstage/errors": "workspace:^", + "@backstage/plugin-auth-react": "workspace:^", "@backstage/theme": "workspace:^", "@backstage/version-bridge": "workspace:^", "@date-io/core": "^1.3.13", diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index 932266cdc7..d7e8d1fcf6 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -19,14 +19,13 @@ import { configApiRef, SignInPageProps, useApi, - authErrorApiRef, } from '@backstage/core-plugin-api'; import { UserIdentity } from './UserIdentity'; 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 { useAsync, useMountEffect } from '@react-hookz/web'; +import React, { useEffect, useState } from 'react'; +import { useMountEffect } from '@react-hookz/web'; import { Progress } from '../../components/Progress'; import { Content } from '../Content/Content'; import { ContentHeader } from '../ContentHeader/ContentHeader'; @@ -39,6 +38,7 @@ import { IdentityProviders, SignInProviderConfig } from './types'; import { coreComponentsTranslationRef } from '../../translation'; import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; import { useSearchParams } from 'react-router-dom'; +import { useSignInAuthError } from '@backstage/plugin-auth-react'; type MultiSignInPageProps = SignInPageProps & { providers: IdentityProviders; @@ -99,7 +99,7 @@ export const SingleSignInPage = ({ const classes = useStyles(); const authApi = useApi(provider.apiRef); const configApi = useApi(configApiRef); - const authErrorApi = useApi(authErrorApiRef); + const { error: signInError, checkAuthError } = useSignInAuthError(); const { t } = useTranslationRef(coreComponentsTranslationRef); const [error, setError] = useState(); @@ -160,20 +160,19 @@ export const SingleSignInPage = ({ } }; - const [_, { execute: checkAuthErrors }] = useAsync(async () => { - if (hasErrorSearchParam) { - const errorResponse = await authErrorApi.getSignInAuthError(); - if (errorResponse) { - setError(errorResponse); - } - } - }); - useMountEffect(() => { - checkAuthErrors(); + if (hasErrorSearchParam) { + checkAuthError(); + } login({ checkExisting: true }); }); + useEffect(() => { + if (signInError) { + setError(signInError); + } + }, [signInError]); + return showLoginPage ? (

diff --git a/packages/core-components/src/layout/SignInPage/providers.tsx b/packages/core-components/src/layout/SignInPage/providers.tsx index 1cf4ad54bf..8d34d8d9de 100644 --- a/packages/core-components/src/layout/SignInPage/providers.tsx +++ b/packages/core-components/src/layout/SignInPage/providers.tsx @@ -14,14 +14,19 @@ * limitations under the License. */ -import React, { useLayoutEffect, useState, useMemo, useCallback } from 'react'; +import React, { + useLayoutEffect, + useState, + useMemo, + useCallback, + useEffect, +} from 'react'; import { SignInPageProps, useApi, useApiHolder, errorApiRef, IdentityApi, - authErrorApiRef, } from '@backstage/core-plugin-api'; import { IdentityProviders, @@ -33,7 +38,8 @@ import { guestProvider } from './guestProvider'; import { customProvider } from './customProvider'; import { IdentityApiSignOutProxy } from './IdentityApiSignOutProxy'; import { useSearchParams } from 'react-router-dom'; -import { useMountEffect, useAsync } from '@react-hookz/web'; +import { useMountEffect } from '@react-hookz/web'; +import { useSignInAuthError } from '@backstage/plugin-auth-react'; const PROVIDER_STORAGE_KEY = '@backstage/core:SignInPage:provider'; @@ -89,7 +95,7 @@ export const useSignInProviders = ( ) => { const errorApi = useApi(errorApiRef); const apiHolder = useApiHolder(); - const authErrorApi = useApi(authErrorApiRef); + const { error: signInError, checkAuthError } = useSignInAuthError(); const [loading, setLoading] = useState(true); // User was redirected back to sign in page with error from auth redirect flow @@ -97,16 +103,13 @@ export const useSignInProviders = ( const errorParam = searchParams.get('error'); const hasErrorSearchParam = errorParam !== 'false' && errorParam !== null; - const [_, { execute: checkAuthErrors }] = useAsync(async () => { - if (hasErrorSearchParam) { - const errorResponse = await authErrorApi.getSignInAuthError(); - if (errorResponse) { - errorApi.post(errorResponse); - } - } - }); + useMountEffect(() => hasErrorSearchParam && checkAuthError()); - useMountEffect(checkAuthErrors); + useEffect(() => { + if (signInError) { + errorApi.post(signInError); + } + }, [errorApi, signInError]); // This decorates the result with sign out logic from this hook const handleWrappedResult = useCallback( diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 22e254cc29..134b338c92 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -194,14 +194,6 @@ export function attachComponentData

( data: unknown, ): void; -// @public -export type AuthErrorApi = { - getSignInAuthError(): Promise; -}; - -// @public -export const authErrorApiRef: ApiRef; - // @public export type AuthProviderInfo = { id: string; diff --git a/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts b/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts deleted file mode 100644 index 558c1202a8..0000000000 --- a/packages/core-plugin-api/src/apis/definitions/AuthErrorApi.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2024 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 { ApiRef, createApiRef } from '../system'; - -/** - * A wrapper for retrieving any errors caught in authentication redirect flow - * - * @public - */ -export type AuthErrorApi = { - /** - * Get any caught errors during the auth redirect flow - */ - getSignInAuthError(): Promise; -}; - -/** - * The {@link ApiRef} of {@link AuthErrorApi}. - * - * @remarks - * - * This is a wrapper that uses fetch to retrieve any caught errors - * in the authentication redirect flow process. This API calls a - * Backstage endpoint to read any error stored in authentication error - * cookie and returns it to the user. - * - * @public - */ -export const authErrorApiRef: ApiRef = createApiRef({ - id: 'core.auth-error', -}); diff --git a/packages/core-plugin-api/src/apis/definitions/index.ts b/packages/core-plugin-api/src/apis/definitions/index.ts index 406dc1980e..67d442587d 100644 --- a/packages/core-plugin-api/src/apis/definitions/index.ts +++ b/packages/core-plugin-api/src/apis/definitions/index.ts @@ -33,4 +33,3 @@ export * from './FetchApi'; export * from './IdentityApi'; export * from './OAuthRequestApi'; export * from './StorageApi'; -export * from './AuthErrorApi'; diff --git a/plugins/auth-react/src/hooks/index.ts b/plugins/auth-react/src/hooks/index.ts index 1257334498..0e87bab67f 100644 --- a/plugins/auth-react/src/hooks/index.ts +++ b/plugins/auth-react/src/hooks/index.ts @@ -18,3 +18,4 @@ // which hooks are public API and should be exported from the package. export * from './useCookieAuthRefresh'; +export * from './useSignInAuthError'; diff --git a/packages/core-app-api/src/apis/implementations/AuthErrorApi/index.ts b/plugins/auth-react/src/hooks/useSignInAuthError/index.tsx similarity index 91% rename from packages/core-app-api/src/apis/implementations/AuthErrorApi/index.ts rename to plugins/auth-react/src/hooks/useSignInAuthError/index.tsx index 6f3a3ae269..549b5b9f1f 100644 --- a/packages/core-app-api/src/apis/implementations/AuthErrorApi/index.ts +++ b/plugins/auth-react/src/hooks/useSignInAuthError/index.tsx @@ -14,4 +14,4 @@ * limitations under the License. */ -export { SignInAuthErrorApi } from './SignInAuthErrorApi'; +export { useSignInAuthError } from './useSignInAuthError'; diff --git a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.test.ts b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx similarity index 53% rename from packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.test.ts rename to plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx index c4d6fe83de..a5ac57ec83 100644 --- a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.test.ts +++ b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx @@ -14,29 +14,20 @@ * limitations under the License. */ -import { DiscoveryApi } from '@backstage/core-plugin-api'; +import React from 'react'; +import { act, renderHook } from '@testing-library/react'; +import { discoveryApiRef } from '@backstage/core-plugin-api'; +import { TestApiProvider } from '@backstage/test-utils'; +import { useSignInAuthError } from './useSignInAuthError'; import { serializeError } from '@backstage/errors'; -import { SignInAuthErrorApi } from './SignInAuthErrorApi'; -describe('SignInAuthErrorApi', () => { - const mockDiscoveryApi = { - getBaseUrl: jest.fn(), - } as unknown as jest.Mocked; +describe('useCookieAuthRefresh', () => { + const discoveryApiMock = { + getBaseUrl: jest.fn().mockResolvedValue('http://localhost:7000/api/auth'), + }; beforeEach(() => { - jest.resetAllMocks(); - }); - - it('should create an instance of SignInAuthErrorApi', async () => { - const api = SignInAuthErrorApi.create({ - discovery: mockDiscoveryApi, - }); - - mockDiscoveryApi.getBaseUrl.mockResolvedValue( - 'http://localhost:7007/api/auth', - ); - - expect(api).toBeInstanceOf(SignInAuthErrorApi); + jest.clearAllMocks(); }); it('should return an error when the cookie returns an error object', async () => { @@ -45,50 +36,63 @@ describe('SignInAuthErrorApi', () => { message: 'This is a test error', }; const serializedError = serializeError(errorObject); - mockDiscoveryApi.getBaseUrl.mockResolvedValue( - 'http://localhost:7000/api/auth', - ); global.fetch = jest.fn().mockResolvedValue({ ok: true, json: jest.fn().mockResolvedValue(serializedError), } as unknown as Response); - const api = SignInAuthErrorApi.create({ discovery: mockDiscoveryApi }); - const error = await api.getSignInAuthError(); + const { result } = renderHook(() => useSignInAuthError(), { + wrapper: ({ children }) => ( + + {children} + + ), + }); - expect(mockDiscoveryApi.getBaseUrl).toHaveBeenCalledWith('auth'); + await act(async () => { + result.current.checkAuthError(); + }); + + expect(discoveryApiMock.getBaseUrl).toHaveBeenCalledWith('auth'); expect(fetch).toHaveBeenCalledWith( 'http://localhost:7000/api/auth/.backstage/error', { credentials: 'include', }, ); - expect(error).toBeInstanceOf(Error); - expect((error as Error).name).toEqual(errorObject.name); - expect((error as Error).message).toEqual(errorObject.message); + expect(result.current.error).toBeInstanceOf(Error); + expect((result.current.error as Error).name).toEqual(errorObject.name); + expect((result.current.error as Error).message).toEqual( + errorObject.message, + ); }); it('should return undefined when the backend does not return an error object', async () => { - mockDiscoveryApi.getBaseUrl.mockResolvedValue( - 'http://localhost:7000/api/auth', - ); - global.fetch = jest.fn().mockResolvedValue({ ok: true, json: jest.fn().mockResolvedValue(undefined), } as unknown as Response); - const api = SignInAuthErrorApi.create({ discovery: mockDiscoveryApi }); - const error = await api.getSignInAuthError(); + const { result } = renderHook(() => useSignInAuthError(), { + wrapper: ({ children }) => ( + + {children} + + ), + }); - expect(mockDiscoveryApi.getBaseUrl).toHaveBeenCalledWith('auth'); + await act(async () => { + result.current.checkAuthError(); + }); + + expect(discoveryApiMock.getBaseUrl).toHaveBeenCalledWith('auth'); expect(fetch).toHaveBeenCalledWith( 'http://localhost:7000/api/auth/.backstage/error', { credentials: 'include', }, ); - expect(error).toBeUndefined(); + expect(result.current.error).toBeUndefined(); }); }); diff --git a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx similarity index 59% rename from packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts rename to plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx index 77b3c53f14..8d4af1f555 100644 --- a/packages/core-app-api/src/apis/implementations/AuthErrorApi/SignInAuthErrorApi.ts +++ b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx @@ -14,25 +14,20 @@ * limitations under the License. */ -import { DiscoveryApi, AuthErrorApi } from '@backstage/core-plugin-api'; +import { discoveryApiRef, useApi } from '@backstage/core-plugin-api'; +import { useAsync } from '@react-hookz/web'; import { deserializeError } from '@backstage/errors'; -/** - * The default implementation of the AuthErrorApi, which simply calls auth error endpoint. - * @public - */ -export class SignInAuthErrorApi implements AuthErrorApi { - private constructor(private readonly discoveryApi: DiscoveryApi) {} +export function useSignInAuthError(): { + error: Error | undefined; + checkAuthError: () => void; +} { + const discoveryApi = useApi(discoveryApiRef); - static create(options: { discovery: DiscoveryApi }) { - const { discovery } = options; - return new SignInAuthErrorApi(discovery); - } + const [state, { execute: checkAuthError }] = useAsync(async () => { + const baseUrl = await discoveryApi.getBaseUrl('auth'); - async getSignInAuthError(): Promise { - const baseUrl = await this.discoveryApi.getBaseUrl('auth'); - - // use native fetch instead of depending on fetchApi because + // use native fetch instead of fetchApi because // we are not signed in and are calling an unauthenticated endpoint const response = await fetch(`${baseUrl}/.backstage/error`, { credentials: 'include', @@ -40,5 +35,7 @@ export class SignInAuthErrorApi implements AuthErrorApi { const data = await response.json(); return data ? deserializeError(data) : undefined; - } + }); + + return { error: state.result, checkAuthError }; } diff --git a/yarn.lock b/yarn.lock index cb41faa20f..dfd1cffd9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4123,7 +4123,6 @@ __metadata: "@backstage/cli": "workspace:^" "@backstage/config": "workspace:^" "@backstage/core-plugin-api": "workspace:^" - "@backstage/errors": "workspace:^" "@backstage/test-utils": "workspace:^" "@backstage/types": "workspace:^" "@backstage/version-bridge": "workspace:^" @@ -4288,6 +4287,7 @@ __metadata: "@backstage/core-app-api": "workspace:^" "@backstage/core-plugin-api": "workspace:^" "@backstage/errors": "workspace:^" + "@backstage/plugin-auth-react": "workspace:^" "@backstage/test-utils": "workspace:^" "@backstage/theme": "workspace:^" "@backstage/version-bridge": "workspace:^" From d2757e9ca02152d1506d27c012019b7c9edb0651 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Tue, 13 Aug 2024 23:44:14 -0400 Subject: [PATCH 021/268] update test Signed-off-by: Stephen Glass --- packages/frontend-app-api/src/wiring/createApp.test.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/frontend-app-api/src/wiring/createApp.test.tsx b/packages/frontend-app-api/src/wiring/createApp.test.tsx index 6bff2d6d10..94254a2e01 100644 --- a/packages/frontend-app-api/src/wiring/createApp.test.tsx +++ b/packages/frontend-app-api/src/wiring/createApp.test.tsx @@ -293,7 +293,6 @@ describe('createApp', () => { - ] " `); From f82952433fdb8e98eaa943a6ccc173a92e8f39e8 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Tue, 13 Aug 2024 23:52:51 -0400 Subject: [PATCH 022/268] update changeset Signed-off-by: Stephen Glass --- .changeset/violet-beds-promise.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.changeset/violet-beds-promise.md b/.changeset/violet-beds-promise.md index ea5f478543..5fd4890ffa 100644 --- a/.changeset/violet-beds-promise.md +++ b/.changeset/violet-beds-promise.md @@ -1,17 +1,14 @@ --- '@backstage/core-components': patch -'@backstage/core-plugin-api': patch -'@backstage/app-defaults': patch -'@backstage/core-app-api': patch '@backstage/plugin-auth-backend': patch '@backstage/plugin-auth-node': patch +'@backstage/plugin-auth-react': patch --- -Fix error handling using authentication redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `AuthErrorApi`. Example: +Fix error handling using authentication redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `useSignInAuthError` hook.: ```ts -import { useApi, authErrorApiRef } from '@backstage/core-plugin-api'; +import { useSignInAuthError } from '@backstage/plugin-auth-react'; -const authErrorApi = useApi(authErrorApiRef); -const errorResponse = await authErrorApi.getSignInAuthError(); +const { error, checkAuthError } = useSignInAuthError(); ``` From 2ae5f4b2f72a729b61b51698c9693dc810f93da4 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Wed, 14 Aug 2024 00:11:46 -0400 Subject: [PATCH 023/268] api report Signed-off-by: Stephen Glass --- plugins/auth-react/api-report.md | 6 ++++++ .../src/hooks/useSignInAuthError/useSignInAuthError.tsx | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/plugins/auth-react/api-report.md b/plugins/auth-react/api-report.md index d5206261d2..52e6c6bc3a 100644 --- a/plugins/auth-react/api-report.md +++ b/plugins/auth-react/api-report.md @@ -36,4 +36,10 @@ export function useCookieAuthRefresh(options: { pluginId: string }): expiresAt: string; }; }; + +// @public +export function useSignInAuthError(): { + error: Error | undefined; + checkAuthError: () => void; +}; ``` diff --git a/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx index 8d4af1f555..fe146fedca 100644 --- a/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx +++ b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx @@ -18,6 +18,10 @@ import { discoveryApiRef, useApi } from '@backstage/core-plugin-api'; import { useAsync } from '@react-hookz/web'; import { deserializeError } from '@backstage/errors'; +/** + * @public + * A hook that will fetch any sign in auth error in redirect auth flow + */ export function useSignInAuthError(): { error: Error | undefined; checkAuthError: () => void; From 823484ba62297a701bc0eb769003c5e492da91c4 Mon Sep 17 00:00:00 2001 From: JounQin Date: Fri, 9 Aug 2024 01:07:39 +0800 Subject: [PATCH 024/268] feat: experimentally support using rspack instead close #21682 Signed-off-by: JounQin --- packages/cli/package.json | 15 + .../cli/src/commands/build/buildFrontend.ts | 4 +- packages/cli/src/commands/build/command.ts | 4 + packages/cli/src/lib/bundler/bundle.ts | 16 +- packages/cli/src/lib/bundler/config.ts | 160 ++++--- packages/cli/src/lib/bundler/optimization.ts | 24 +- packages/cli/src/lib/bundler/server.ts | 14 +- packages/cli/src/lib/bundler/transforms.ts | 23 +- packages/cli/src/lib/bundler/types.ts | 3 + yarn.lock | 447 +++++++++++++++--- 10 files changed, 565 insertions(+), 145 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index de38b0c656..e2726f358a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -166,6 +166,9 @@ "@backstage/dev-utils": "workspace:^", "@backstage/test-utils": "workspace:^", "@backstage/theme": "workspace:^", + "@rspack/core": "^0.7.5", + "@rspack/dev-server": "^0.7.5", + "@rspack/plugin-react-refresh": "^0.7.5", "@types/cross-spawn": "^6.0.2", "@types/diff": "^5.0.0", "@types/ejs": "^3.1.3", @@ -191,12 +194,24 @@ "vite-plugin-node-polyfills": "^0.22.0" }, "peerDependencies": { + "@rspack/core": "^0.7.5", + "@rspack/dev-server": "^0.7.5", + "@rspack/plugin-react-refresh": "^0.7.5", "@vitejs/plugin-react": "^4.0.4", "vite": "^4.4.9", "vite-plugin-html": "^3.2.0", "vite-plugin-node-polyfills": "^0.22.0" }, "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "@rspack/dev-server": { + "optional": true + }, + "@rspack/plugin-react-refresh": { + "optional": true + }, "@vitejs/plugin-react": { "optional": true }, diff --git a/packages/cli/src/commands/build/buildFrontend.ts b/packages/cli/src/commands/build/buildFrontend.ts index f29e0bdd38..5cb6d3b526 100644 --- a/packages/cli/src/commands/build/buildFrontend.ts +++ b/packages/cli/src/commands/build/buildFrontend.ts @@ -25,10 +25,11 @@ interface BuildAppOptions { writeStats: boolean; configPaths: string[]; isModuleFederationRemote?: true; + useRspack?: boolean; } export async function buildFrontend(options: BuildAppOptions) { - const { targetDir, writeStats, configPaths } = options; + const { targetDir, writeStats, configPaths, useRspack } = options; const { name } = await fs.readJson(resolvePath(targetDir, 'package.json')); await buildBundle({ @@ -44,5 +45,6 @@ export async function buildFrontend(options: BuildAppOptions) { args: configPaths, fromPackage: name, })), + useRspack, }); } diff --git a/packages/cli/src/commands/build/command.ts b/packages/cli/src/commands/build/command.ts index c0ad3c912b..4f99ec6a00 100644 --- a/packages/cli/src/commands/build/command.ts +++ b/packages/cli/src/commands/build/command.ts @@ -25,6 +25,8 @@ import { isValidUrl } from '../../lib/urls'; import chalk from 'chalk'; export async function command(opts: OptionValues): Promise { + const useRspack = !!process.env.EXPERIMENTAL_RSPACK; + const role = await findRoleFromCommand(opts); if (role === 'frontend' || role === 'backend') { @@ -40,6 +42,7 @@ export async function command(opts: OptionValues): Promise { targetDir: paths.targetDir, configPaths, writeStats: Boolean(opts.stats), + useRspack, }); } return buildBackend({ @@ -62,6 +65,7 @@ export async function command(opts: OptionValues): Promise { configPaths: [], writeStats: Boolean(opts.stats), isModuleFederationRemote: true, + useRspack, }); } diff --git a/packages/cli/src/lib/bundler/bundle.ts b/packages/cli/src/lib/bundler/bundle.ts index 0aa91a90a6..0a36f54053 100644 --- a/packages/cli/src/lib/bundler/bundle.ts +++ b/packages/cli/src/lib/bundler/bundle.ts @@ -38,7 +38,7 @@ function applyContextToError(error: string, moduleName: string): string { } export async function buildBundle(options: BuildOptions) { - const { statsJsonEnabled, schema: configSchema } = options; + const { statsJsonEnabled, schema: configSchema, useRspack } = options; const paths = resolveBundlingPaths(options); const publicPaths = await resolveOptionalBundlingPaths({ @@ -54,7 +54,7 @@ export async function buildBundle(options: BuildOptions) { getFrontendAppConfigs: () => options.frontendAppConfigs, }; - const configs = []; + const configs: webpack.Configuration[] = []; if (options.moduleFederation?.mode === 'remote') { // Package detection is disabled for remote bundles @@ -119,7 +119,7 @@ export async function buildBundle(options: BuildOptions) { ); } - const { stats } = await build(configs, isCi); + const { stats } = await build(configs, isCi, useRspack); if (!stats) { throw new Error('No stats returned'); @@ -152,10 +152,16 @@ export async function buildBundle(options: BuildOptions) { } } -async function build(configs: webpack.Configuration[], isCi: boolean) { +async function build( + configs: webpack.Configuration[], + isCi: boolean, + useRspack?: boolean, +) { + const bundler: typeof webpack = useRspack ? require('@rspack/core') : webpack; + const stats = await new Promise( (resolve, reject) => { - webpack(configs, (err, buildStats) => { + bundler(configs, (err, buildStats) => { if (err) { if (err.message) { const { errors } = formatWebpackMessages({ diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index da7b378fbd..69c673b833 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -21,7 +21,7 @@ import { } from './types'; import { posix as posixPath, resolve as resolvePath, dirname } from 'path'; import chalk from 'chalk'; -import webpack, { ProvidePlugin } from 'webpack'; +import webpack from 'webpack'; import { BackstagePackage } from '@backstage/cli-node'; import { BundlingPaths } from './paths'; @@ -132,6 +132,7 @@ export async function createConfig( frontendConfig, moduleFederation, publicSubPath = '', + useRspack, } = options; const { plugins, loaders } = transforms(options); @@ -152,15 +153,20 @@ export async function createConfig( options.moduleFederation, ); - plugins.push( - new ReactRefreshPlugin({ - overlay: { - sockProtocol: 'ws', - sockHost: host, - sockPort: port, - }, - }), - ); + if (useRspack) { + const RspackReactRefreshPlugin = require('@rspack/plugin-react-refresh'); + plugins.push(new RspackReactRefreshPlugin()); + } else { + plugins.push( + new ReactRefreshPlugin({ + overlay: { + sockProtocol: 'ws', + sockHost: host, + sockPort: port, + }, + }), + ); + } } if (checksEnabled) { @@ -175,18 +181,24 @@ export async function createConfig( ); } + const rspack = useRspack + ? (require('@rspack/core') as typeof import('@rspack/core').rspack) + : undefined; + const bundler = useRspack ? (rspack as unknown as typeof webpack) : webpack; + // TODO(blam): process is no longer auto polyfilled by webpack in v5. // we use the provide plugin to provide this polyfill, but lets look // to remove this eventually! plugins.push( - new ProvidePlugin({ - process: require.resolve('process/browser'), + new bundler.ProvidePlugin({ + process: require.resolve('process/browser'),, Buffer: ['buffer', 'Buffer'], }), ); if (options.moduleFederation?.mode !== 'remote') { plugins.push( + // `rspack.HtmlRspackPlugin` does not support object type `templateParameters` value, `frontendConfig` in this case new HtmlWebpackPlugin({ meta: { 'backstage-app-mode': options?.appMode ?? 'public', @@ -203,8 +215,13 @@ export async function createConfig( if (options.moduleFederation) { const isRemote = options.moduleFederation?.mode === 'remote'; + const AdaptedModuleFederationPlugin = useRspack + ? (rspack!.container + .ModuleFederationPlugin as unknown as typeof ModuleFederationPlugin) + : ModuleFederationPlugin; + plugins.push( - new ModuleFederationPlugin({ + new AdaptedModuleFederationPlugin({ ...(isRemote && { filename: 'remoteEntry.js', exposes: { @@ -264,13 +281,17 @@ export async function createConfig( } const buildInfo = await readBuildInfo(); + plugins.push( - new webpack.DefinePlugin({ + new bundler.DefinePlugin({ 'process.env.BUILD_INFO': JSON.stringify(buildInfo), - 'process.env.APP_CONFIG': webpack.DefinePlugin.runtimeValue( - () => JSON.stringify(options.getFrontendAppConfigs()), - true, - ), + 'process.env.APP_CONFIG': useRspack + ? // FIXME: see also https://github.com/web-infra-dev/rspack/issues/5606 + JSON.stringify(options.getFrontendAppConfigs()) + : bundler.DefinePlugin.runtimeValue( + () => JSON.stringify(options.getFrontendAppConfigs()), + true, + ), // This allows for conditional imports of react-dom/client, since there's no way // to check for presence of it in source code without module resolution errors. 'process.env.HAS_REACT_DOM_CLIENT': JSON.stringify(hasReactDomClient()), @@ -280,13 +301,17 @@ export async function createConfig( // These files are required by the transpiled code when using React Refresh. // They need to be excluded to the module scope plugin which ensures that files // that exist in the package are required. - const reactRefreshFiles = [ - require.resolve( - '@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js', - ), - require.resolve('@pmmmwh/react-refresh-webpack-plugin/overlay/index.js'), - require.resolve('react-refresh'), - ]; + const reactRefreshFiles = useRspack + ? [] + : [ + require.resolve( + '@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js', + ), + require.resolve( + '@pmmmwh/react-refresh-webpack-plugin/overlay/index.js', + ), + require.resolve('react-refresh'), + ]; const mode = isDev ? 'development' : 'production'; const optimization = optimizationConfig(options); @@ -315,16 +340,19 @@ export async function createConfig( // Instead, provide a custom definition which always uses "development" if // the module is part of `react` or `react-dom`, and `config.mode` otherwise. plugins.push( - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': webpack.DefinePlugin.runtimeValue( - ({ module }) => { - if (reactPackageDirs.some(val => module.resource.startsWith(val))) { - return '"development"'; - } + new bundler.DefinePlugin({ + 'process.env.NODE_ENV': useRspack + ? // FIXME: see also https://github.com/web-infra-dev/rspack/issues/5606 + JSON.stringify(mode) + : webpack.DefinePlugin.runtimeValue(({ module }) => { + if ( + reactPackageDirs.some(val => module.resource.startsWith(val)) + ) { + return '"development"'; + } - return `"${mode}"`; - }, - ), + return `"${mode}"`; + }), }), ); } @@ -362,13 +390,16 @@ export async function createConfig( http: false, util: require.resolve('util/'), }, - plugins: [ - new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), - new ModuleScopePlugin( - [paths.targetSrc, paths.targetDev], - [paths.targetPackageJson, ...reactRefreshFiles], - ), - ], + // FIXME: see also https://github.com/web-infra-dev/rspack/issues/3408 + ...(!useRspack && { + plugins: [ + new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), + new ModuleScopePlugin( + [paths.targetSrc, paths.targetDev], + [paths.targetPackageJson, ...reactRefreshFiles], + ), + ], + }), }, module: { rules: loaders, @@ -396,16 +427,20 @@ export async function createConfig( lazyCompilation: yn(process.env.EXPERIMENTAL_LAZY_COMPILATION), }, plugins, - ...(withCache - ? { - cache: { - type: 'filesystem', - buildDependencies: { - config: [__filename], - }, - }, - } - : {}), + ...(withCache && { + cache: { + type: 'filesystem', + buildDependencies: { + config: [__filename], + }, + }, + }), + ...(useRspack && { + // We're still using `style-loader` for custom `insert` option + experiments: { + css: false, + }, + }), }; } @@ -413,7 +448,7 @@ export async function createBackendConfig( paths: BundlingPaths, options: BackendBundlingOptions, ): Promise { - const { checksEnabled, isDev } = options; + const { checksEnabled, isDev, useRspack } = options; // Find all local monorepo packages and their node_modules, and mark them as external. const { packages } = await getPackages(cliPaths.targetDir); @@ -484,13 +519,16 @@ export async function createBackendConfig( extensions: ['.ts', '.mjs', '.js', '.json'], mainFields: ['main'], modules: [paths.rootNodeModules, ...moduleDirs], - plugins: [ - new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), - new ModuleScopePlugin( - [paths.targetSrc, paths.targetDev], - [paths.targetPackageJson], - ), - ], + // FIXME: see also https://github.com/web-infra-dev/rspack/issues/3408 + ...(!useRspack && { + plugins: [ + new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), + new ModuleScopePlugin( + [paths.targetSrc, paths.targetDev], + [paths.targetPackageJson], + ), + ], + }), }, module: { rules: loaders, @@ -517,7 +555,9 @@ export async function createBackendConfig( nodeArgs: runScriptNodeArgs.length > 0 ? runScriptNodeArgs : undefined, args: process.argv.slice(3), // drop `node backstage-cli backend:dev` }), - new webpack.HotModuleReplacementPlugin(), + new (useRspack + ? require('@rspack/core').rspack.HotModuleReplacementPlugin + : webpack.HotModuleReplacementPlugin)(), ...(checksEnabled ? [ new ForkTsCheckerWebpackPlugin({ diff --git a/packages/cli/src/lib/bundler/optimization.ts b/packages/cli/src/lib/bundler/optimization.ts index cf240b4791..1cef6b6205 100644 --- a/packages/cli/src/lib/bundler/optimization.ts +++ b/packages/cli/src/lib/bundler/optimization.ts @@ -22,22 +22,35 @@ const { EsbuildPlugin } = require('esbuild-loader'); export const optimization = ( options: BundlingOptions, ): WebpackOptionsNormalized['optimization'] => { - const { isDev } = options; + const { isDev, useRspack } = options; + + const extralOptions = useRspack + ? {} + : { maxAsyncRequests: Infinity, maxInitialRequests: Infinity }; + + const rspack = useRspack + ? (require('@rspack/core') as typeof import('@rspack/core').rspack) + : undefined; + + const MinifyPlugin = useRspack + ? rspack!.SwcJsMinimizerRspackPlugin + : EsbuildPlugin; return { minimize: !isDev, minimizer: [ - new EsbuildPlugin({ + new MinifyPlugin({ target: 'ES2022', format: 'iife', exclude: 'remoteEntry.js', }), // Avoid iife wrapping of module federation remote entry as it breaks the variable assignment - new EsbuildPlugin({ + new MinifyPlugin({ target: 'ES2022', format: undefined, include: 'remoteEntry.js', }), + useRspack && new rspack!.LightningCssMinimizerRspackPlugin(), ], runtimeChunk: 'single', splitChunks: { @@ -69,9 +82,8 @@ export const optimization = ( priority: 10, minSize: 100000, minChunks: 1, - maxAsyncRequests: Infinity, - maxInitialRequests: Infinity, - } as any, // filename is not included in type, but we need it + ...extralOptions, + }, // filename is not included in type, but we need it // Group together the smallest modules vendor: { chunks: 'initial', diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index 259f3263eb..25d3cbe321 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -106,12 +106,15 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be }, }); + const useRspack = !!process.env.EXPERIMENTAL_RSPACK; + const commonConfigOptions = { ...options, checksEnabled: options.checksEnabled, isDev: true, baseUrl: url, frontendConfig, + useRspack, getFrontendAppConfigs: () => { return latestFrontendAppConfigs; }, @@ -163,6 +166,11 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be root: paths.targetPath, }); } else { + const bundler = useRspack ? require('@rspack/core') : webpack; + const DevServer: typeof WebpackDevServer = useRspack + ? require('@rspack/dev-server').RspackDevServer + : WebpackDevServer; + const publicPaths = await resolveOptionalBundlingPaths({ entry: 'src/index-public-experimental', dist: 'dist/public', @@ -175,10 +183,10 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be ); } const compiler = publicPaths - ? webpack([config, await createConfig(publicPaths, commonConfigOptions)]) - : webpack(config); + ? bundler([config, await createConfig(publicPaths, commonConfigOptions)]) + : bundler(config); - webpackServer = new WebpackDevServer( + webpackServer = new DevServer( { hot: !process.env.CI, devMiddleware: { diff --git a/packages/cli/src/lib/bundler/transforms.ts b/packages/cli/src/lib/bundler/transforms.ts index 302b2fbe68..a6a49895ef 100644 --- a/packages/cli/src/lib/bundler/transforms.ts +++ b/packages/cli/src/lib/bundler/transforms.ts @@ -26,10 +26,15 @@ type Transforms = { type TransformOptions = { isDev: boolean; isBackend?: boolean; + useRspack?: boolean; }; export const transforms = (options: TransformOptions): Transforms => { - const { isDev, isBackend } = options; + const { isDev, isBackend, useRspack } = options; + + const CssExtractRspackPlugin: typeof MiniCssExtractPlugin = useRspack + ? require('@rspack/core').CssExtractRspackPlugin + : MiniCssExtractPlugin; // This ensures that styles inserted from the style-loader and any // async style chunks are always given lower priority than JSS styles. @@ -54,7 +59,9 @@ export const transforms = (options: TransformOptions): Transforms => { exclude: /node_modules/, use: [ { - loader: require.resolve('swc-loader'), + loader: useRspack + ? 'builtin:swc-loader' + : require.resolve('swc-loader'), options: { jsc: { target: 'es2022', @@ -82,7 +89,9 @@ export const transforms = (options: TransformOptions): Transforms => { exclude: /node_modules/, use: [ { - loader: require.resolve('swc-loader'), + loader: useRspack + ? 'builtin:swc-loader' + : require.resolve('swc-loader'), options: { jsc: { target: 'es2022', @@ -115,7 +124,9 @@ export const transforms = (options: TransformOptions): Transforms => { test: [/\.icon\.svg$/], use: [ { - loader: require.resolve('swc-loader'), + loader: useRspack + ? 'builtin:swc-loader' + : require.resolve('swc-loader'), options: { jsc: { target: 'es2022', @@ -179,7 +190,7 @@ export const transforms = (options: TransformOptions): Transforms => { insert: insertBeforeJssStyles, }, } - : MiniCssExtractPlugin.loader, + : CssExtractRspackPlugin.loader, { loader: require.resolve('css-loader'), options: { @@ -194,7 +205,7 @@ export const transforms = (options: TransformOptions): Transforms => { if (!isDev) { plugins.push( - new MiniCssExtractPlugin({ + new CssExtractRspackPlugin({ filename: 'static/[name].[contenthash:8].css', chunkFilename: 'static/[name].[id].[contenthash:8].css', insert: insertBeforeJssStyles, // Only applies to async chunks diff --git a/packages/cli/src/lib/bundler/types.ts b/packages/cli/src/lib/bundler/types.ts index f8e228c5c4..8b48976f9b 100644 --- a/packages/cli/src/lib/bundler/types.ts +++ b/packages/cli/src/lib/bundler/types.ts @@ -37,6 +37,7 @@ export type BundlingOptions = { // Mode that the app is running in, 'protected' or 'public', default is 'public' appMode?: string; moduleFederation?: ModuleFederationOptions; + useRspack?: boolean; }; export type ServeOptions = BundlingPathsOptions & { @@ -57,6 +58,7 @@ export type BuildOptions = BundlingPathsOptions & { frontendAppConfigs: AppConfig[]; fullConfig: Config; moduleFederation?: ModuleFederationOptions; + useRspack?: boolean; }; export type BackendBundlingOptions = { @@ -66,6 +68,7 @@ export type BackendBundlingOptions = { inspectEnabled: boolean; inspectBrkEnabled: boolean; require?: string; + useRspack?: boolean; }; export type BackendServeOptions = BundlingPathsOptions & { diff --git a/yarn.lock b/yarn.lock index 9c292f5903..7222777537 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3958,6 +3958,9 @@ __metadata: "@rollup/plugin-json": ^6.0.0 "@rollup/plugin-node-resolve": ^15.0.0 "@rollup/plugin-yaml": ^4.0.0 + "@rspack/core": ^0.7.5 + "@rspack/dev-server": ^0.7.5 + "@rspack/plugin-react-refresh": ^0.7.5 "@spotify/eslint-config-base": ^15.0.0 "@spotify/eslint-config-react": ^15.0.0 "@spotify/eslint-config-typescript": ^15.0.0 @@ -4073,11 +4076,20 @@ __metadata: yn: ^4.0.0 zod: ^3.22.4 peerDependencies: + "@rspack/core": ^0.7.5 + "@rspack/dev-server": ^0.7.5 + "@rspack/plugin-react-refresh": ^0.7.5 "@vitejs/plugin-react": ^4.0.4 vite: ^4.4.9 vite-plugin-html: ^3.2.0 vite-plugin-node-polyfills: ^0.22.0 peerDependenciesMeta: + "@rspack/core": + optional: true + "@rspack/dev-server": + optional: true + "@rspack/plugin-react-refresh": + optional: true "@vitejs/plugin-react": optional: true vite: @@ -11270,6 +11282,16 @@ __metadata: languageName: node linkType: hard +"@module-federation/runtime-tools@npm:0.1.6": + version: 0.1.6 + resolution: "@module-federation/runtime-tools@npm:0.1.6" + dependencies: + "@module-federation/runtime": 0.1.6 + "@module-federation/webpack-bundler-runtime": 0.1.6 + checksum: a902fe7fd07707be566fec6620c71d597311cee02cc2c2605b9b796f9aad07fcc3c60939efb2e139b01b28ac599d610f5dbc054c555915cd9e5fcc9324598413 + languageName: node + linkType: hard + "@module-federation/runtime-tools@npm:0.3.5": version: 0.3.5 resolution: "@module-federation/runtime-tools@npm:0.3.5" @@ -11280,6 +11302,15 @@ __metadata: languageName: node linkType: hard +"@module-federation/runtime@npm:0.1.6": + version: 0.1.6 + resolution: "@module-federation/runtime@npm:0.1.6" + dependencies: + "@module-federation/sdk": 0.1.6 + checksum: c564636edd5c1abf5ddf54a6d0dde8fcad1a72d2561163a841f08c354fb1a6e2c69e89d0ec3e5412d55556ea19057ad1980962fbd571aca5a0fb7945e60c0822 + languageName: node + linkType: hard + "@module-federation/runtime@npm:0.3.5": version: 0.3.5 resolution: "@module-federation/runtime@npm:0.3.5" @@ -11289,6 +11320,13 @@ __metadata: languageName: node linkType: hard +"@module-federation/sdk@npm:0.1.6": + version: 0.1.6 + resolution: "@module-federation/sdk@npm:0.1.6" + checksum: 99442f2269e916af78f9f77f7fc71a40e83e4dec5408d6ea8b1f053662005e5717340f91c666cce178e0d9ab92b13826f7cba5e00417bce2a3ee67c0face6ac5 + languageName: node + linkType: hard + "@module-federation/sdk@npm:0.3.5": version: 0.3.5 resolution: "@module-federation/sdk@npm:0.3.5" @@ -11307,6 +11345,16 @@ __metadata: languageName: node linkType: hard +"@module-federation/webpack-bundler-runtime@npm:0.1.6": + version: 0.1.6 + resolution: "@module-federation/webpack-bundler-runtime@npm:0.1.6" + dependencies: + "@module-federation/runtime": 0.1.6 + "@module-federation/sdk": 0.1.6 + checksum: 7dd6478cdd34881e974f67c8fe3cf668dbd881722416e214981eb423a67a7a1743564d60e652c6819445b1ab8d13fef823ea309c9c75c189001e75e81bd34fb3 + languageName: node + linkType: hard + "@module-federation/webpack-bundler-runtime@npm:0.3.5": version: 0.3.5 resolution: "@module-federation/webpack-bundler-runtime@npm:0.3.5" @@ -15068,6 +15116,153 @@ __metadata: languageName: node linkType: hard +"@rspack/binding-darwin-arm64@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-darwin-arm64@npm:0.7.5" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rspack/binding-darwin-x64@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-darwin-x64@npm:0.7.5" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rspack/binding-linux-arm64-gnu@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-linux-arm64-gnu@npm:0.7.5" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rspack/binding-linux-arm64-musl@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-linux-arm64-musl@npm:0.7.5" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rspack/binding-linux-x64-gnu@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-linux-x64-gnu@npm:0.7.5" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rspack/binding-linux-x64-musl@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-linux-x64-musl@npm:0.7.5" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rspack/binding-win32-arm64-msvc@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-win32-arm64-msvc@npm:0.7.5" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rspack/binding-win32-ia32-msvc@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-win32-ia32-msvc@npm:0.7.5" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rspack/binding-win32-x64-msvc@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding-win32-x64-msvc@npm:0.7.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@rspack/binding@npm:0.7.5": + version: 0.7.5 + resolution: "@rspack/binding@npm:0.7.5" + dependencies: + "@rspack/binding-darwin-arm64": 0.7.5 + "@rspack/binding-darwin-x64": 0.7.5 + "@rspack/binding-linux-arm64-gnu": 0.7.5 + "@rspack/binding-linux-arm64-musl": 0.7.5 + "@rspack/binding-linux-x64-gnu": 0.7.5 + "@rspack/binding-linux-x64-musl": 0.7.5 + "@rspack/binding-win32-arm64-msvc": 0.7.5 + "@rspack/binding-win32-ia32-msvc": 0.7.5 + "@rspack/binding-win32-x64-msvc": 0.7.5 + dependenciesMeta: + "@rspack/binding-darwin-arm64": + optional: true + "@rspack/binding-darwin-x64": + optional: true + "@rspack/binding-linux-arm64-gnu": + optional: true + "@rspack/binding-linux-arm64-musl": + optional: true + "@rspack/binding-linux-x64-gnu": + optional: true + "@rspack/binding-linux-x64-musl": + optional: true + "@rspack/binding-win32-arm64-msvc": + optional: true + "@rspack/binding-win32-ia32-msvc": + optional: true + "@rspack/binding-win32-x64-msvc": + optional: true + checksum: de25c44cc9c3a240c6f59a657d19d7170c3af1c99097fe2aa5118e2af7b0d606935ad45640102888ce1806bc67fb207189f562cfbcfe4c1628116f5b06f7c6b6 + languageName: node + linkType: hard + +"@rspack/core@npm:^0.7.5": + version: 0.7.5 + resolution: "@rspack/core@npm:0.7.5" + dependencies: + "@module-federation/runtime-tools": 0.1.6 + "@rspack/binding": 0.7.5 + caniuse-lite: ^1.0.30001616 + tapable: 2.2.1 + webpack-sources: 3.2.3 + peerDependencies: + "@swc/helpers": ">=0.5.1" + peerDependenciesMeta: + "@swc/helpers": + optional: true + checksum: 9e41005231d7a58888cb349ee26737752087f13847f6178308f04e99169187996e40cdaf8987e656a81fe1fb91aeb2e8ca2f1fa32fed46b04fe2709325e5a387 + languageName: node + linkType: hard + +"@rspack/dev-server@npm:^0.7.5": + version: 0.7.5 + resolution: "@rspack/dev-server@npm:0.7.5" + dependencies: + chokidar: 3.5.3 + connect-history-api-fallback: 2.0.0 + express: 4.19.2 + http-proxy-middleware: 2.0.6 + mime-types: 2.1.35 + webpack-dev-middleware: 6.1.2 + webpack-dev-server: 4.13.1 + ws: 8.8.1 + peerDependencies: + "@rspack/core": "*" + checksum: d5c767726b1083797cdcc852cb0603fc81ae0225341b5cf52d15e847ced0f1672b83a42bd3237fd047ba63ebe5a9032f5de9ca8c47f318e6ac68425c91ff46d7 + languageName: node + linkType: hard + +"@rspack/plugin-react-refresh@npm:^0.7.5": + version: 0.7.5 + resolution: "@rspack/plugin-react-refresh@npm:0.7.5" + peerDependencies: + react-refresh: ">=0.10.0 <1.0.0" + peerDependenciesMeta: + react-refresh: + optional: true + checksum: ab5f480c44563799bd5d837a608223e57ac41d535adcd22fb8f40625f6bda83e2ece28d40dce4c290249e7c9a8657781b5dfa864b14fae86017e41925d026655 + languageName: node + linkType: hard + "@rushstack/node-core-library@npm:3.59.7": version: 3.59.7 resolution: "@rushstack/node-core-library@npm:3.59.7" @@ -17476,7 +17671,7 @@ __metadata: languageName: node linkType: hard -"@types/bonjour@npm:^3.5.13": +"@types/bonjour@npm:^3.5.13, @types/bonjour@npm:^3.5.9": version: 3.5.13 resolution: "@types/bonjour@npm:3.5.13" dependencies: @@ -17581,7 +17776,7 @@ __metadata: languageName: node linkType: hard -"@types/connect-history-api-fallback@npm:^1.5.4": +"@types/connect-history-api-fallback@npm:^1.3.5, @types/connect-history-api-fallback@npm:^1.5.4": version: 1.5.4 resolution: "@types/connect-history-api-fallback@npm:1.5.4" dependencies: @@ -17870,7 +18065,7 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:*, @types/express@npm:^4.17.14, @types/express@npm:^4.17.21, @types/express@npm:^4.17.6": +"@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.14, @types/express@npm:^4.17.21, @types/express@npm:^4.17.6": version: 4.17.21 resolution: "@types/express@npm:4.17.21" dependencies: @@ -18365,13 +18560,6 @@ __metadata: languageName: node linkType: hard -"@types/mime@npm:*": - version: 3.0.4 - resolution: "@types/mime@npm:3.0.4" - checksum: a6139c8e1f705ef2b064d072f6edc01f3c099023ad7c4fce2afc6c2bf0231888202adadbdb48643e8e20da0ce409481a49922e737eca52871b3dc08017455843 - languageName: node - linkType: hard - "@types/mime@npm:^1": version: 1.3.2 resolution: "@types/mime@npm:1.3.2" @@ -18895,6 +19083,13 @@ __metadata: languageName: node linkType: hard +"@types/retry@npm:0.12.0": + version: 0.12.0 + resolution: "@types/retry@npm:0.12.0" + checksum: 61a072c7639f6e8126588bf1eb1ce8835f2cb9c2aba795c4491cf6310e013267b0c8488039857c261c387e9728c1b43205099223f160bb6a76b4374f741b5603 + languageName: node + linkType: hard + "@types/retry@npm:0.12.2": version: 0.12.2 resolution: "@types/retry@npm:0.12.2" @@ -18960,7 +19155,7 @@ __metadata: languageName: node linkType: hard -"@types/serve-index@npm:^1.9.4": +"@types/serve-index@npm:^1.9.1, @types/serve-index@npm:^1.9.4": version: 1.9.4 resolution: "@types/serve-index@npm:1.9.4" dependencies: @@ -18969,14 +19164,14 @@ __metadata: languageName: node linkType: hard -"@types/serve-static@npm:*, @types/serve-static@npm:^1.15.5": - version: 1.15.5 - resolution: "@types/serve-static@npm:1.15.5" +"@types/serve-static@npm:*, @types/serve-static@npm:^1.13.10, @types/serve-static@npm:^1.15.5": + version: 1.15.7 + resolution: "@types/serve-static@npm:1.15.7" dependencies: "@types/http-errors": "*" - "@types/mime": "*" "@types/node": "*" - checksum: 0ff4b3703cf20ba89c9f9e345bc38417860a88e85863c8d6fe274a543220ab7f5f647d307c60a71bb57dc9559f0890a661e8dc771a6ec5ef195d91c8afc4a893 + "@types/send": "*" + checksum: bbbf00dbd84719da2250a462270dc68964006e8d62f41fe3741abd94504ba3688f420a49afb2b7478921a1544d3793183ffa097c5724167da777f4e0c7f1a7d6 languageName: node linkType: hard @@ -19019,7 +19214,7 @@ __metadata: languageName: node linkType: hard -"@types/sockjs@npm:^0.3.36": +"@types/sockjs@npm:^0.3.33, @types/sockjs@npm:^0.3.36": version: 0.3.36 resolution: "@types/sockjs@npm:0.3.36" dependencies: @@ -19253,12 +19448,12 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:*, @types/ws@npm:^8.0.0, @types/ws@npm:^8.5.10, @types/ws@npm:^8.5.3": - version: 8.5.10 - resolution: "@types/ws@npm:8.5.10" +"@types/ws@npm:*, @types/ws@npm:^8.0.0, @types/ws@npm:^8.5.1, @types/ws@npm:^8.5.10, @types/ws@npm:^8.5.3": + version: 8.5.12 + resolution: "@types/ws@npm:8.5.12" dependencies: "@types/node": "*" - checksum: 3ec416ea2be24042ebd677932a462cf16d2080393d8d7d0b1b3f5d6eaa4a7387aaf0eefb99193c0bfd29444857cf2e0c3ac89899e130550dc6c14ada8a46d25e + checksum: ddefb6ad1671f70ce73b38a5f47f471d4d493864fca7c51f002a86e5993d031294201c5dced6d5018fb8905ad46888d65c7f20dd54fc165910b69f42fba9a6d0 languageName: node linkType: hard @@ -22203,7 +22398,7 @@ __metadata: languageName: node linkType: hard -"bonjour-service@npm:^1.2.1": +"bonjour-service@npm:^1.0.11, bonjour-service@npm:^1.2.1": version: 1.2.1 resolution: "bonjour-service@npm:1.2.1" dependencies: @@ -22773,10 +22968,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001629": - version: 1.0.30001632 - resolution: "caniuse-lite@npm:1.0.30001632" - checksum: 95be155501650ac36a8c3bdf60886bc8f7c419e7715cdaf1c04941f8676c0bd75355aeda62563092585fbe6f9d50d2eb6dea6bd063d7f6a58004ec62d8f8fe49 +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001616, caniuse-lite@npm:^1.0.30001629": + version: 1.0.30001651 + resolution: "caniuse-lite@npm:1.0.30001651" + checksum: c31a5a01288e70cdbbfb5cd94af3df02f295791673173b8ce6d6a16db4394a6999197d44190be5a6ff06b8c2c7d2047e94dfd5e5eb4c103ab000fca2d370afc7 languageName: node linkType: hard @@ -22921,6 +23116,25 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:3.5.3": + version: 3.5.3 + resolution: "chokidar@npm:3.5.3" + dependencies: + anymatch: ~3.1.2 + braces: ~3.0.2 + fsevents: ~2.3.2 + glob-parent: ~5.1.2 + is-binary-path: ~2.1.0 + is-glob: ~4.0.1 + normalize-path: ~3.0.0 + readdirp: ~3.6.0 + dependenciesMeta: + fsevents: + optional: true + checksum: b49fcde40176ba007ff361b198a2d35df60d9bb2a5aab228279eb810feae9294a6b4649ab15981304447afe1e6ffbf4788ad5db77235dc770ab777c6e771980c + languageName: node + linkType: hard + "chokidar@npm:^3.3.1, chokidar@npm:^3.4.2, chokidar@npm:^3.5.2, chokidar@npm:^3.5.3, chokidar@npm:^3.6.0": version: 3.6.0 resolution: "chokidar@npm:3.6.0" @@ -23758,6 +23972,13 @@ __metadata: languageName: node linkType: hard +"connect-history-api-fallback@npm:2.0.0, connect-history-api-fallback@npm:^2.0.0": + version: 2.0.0 + resolution: "connect-history-api-fallback@npm:2.0.0" + checksum: dc5368690f4a5c413889792f8df70d5941ca9da44523cde3f87af0745faee5ee16afb8195434550f0504726642734f2683d6c07f8b460f828a12c45fbd4c9a68 + languageName: node + linkType: hard + "connect-history-api-fallback@npm:^1.6.0": version: 1.6.0 resolution: "connect-history-api-fallback@npm:1.6.0" @@ -23765,13 +23986,6 @@ __metadata: languageName: node linkType: hard -"connect-history-api-fallback@npm:^2.0.0": - version: 2.0.0 - resolution: "connect-history-api-fallback@npm:2.0.0" - checksum: dc5368690f4a5c413889792f8df70d5941ca9da44523cde3f87af0745faee5ee16afb8195434550f0504726642734f2683d6c07f8b460f828a12c45fbd4c9a68 - languageName: node - linkType: hard - "connect-session-knex@npm:^4.0.0": version: 4.0.0 resolution: "connect-session-knex@npm:4.0.0" @@ -27383,7 +27597,7 @@ __metadata: languageName: node linkType: hard -"express@npm:^4.14.0, express@npm:^4.17.1, express@npm:^4.17.3, express@npm:^4.18.1, express@npm:^4.18.2, express@npm:^4.19.2": +"express@npm:4.19.2, express@npm:^4.14.0, express@npm:^4.17.1, express@npm:^4.17.3, express@npm:^4.18.1, express@npm:^4.18.2, express@npm:^4.19.2": version: 4.19.2 resolution: "express@npm:4.19.2" dependencies: @@ -29422,7 +29636,7 @@ __metadata: languageName: node linkType: hard -"html-entities@npm:^2.1.0, html-entities@npm:^2.4.0, html-entities@npm:^2.5.2": +"html-entities@npm:^2.1.0, html-entities@npm:^2.3.2, html-entities@npm:^2.4.0, html-entities@npm:^2.5.2": version: 2.5.2 resolution: "html-entities@npm:2.5.2" checksum: b23f4a07d33d49ade1994069af4e13d31650e3fb62621e92ae10ecdf01d1a98065c78fd20fdc92b4c7881612210b37c275f2c9fba9777650ab0d6f2ceb3b99b6 @@ -29612,7 +29826,7 @@ __metadata: languageName: node linkType: hard -"http-proxy-middleware@npm:^2.0.0, http-proxy-middleware@npm:^2.0.3, http-proxy-middleware@npm:^2.0.6": +"http-proxy-middleware@npm:2.0.6, http-proxy-middleware@npm:^2.0.0, http-proxy-middleware@npm:^2.0.3, http-proxy-middleware@npm:^2.0.6": version: 2.0.6 resolution: "http-proxy-middleware@npm:2.0.6" dependencies: @@ -30189,10 +30403,10 @@ __metadata: languageName: node linkType: hard -"ipaddr.js@npm:^2.1.0": - version: 2.1.0 - resolution: "ipaddr.js@npm:2.1.0" - checksum: 807a054f2bd720c4d97ee479d6c9e865c233bea21f139fb8dabd5a35c4226d2621c42e07b4ad94ff3f82add926a607d8d9d37c625ad0319f0e08f9f2bd1968e2 +"ipaddr.js@npm:^2.0.1, ipaddr.js@npm:^2.1.0": + version: 2.2.0 + resolution: "ipaddr.js@npm:2.2.0" + checksum: 770ba8451fd9bf78015e8edac0d5abd7a708cbf75f9429ca9147a9d2f3a2d60767cd5de2aab2b1e13ca6e4445bdeff42bf12ef6f151c07a5c6cf8a44328e2859 languageName: node linkType: hard @@ -32700,13 +32914,13 @@ __metadata: languageName: node linkType: hard -"launch-editor@npm:^2.6.1": - version: 2.6.1 - resolution: "launch-editor@npm:2.6.1" +"launch-editor@npm:^2.6.0, launch-editor@npm:^2.6.1": + version: 2.8.1 + resolution: "launch-editor@npm:2.8.1" dependencies: picocolors: ^1.0.0 shell-quote: ^1.8.1 - checksum: e06d193075ac09f7f8109f10cabe464a211bf7ed4cbe75f83348d6f67bf4d9f162f06e7a1ab3e1cd7fc250b5342c3b57080618aff2e646dc34248fe499227601 + checksum: 69adfc913c066b0bcd685103907525789db6af3585cdc5f8c1172f0fcebe2c4ea1cff1108f76e9c591c00134329a5fb29e5911e9c0c347618a5300978b6bb767 languageName: node linkType: hard @@ -33947,7 +34161,7 @@ __metadata: languageName: node linkType: hard -"memfs@npm:^3.1.2, memfs@npm:^3.4.1": +"memfs@npm:^3.1.2, memfs@npm:^3.4.1, memfs@npm:^3.4.12, memfs@npm:^3.4.3": version: 3.5.3 resolution: "memfs@npm:3.5.3" dependencies: @@ -36105,14 +36319,14 @@ __metadata: languageName: node linkType: hard -"open@npm:^8.0.0, open@npm:^8.4.0": - version: 8.4.0 - resolution: "open@npm:8.4.0" +"open@npm:^8.0.0, open@npm:^8.0.9, open@npm:^8.4.0": + version: 8.4.2 + resolution: "open@npm:8.4.2" dependencies: define-lazy-prop: ^2.0.0 is-docker: ^2.1.1 is-wsl: ^2.2.0 - checksum: e9545bec64cdbf30a0c35c1bdc310344adf8428a117f7d8df3c0af0a0a24c513b304916a6d9b11db0190ff7225c2d578885080b761ed46a3d5f6f1eebb98b63c + checksum: 6388bfff21b40cb9bd8f913f9130d107f2ed4724ea81a8fd29798ee322b361ca31fa2cdfb491a5c31e43a3996cfe9566741238c7a741ada8d7af1cb78d85cf26 languageName: node linkType: hard @@ -36389,6 +36603,16 @@ __metadata: languageName: node linkType: hard +"p-retry@npm:^4.5.0": + version: 4.6.2 + resolution: "p-retry@npm:4.6.2" + dependencies: + "@types/retry": 0.12.0 + retry: ^0.13.1 + checksum: 45c270bfddaffb4a895cea16cb760dcc72bdecb6cb45fef1971fa6ea2e91ddeafddefe01e444ac73e33b1b3d5d29fb0dd18a7effb294262437221ddc03ce0f2e + languageName: node + linkType: hard + "p-retry@npm:^6.2.0": version: 6.2.0 resolution: "p-retry@npm:6.2.0" @@ -40622,7 +40846,7 @@ __metadata: languageName: node linkType: hard -"selfsigned@npm:^2.0.0, selfsigned@npm:^2.4.1": +"selfsigned@npm:^2.0.0, selfsigned@npm:^2.1.1, selfsigned@npm:^2.4.1": version: 2.4.1 resolution: "selfsigned@npm:2.4.1" dependencies: @@ -42397,6 +42621,13 @@ __metadata: languageName: node linkType: hard +"tapable@npm:2.2.1, tapable@npm:^2.0.0, tapable@npm:^2.1.1, tapable@npm:^2.2.0, tapable@npm:^2.2.1": + version: 2.2.1 + resolution: "tapable@npm:2.2.1" + checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 + languageName: node + linkType: hard + "tapable@npm:^1.0.0": version: 1.1.3 resolution: "tapable@npm:1.1.3" @@ -42404,13 +42635,6 @@ __metadata: languageName: node linkType: hard -"tapable@npm:^2.0.0, tapable@npm:^2.1.1, tapable@npm:^2.2.0, tapable@npm:^2.2.1": - version: 2.2.1 - resolution: "tapable@npm:2.2.1" - checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 - languageName: node - linkType: hard - "tar-fs@npm:^2.0.0": version: 2.1.1 resolution: "tar-fs@npm:2.1.1" @@ -44642,6 +44866,39 @@ __metadata: languageName: node linkType: hard +"webpack-dev-middleware@npm:6.1.2": + version: 6.1.2 + resolution: "webpack-dev-middleware@npm:6.1.2" + dependencies: + colorette: ^2.0.10 + memfs: ^3.4.12 + mime-types: ^2.1.31 + range-parser: ^1.2.1 + schema-utils: ^4.0.0 + peerDependencies: + webpack: ^5.0.0 + peerDependenciesMeta: + webpack: + optional: true + checksum: 6e962341db5b3ac8526cd678fc6b128adcb92c288aab767948ab7d01591d7837d2d97cf9329d307831b1d51c831fcea4d8f2eb514efe8c8654ae2a4ae9d9f1fb + languageName: node + linkType: hard + +"webpack-dev-middleware@npm:^5.3.1": + version: 5.3.4 + resolution: "webpack-dev-middleware@npm:5.3.4" + dependencies: + colorette: ^2.0.10 + memfs: ^3.4.3 + mime-types: ^2.1.31 + range-parser: ^1.2.1 + schema-utils: ^4.0.0 + peerDependencies: + webpack: ^4.0.0 || ^5.0.0 + checksum: 90cf3e27d0714c1a745454a1794f491b7076434939340605b9ee8718ba2b85385b120939754e9fdbd6569811e749dee53eec319e0d600e70e0b0baffd8e3fb13 + languageName: node + linkType: hard + "webpack-dev-middleware@npm:^7.1.0": version: 7.2.1 resolution: "webpack-dev-middleware@npm:7.2.1" @@ -44661,6 +44918,53 @@ __metadata: languageName: node linkType: hard +"webpack-dev-server@npm:4.13.1": + version: 4.13.1 + resolution: "webpack-dev-server@npm:4.13.1" + dependencies: + "@types/bonjour": ^3.5.9 + "@types/connect-history-api-fallback": ^1.3.5 + "@types/express": ^4.17.13 + "@types/serve-index": ^1.9.1 + "@types/serve-static": ^1.13.10 + "@types/sockjs": ^0.3.33 + "@types/ws": ^8.5.1 + ansi-html-community: ^0.0.8 + bonjour-service: ^1.0.11 + chokidar: ^3.5.3 + colorette: ^2.0.10 + compression: ^1.7.4 + connect-history-api-fallback: ^2.0.0 + default-gateway: ^6.0.3 + express: ^4.17.3 + graceful-fs: ^4.2.6 + html-entities: ^2.3.2 + http-proxy-middleware: ^2.0.3 + ipaddr.js: ^2.0.1 + launch-editor: ^2.6.0 + open: ^8.0.9 + p-retry: ^4.5.0 + rimraf: ^3.0.2 + schema-utils: ^4.0.0 + selfsigned: ^2.1.1 + serve-index: ^1.9.1 + sockjs: ^0.3.24 + spdy: ^4.0.2 + webpack-dev-middleware: ^5.3.1 + ws: ^8.13.0 + peerDependencies: + webpack: ^4.37.0 || ^5.0.0 + peerDependenciesMeta: + webpack: + optional: true + webpack-cli: + optional: true + bin: + webpack-dev-server: bin/webpack-dev-server.js + checksum: f70611544b7d964a31eb3d934d7c2b376b97e6927a89e03b2e21cfa5812bb639625cd18fd350de1604ba6c455b324135523a894032f28c69d90d90682e4f3b7d + languageName: node + linkType: hard + "webpack-dev-server@npm:^5.0.0": version: 5.0.4 resolution: "webpack-dev-server@npm:5.0.4" @@ -44715,6 +45019,13 @@ __metadata: languageName: node linkType: hard +"webpack-sources@npm:3.2.3, webpack-sources@npm:^3.2.3": + version: 3.2.3 + resolution: "webpack-sources@npm:3.2.3" + checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 + languageName: node + linkType: hard + "webpack-sources@npm:^1.4.3": version: 1.4.3 resolution: "webpack-sources@npm:1.4.3" @@ -44725,13 +45036,6 @@ __metadata: languageName: node linkType: hard -"webpack-sources@npm:^3.2.3": - version: 3.2.3 - resolution: "webpack-sources@npm:3.2.3" - checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 - languageName: node - linkType: hard - "webpack@npm:^5, webpack@npm:^5.70.0": version: 5.91.0 resolution: "webpack@npm:5.91.0" @@ -45142,6 +45446,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:8.8.1": + version: 8.8.1 + resolution: "ws@npm:8.8.1" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 2152cf862cae0693f3775bc688a6afb2e989d19d626d215e70f5fcd8eb55b1c3b0d3a6a4052905ec320e2d7734e20aeedbf9744496d62f15a26ad79cf4cf7dae + languageName: node + linkType: hard + "ws@npm:^7, ws@npm:^7.4.6, ws@npm:^7.5.5": version: 7.5.10 resolution: "ws@npm:7.5.10" From b676cc944f9891236c9e29ee01b7f10fbee548ed Mon Sep 17 00:00:00 2001 From: JounQin Date: Fri, 9 Aug 2024 01:11:21 +0800 Subject: [PATCH 025/268] chore: add related changeset Signed-off-by: JounQin --- .changeset/green-berries-wave.md | 5 +++++ packages/cli/src/lib/bundler/optimization.ts | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .changeset/green-berries-wave.md diff --git a/.changeset/green-berries-wave.md b/.changeset/green-berries-wave.md new file mode 100644 index 0000000000..574d329488 --- /dev/null +++ b/.changeset/green-berries-wave.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +feat: experimentally support using rspack instead under `EXPERIMENTAL_RSPACK` env flag diff --git a/packages/cli/src/lib/bundler/optimization.ts b/packages/cli/src/lib/bundler/optimization.ts index 1cef6b6205..4c569e5ccf 100644 --- a/packages/cli/src/lib/bundler/optimization.ts +++ b/packages/cli/src/lib/bundler/optimization.ts @@ -24,10 +24,6 @@ export const optimization = ( ): WebpackOptionsNormalized['optimization'] => { const { isDev, useRspack } = options; - const extralOptions = useRspack - ? {} - : { maxAsyncRequests: Infinity, maxInitialRequests: Infinity }; - const rspack = useRspack ? (require('@rspack/core') as typeof import('@rspack/core').rspack) : undefined; @@ -82,7 +78,10 @@ export const optimization = ( priority: 10, minSize: 100000, minChunks: 1, - ...extralOptions, + ...(!useRspack && { + maxAsyncRequests: Infinity, + maxInitialRequests: Infinity, + }), }, // filename is not included in type, but we need it // Group together the smallest modules vendor: { From 28a0779d6e34dc4b90d515db5618129eaa4245fc Mon Sep 17 00:00:00 2001 From: JounQin Date: Fri, 9 Aug 2024 11:35:09 +0800 Subject: [PATCH 026/268] chore: add @types/webpack-sources dev dep Signed-off-by: JounQin --- packages/cli/package.json | 1 + packages/cli/src/lib/bundler/backend.ts | 9 ++++++++- yarn.lock | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index e2726f358a..5c5ca64692 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -184,6 +184,7 @@ "@types/svgo": "^2.6.2", "@types/tar": "^6.1.1", "@types/terser-webpack-plugin": "^5.0.4", + "@types/webpack-sources": "^3.2.3", "@types/yarnpkg__lockfile": "^1.1.4", "@vitejs/plugin-react": "^4.0.4", "del": "^7.0.0", diff --git a/packages/cli/src/lib/bundler/backend.ts b/packages/cli/src/lib/bundler/backend.ts index 598b77bc51..e089a9fd72 100644 --- a/packages/cli/src/lib/bundler/backend.ts +++ b/packages/cli/src/lib/bundler/backend.ts @@ -20,17 +20,24 @@ import { resolveBundlingPaths } from './paths'; import { BackendServeOptions } from './types'; export async function serveBackend(options: BackendServeOptions) { + const useRspack = !!process.env.EXPERIMENTAL_RSPACK; + const paths = resolveBundlingPaths(options); const config = await createBackendConfig(paths, { ...options, isDev: true, + useRspack, }); // Webpack only replaces occurrences of this in code it touches, which does // not include dependencies in node_modules. So we set it here at runtime as well. (process.env as { NODE_ENV: string }).NODE_ENV = 'development'; - const compiler = webpack(config, (err: Error | null) => { + const bundler: typeof webpack = useRspack + ? require('@rspack/core').rspack + : webpack; + + const compiler = bundler(config, (err: Error | null) => { if (err) { console.error(err); } else console.log('Build succeeded'); diff --git a/yarn.lock b/yarn.lock index 7222777537..d63d839c08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3990,6 +3990,7 @@ __metadata: "@types/tar": ^6.1.1 "@types/terser-webpack-plugin": ^5.0.4 "@types/webpack-env": ^1.15.2 + "@types/webpack-sources": ^3.2.3 "@types/yarnpkg__lockfile": ^1.1.4 "@typescript-eslint/eslint-plugin": ^6.12.0 "@typescript-eslint/parser": ^6.7.2 @@ -19223,6 +19224,13 @@ __metadata: languageName: node linkType: hard +"@types/source-list-map@npm:*": + version: 0.1.6 + resolution: "@types/source-list-map@npm:0.1.6" + checksum: 9cd294c121f1562062de5d241fe4d10780b1131b01c57434845fe50968e9dcf67ede444591c2b1ad6d3f9b6bc646ac02cc8f51a3577c795f9c64cf4573dcc6b1 + languageName: node + linkType: hard + "@types/ssh2-streams@npm:*": version: 0.1.8 resolution: "@types/ssh2-streams@npm:0.1.8" @@ -19430,6 +19438,17 @@ __metadata: languageName: node linkType: hard +"@types/webpack-sources@npm:^3.2.3": + version: 3.2.3 + resolution: "@types/webpack-sources@npm:3.2.3" + dependencies: + "@types/node": "*" + "@types/source-list-map": "*" + source-map: ^0.7.3 + checksum: 7b557f242efaa10e4e3e18cc4171a0c98e22898570caefdd4f7b076fe8534b5abfac92c953c6604658dcb7218507f970230352511840fe9fdea31a9af3b9a906 + languageName: node + linkType: hard + "@types/webpack@npm:^5.28.0": version: 5.28.5 resolution: "@types/webpack@npm:5.28.5" From 4e640197902f1612543834de4af68250c69f91c2 Mon Sep 17 00:00:00 2001 From: JounQin Date: Wed, 14 Aug 2024 18:56:35 +0800 Subject: [PATCH 027/268] chore: rebase issue Signed-off-by: JounQin --- packages/cli/src/lib/bundler/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index 69c673b833..f31acc3a1b 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -191,7 +191,7 @@ export async function createConfig( // to remove this eventually! plugins.push( new bundler.ProvidePlugin({ - process: require.resolve('process/browser'),, + process: require.resolve('process/browser'), Buffer: ['buffer', 'Buffer'], }), ); From 551abf6d55e3b62f24375ef48ee7ea4d7cb791af Mon Sep 17 00:00:00 2001 From: JounQin Date: Wed, 14 Aug 2024 19:00:43 +0800 Subject: [PATCH 028/268] chore: override experiments unexpectedly Signed-off-by: JounQin --- packages/cli/src/lib/bundler/config.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index f31acc3a1b..59ef2655cc 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -424,7 +424,12 @@ export async function createConfig( : {}), }, experiments: { - lazyCompilation: yn(process.env.EXPERIMENTAL_LAZY_COMPILATION), + lazyCompilation: + !useRspack && yn(process.env.EXPERIMENTAL_LAZY_COMPILATION), + ...(useRspack && { + // We're still using `style-loader` for custom `insert` option + css: false, + }), }, plugins, ...(withCache && { @@ -435,12 +440,6 @@ export async function createConfig( }, }, }), - ...(useRspack && { - // We're still using `style-loader` for custom `insert` option - experiments: { - css: false, - }, - }), }; } From cd7a503bbc8360297db2f10443851fa237524cac Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Wed, 14 Aug 2024 20:58:32 -0400 Subject: [PATCH 029/268] trigger ci Signed-off-by: Stephen Glass --- .changeset/violet-beds-promise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/violet-beds-promise.md b/.changeset/violet-beds-promise.md index 5fd4890ffa..7632ea68c7 100644 --- a/.changeset/violet-beds-promise.md +++ b/.changeset/violet-beds-promise.md @@ -5,7 +5,7 @@ '@backstage/plugin-auth-react': patch --- -Fix error handling using authentication redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `useSignInAuthError` hook.: +Fix authentication error handling using redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `useSignInAuthError` hook.: ```ts import { useSignInAuthError } from '@backstage/plugin-auth-react'; From 65a5939be6b82d5b75626a4862f5461f81ad4a52 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Wed, 14 Aug 2024 20:59:23 -0400 Subject: [PATCH 030/268] fix typo Signed-off-by: Stephen Glass --- .changeset/violet-beds-promise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/violet-beds-promise.md b/.changeset/violet-beds-promise.md index 7632ea68c7..ee002d8319 100644 --- a/.changeset/violet-beds-promise.md +++ b/.changeset/violet-beds-promise.md @@ -5,7 +5,7 @@ '@backstage/plugin-auth-react': patch --- -Fix authentication error handling using redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `useSignInAuthError` hook.: +Fix authentication error handling using redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `useSignInAuthError` hook. ```ts import { useSignInAuthError } from '@backstage/plugin-auth-react'; From d964eb1a030d5271b848d644d79692c77ef8df41 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Fri, 23 Aug 2024 10:22:14 -0400 Subject: [PATCH 031/268] fix test suite name for auth error hook Signed-off-by: Stephen Glass --- .../src/hooks/useSignInAuthError/useSignInAuthError.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx index a5ac57ec83..0c67c419f8 100644 --- a/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx +++ b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx @@ -21,7 +21,7 @@ import { TestApiProvider } from '@backstage/test-utils'; import { useSignInAuthError } from './useSignInAuthError'; import { serializeError } from '@backstage/errors'; -describe('useCookieAuthRefresh', () => { +describe('useSignInAuthError', () => { const discoveryApiMock = { getBaseUrl: jest.fn().mockResolvedValue('http://localhost:7000/api/auth'), }; From f2a589777ec8768a11af013db3f9c9b63651a698 Mon Sep 17 00:00:00 2001 From: Peter Macdonald Date: Wed, 18 Sep 2024 11:20:50 +0200 Subject: [PATCH 032/268] Sets the edit this page url to be static as it was before we generated versioned docs Signed-off-by: Peter Macdonald --- microsite/docusaurus.config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/microsite/docusaurus.config.ts b/microsite/docusaurus.config.ts index af96ef4c42..43bde19e35 100644 --- a/microsite/docusaurus.config.ts +++ b/microsite/docusaurus.config.ts @@ -84,7 +84,10 @@ const config: Config = { /** @type {import('@docusaurus/preset-classic').Options} */ { docs: { - editUrl: 'https://github.com/backstage/backstage/edit/master/docs/', + editUrl: ({ docPath }) => { + // Always point to the non-versioned directory when editing a doc page + return `https://github.com/backstage/backstage/edit/master/docs/${docPath}`; + }, path: '../docs', sidebarPath: 'sidebars.js', ...(useVersionedDocs From 5b3d4b884f3c91768a70dcbd73864c300351cf5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veith=20M=2E=20B=C3=BCrgerhoff?= Date: Fri, 20 Sep 2024 22:17:12 +0200 Subject: [PATCH 033/268] rework the additional templates documentation to include additionalTemplateGlobals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Veith M. Bürgerhoff --- .../software-templates/writing-templates.md | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 71ca0c56ae..0c1f7338cb 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -801,34 +801,33 @@ The `projectSlug` filter generates a project slug from a repository URL - **Input**: `github.com?repo=backstage&org=backstage` - **Output**: `backstage/backstage` -## Custom Filters +## Custom Filters and Globals -Whenever it is needed to extend the built-in filters with yours `${{ parameters.name | my-filter1 | my-filter2 | etc }}`, then you can add them -using the property `additionalTemplateFilters`. +You may with to extend the filters and globals with your own custom ones. For example `${{ myGlobal | myFilter | myOtherFilter }}` or `${{ myFunctionGlobal(1,2) | myFilter }}`. +This can be achieved using the `additionalTemplateFilters` and `additionalTemplateGlobals` properties respectively. -The `additionalTemplateFilters` property accepts as type a `Record` +These properties accept a `Record` -```ts title="plugins/scaffolder-backend/src/service/Router.ts" +```ts title="plugins/scaffolder-backend/src/service/router.ts" additionalTemplateFilters?: Record; + additionalTemplateGlobals?: Record; ``` -where the first parameter is the name of the filter and the second receives a list of `JSON value` arguments. The `templateFilter()` function must return a JsonValue which is either a Json array, object or primitive. +where the first parameter is the identifier of the filter or global and the second is a `TemplateFilter` or a `TemplateGlobal` respectively. +A `TemplateFilter` is a function which will be called using the previous `JsonValue` objets and may return a `JsonValue` object. +A `TemplateGlobal` can either be a function which will be called using the passed `JsonValue` objects and may return a `JsonValue` object or it can be a `JsonValue` object itself. ```ts title="plugins/scaffolder-node/src/types.ts" export type TemplateFilter = (...args: JsonValue[]) => JsonValue | undefined; + +export type TemplateGlobal = + | ((...args: JsonValue[]) => JsonValue | undefined) + | JsonValue; ``` -From a practical coding point of view, you will translate that into the following snippet code handling 2 filters: +**Usage Example** -```ts" -... -additionalTemplateFilters: { - base64: (...args: JsonValue[]) => btoa(args.join("")), - betterFilter: (...args: JsonValue[]) => { return `This is a much better string than "${args}", don't you think?` } -} -``` - -And within your template, you will be able to use the filters using a parameter and the filter passed using the pipe symbol +Given you want to have the following filters and globals available in you template: ```yaml apiVersion: scaffolder.backstage.io/v1beta3 @@ -840,22 +839,21 @@ spec: owner: user:guest type: service - parameters: - - title: Test custom filters - properties: - userName: - title: Name of the user - type: string - steps: - - id: debug - name: debug + - id: debug1 + name: debug1 action: debug:log input: - message: ${{ parameters.userName | betterFilter | base64 }} + message: ${{ myGlobal | myFilter | myOtherFilter }} + + - id: debug2 + name: debug2 + action: debug:log + input: + message: ${{ myFunctionGlobal(1,2) | myFilter }} ``` -Next, you will have to register the property `addTemplateFilters` using the `scaffolderTemplatingExtensionPoint` of a new `BackendModule` [created](../../backend-system/architecture/06-modules.md). +You will have to create a new [`BackendModule`](../../backend-system/architecture/06-modules.md) using the `scaffolderTemplatingExtensionPoint`. Here is a very simplified example of how to do that: @@ -876,11 +874,13 @@ const scaffolderModuleCustomFilters = createBackendModule({ // ... and other dependencies as needed }, async init({ scaffolder /* ..., other dependencies */ }) { - scaffolder.addTemplateFilters({ - base64: (...args: JsonValue[]) => btoa(args.join('')), - betterFilter: (...args: JsonValue[]) => { - return `This is a much better string than "${args}", don't you think?`; - }, + scaffolder.addTemplateGlobals({ + myGlobal: () => 'myGlobal', + myFunctionGlobal: (...args: JsonValue[]) => args[0] + args[1], + }); + scaffolder.additionalTemplateFilters({ + myFilter: () => 'the value is this now', + myOtherFilter: (...args: JsonValue[]) => args.join(''), }); }, }); @@ -908,10 +908,16 @@ export default async function createPlugin({ additionalTemplateFilters: { - } + }, + additionalTemplateGlobals: { + + }, }); +} ``` +Note, that addtional template global functions are currently not supported in `fetch:template` (see #25445). + ## Template Editor Writing template is most of the times an iterative process. You will need to test your template to make sure it has a good user experience and that it works as expected. To help on this process the scaffolder comes with a build in template editor that allows you to test your template in a real environment for querying data and execute the actions on dry-run mode to see the results of those one. From 2ce049cce2a25aef486926f07e12f80f41e08e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veith=20M=2E=20B=C3=BCrgerhoff?= Date: Mon, 23 Sep 2024 10:10:40 +0200 Subject: [PATCH 034/268] fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Veith M. Bürgerhoff --- docs/features/software-templates/writing-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 0c1f7338cb..2cc14f1000 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -803,7 +803,7 @@ The `projectSlug` filter generates a project slug from a repository URL ## Custom Filters and Globals -You may with to extend the filters and globals with your own custom ones. For example `${{ myGlobal | myFilter | myOtherFilter }}` or `${{ myFunctionGlobal(1,2) | myFilter }}`. +You may wish to extend the filters and globals with your own custom ones. For example `${{ myGlobal | myFilter | myOtherFilter }}` or `${{ myFunctionGlobal(1,2) | myFilter }}`. This can be achieved using the `additionalTemplateFilters` and `additionalTemplateGlobals` properties respectively. These properties accept a `Record` From 25d00302eb106efc662eee975648577225f61c9a Mon Sep 17 00:00:00 2001 From: AmbrishRamachandiran Date: Mon, 30 Sep 2024 13:40:23 +0530 Subject: [PATCH 035/268] Fixing grammer mistakes in openapi-docs Signed-off-by: AmbrishRamachandiran --- docs/openapi/01-getting-started.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/openapi/01-getting-started.md b/docs/openapi/01-getting-started.md index a9c70c61f8..df0f72194b 100644 --- a/docs/openapi/01-getting-started.md +++ b/docs/openapi/01-getting-started.md @@ -14,8 +14,8 @@ Difficulty: Medium The goal of this tutorial is to give you exposure to tools that more tightly couple your OpenAPI specification and plugin lifecycle. The tools we'll be presenting were created by the OpenAPI tooling project area and allow you to create, -1. A typed `express` router that provides strong guardrails during development for input and output values. Support for query, path parameters and request body, as well as experimental support for headers and cookies. -2. An auto-generated client to interact with your plugin's backend. Support for all request types, parameters and body, as well as return types. Provides a low-level interface to allow more customization by higher level libraries. +1. A typed `express` router that provides strong guardrails during development for input and output values. Support for query, parameters, and request body, as well as experimental support for headers and cookies. +2. An auto-generated client to interact with your plugin's backend. Support for all request types, parameters, and body, as well as return types. Provides a low-level interface to allow more customization by higher-level libraries. 3. Validation and verification tooling to ensure your API and specification stay in sync. Includes testing against your unit tests. ## Prerequisites @@ -32,8 +32,8 @@ This tutorial assumes that you're already familiar with the following, There are two required npm packages before we start, -1. `@backstage/repo-tools`, this package contains all OpenAPI related commands for your plugins. We will be using this throughout the tutorial. -2. `@useoptic/optic`, this package is a dependency of `@backstage/repo-tools` but is only required for OpenAPI related commands. +1. `@backstage/repo-tools`, this package contains all OpenAPI-related commands for your plugins. We will be using this throughout the tutorial. +2. `@useoptic/optic`, this package is a dependency of `@backstage/repo-tools` but is only required for OpenAPI-related commands. Further, for generating the client a `java` binary has to be available on your PATH. @@ -47,7 +47,7 @@ You should create a new folder, `src/schema` in your backend plugin to store you ## Generating a typed express router from a spec -Run `yarn backstage-repo-tools package schema openapi generate --server` from the directory with your plugin. This will create an `openapi.generated.ts` file in the `src/schema` directory that contains the OpenAPI schema as well as a generated express router with types. You should add this command to your `package.json` for future use and you can combine both the server generation and the client generation below like so, `yarn backstage-repo-tools package schema openapi generate --server --client-package ` +Run `yarn backstage-repo-tools package schema openapi generate --server` from the directory with your plugin. This will create an `openapi.generated.ts` file in the `src/schema` directory that contains the OpenAPI schema as well as a generated express router with types. You should add this command to your `package.json` for future use, and you can combine both the server generation and the client generation below, like so, `yarn backstage-repo-tools package schema openapi generate --server --client-package ` Use it like so, update your `router.ts` or `createRouter.ts` file with the following content, @@ -86,7 +86,7 @@ export class CatalogClient implements CatalogApi { usage of the types will depend on your type names. -You should be able to use the generated `DefaultApi.client.ts` file out of the box for your API needs. For full customization, you can use a wrapper around the generated client to adjust the flavor of your clients. +You should be able to use the generated `DefaultApi.client.ts` file out of the box for your API needs. For full customization, you can use a wrapper around the generated client to adjust the flavour of your clients. For more information, see [the docs](./generate-client.md). From 8bbb568d46404f937d1f300ff36befd16c0cd5b8 Mon Sep 17 00:00:00 2001 From: AmbrishRamachandiran Date: Mon, 30 Sep 2024 13:44:41 +0530 Subject: [PATCH 036/268] fixing grammer mistakes in openapi-docs Signed-off-by: AmbrishRamachandiran --- docs/openapi/01-getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/openapi/01-getting-started.md b/docs/openapi/01-getting-started.md index df0f72194b..156df9bd17 100644 --- a/docs/openapi/01-getting-started.md +++ b/docs/openapi/01-getting-started.md @@ -14,7 +14,7 @@ Difficulty: Medium The goal of this tutorial is to give you exposure to tools that more tightly couple your OpenAPI specification and plugin lifecycle. The tools we'll be presenting were created by the OpenAPI tooling project area and allow you to create, -1. A typed `express` router that provides strong guardrails during development for input and output values. Support for query, parameters, and request body, as well as experimental support for headers and cookies. +1. A typed `express` router that provides strong guardrails during development for input and output values. Support for query, path parameters, and request body, as well as experimental support for headers and cookies. 2. An auto-generated client to interact with your plugin's backend. Support for all request types, parameters, and body, as well as return types. Provides a low-level interface to allow more customization by higher-level libraries. 3. Validation and verification tooling to ensure your API and specification stay in sync. Includes testing against your unit tests. From 4935d29d151f335b1c1cb8a50e76fac4f0b8f9e9 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Tue, 1 Oct 2024 23:12:10 -0400 Subject: [PATCH 037/268] change code to use search params instead of cookie Signed-off-by: Stephen Glass --- .changeset/violet-beds-promise.md | 10 +- packages/core-components/package.json | 1 - .../src/layout/SignInPage/SignInPage.tsx | 17 +--- .../src/layout/SignInPage/providers.tsx | 32 +++--- .../createCookieAuthErrorMiddleware.test.ts | 56 ----------- .../createCookieAuthErrorMiddleware.ts | 52 ---------- plugins/auth-backend/src/service/router.ts | 3 - .../src/oauth/createAuthErrorCookie.ts | 55 ----------- .../oauth/createOAuthRouteHandlers.test.ts | 20 ++-- .../src/oauth/createOAuthRouteHandlers.ts | 8 +- plugins/auth-react/api-report.md | 6 -- plugins/auth-react/src/hooks/index.ts | 1 - .../src/hooks/useSignInAuthError/index.tsx | 17 ---- .../useSignInAuthError.test.tsx | 98 ------------------- .../useSignInAuthError/useSignInAuthError.tsx | 45 --------- yarn.lock | 1 - 16 files changed, 34 insertions(+), 388 deletions(-) delete mode 100644 plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts delete mode 100644 plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts delete mode 100644 plugins/auth-node/src/oauth/createAuthErrorCookie.ts delete mode 100644 plugins/auth-react/src/hooks/useSignInAuthError/index.tsx delete mode 100644 plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx delete mode 100644 plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx diff --git a/.changeset/violet-beds-promise.md b/.changeset/violet-beds-promise.md index ee002d8319..b5369d4c56 100644 --- a/.changeset/violet-beds-promise.md +++ b/.changeset/violet-beds-promise.md @@ -1,14 +1,6 @@ --- '@backstage/core-components': patch -'@backstage/plugin-auth-backend': patch '@backstage/plugin-auth-node': patch -'@backstage/plugin-auth-react': patch --- -Fix authentication error handling using redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `useSignInAuthError` hook. - -```ts -import { useSignInAuthError } from '@backstage/plugin-auth-react'; - -const { error, checkAuthError } = useSignInAuthError(); -``` +Fix authentication error handling using redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `error` query parameter containing the error message. diff --git a/packages/core-components/package.json b/packages/core-components/package.json index 49cecfbb21..a2688a0037 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -57,7 +57,6 @@ "@backstage/config": "workspace:^", "@backstage/core-plugin-api": "workspace:^", "@backstage/errors": "workspace:^", - "@backstage/plugin-auth-react": "workspace:^", "@backstage/theme": "workspace:^", "@backstage/version-bridge": "workspace:^", "@date-io/core": "^1.3.13", diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index d7e8d1fcf6..51e8b62199 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -24,7 +24,7 @@ import { UserIdentity } from './UserIdentity'; import Button from '@material-ui/core/Button'; import Grid from '@material-ui/core/Grid'; import Typography from '@material-ui/core/Typography'; -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { useMountEffect } from '@react-hookz/web'; import { Progress } from '../../components/Progress'; import { Content } from '../Content/Content'; @@ -38,7 +38,6 @@ import { IdentityProviders, SignInProviderConfig } from './types'; import { coreComponentsTranslationRef } from '../../translation'; import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; import { useSearchParams } from 'react-router-dom'; -import { useSignInAuthError } from '@backstage/plugin-auth-react'; type MultiSignInPageProps = SignInPageProps & { providers: IdentityProviders; @@ -99,7 +98,6 @@ export const SingleSignInPage = ({ const classes = useStyles(); const authApi = useApi(provider.apiRef); const configApi = useApi(configApiRef); - const { error: signInError, checkAuthError } = useSignInAuthError(); const { t } = useTranslationRef(coreComponentsTranslationRef); const [error, setError] = useState(); @@ -112,7 +110,6 @@ export const SingleSignInPage = ({ // User was redirected back to sign in page with error from auth redirect flow const [searchParams, _setSearchParams] = useSearchParams(); const errorParam = searchParams.get('error'); - const hasErrorSearchParam = errorParam !== 'false' && errorParam !== null; type LoginOpts = { checkExisting?: boolean; showPopup?: boolean }; const login = async ({ checkExisting, showPopup }: LoginOpts) => { @@ -126,7 +123,7 @@ export const SingleSignInPage = ({ } // If no session exists, show the sign-in page - if (!identityResponse && (showPopup || auto) && !hasErrorSearchParam) { + if (!identityResponse && (showPopup || auto) && !errorParam) { // Unless auto is set to true, this step should not happen. // When user intentionally clicks the Sign In button, autoShowPopup is set to true setShowLoginPage(true); @@ -161,18 +158,12 @@ export const SingleSignInPage = ({ }; useMountEffect(() => { - if (hasErrorSearchParam) { - checkAuthError(); + if (errorParam) { + setError(new Error(decodeURIComponent(errorParam))); } login({ checkExisting: true }); }); - useEffect(() => { - if (signInError) { - setError(signInError); - } - }, [signInError]); - return showLoginPage ? (

diff --git a/packages/core-components/src/layout/SignInPage/providers.tsx b/packages/core-components/src/layout/SignInPage/providers.tsx index 8d34d8d9de..9cb2fa3c9f 100644 --- a/packages/core-components/src/layout/SignInPage/providers.tsx +++ b/packages/core-components/src/layout/SignInPage/providers.tsx @@ -14,13 +14,7 @@ * limitations under the License. */ -import React, { - useLayoutEffect, - useState, - useMemo, - useCallback, - useEffect, -} from 'react'; +import React, { useLayoutEffect, useState, useMemo, useCallback } from 'react'; import { SignInPageProps, useApi, @@ -39,7 +33,9 @@ import { customProvider } from './customProvider'; import { IdentityApiSignOutProxy } from './IdentityApiSignOutProxy'; import { useSearchParams } from 'react-router-dom'; import { useMountEffect } from '@react-hookz/web'; -import { useSignInAuthError } from '@backstage/plugin-auth-react'; +import { ForwardedError } from '@backstage/errors'; +import { coreComponentsTranslationRef } from '../../translation'; +import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; const PROVIDER_STORAGE_KEY = '@backstage/core:SignInPage:provider'; @@ -95,21 +91,23 @@ export const useSignInProviders = ( ) => { const errorApi = useApi(errorApiRef); const apiHolder = useApiHolder(); - const { error: signInError, checkAuthError } = useSignInAuthError(); const [loading, setLoading] = useState(true); + const { t } = useTranslationRef(coreComponentsTranslationRef); // User was redirected back to sign in page with error from auth redirect flow const [searchParams, _setSearchParams] = useSearchParams(); - const errorParam = searchParams.get('error'); - const hasErrorSearchParam = errorParam !== 'false' && errorParam !== null; - useMountEffect(() => hasErrorSearchParam && checkAuthError()); - - useEffect(() => { - if (signInError) { - errorApi.post(signInError); + useMountEffect(() => { + const errorParam = searchParams.get('error'); + if (errorParam) { + errorApi.post( + new ForwardedError(t('signIn.loginFailed'), { + name: 'Error', + message: decodeURIComponent(errorParam), + }), + ); } - }, [errorApi, signInError]); + }); // This decorates the result with sign out logic from this hook const handleWrappedResult = useCallback( diff --git a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts deleted file mode 100644 index f0c547842a..0000000000 --- a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2024 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 express from 'express'; -import request from 'supertest'; -import cookieParser from 'cookie-parser'; -import { createCookieAuthErrorMiddleware } from './createCookieAuthErrorMiddleware'; - -const AUTH_ERROR_COOKIE = 'auth-error'; - -describe('createCookieAuthErrorMiddleware', () => { - let app: express.Express; - - beforeEach(() => { - app = express(); - app.use(express.json()); - app.use(express.urlencoded({ extended: true })); - - app.use(cookieParser()); - - app.use( - createCookieAuthErrorMiddleware( - 'http://localhost:3000', - 'http://localhost:7000', - ), - ); - }); - - it('should return cookie content if error cookie exists', async () => { - const error = 'test'; - const res = await request(app) - .get('/.backstage/error') - .set('Cookie', `${AUTH_ERROR_COOKIE}=${encodeURIComponent(error)}`); - - expect(res.status).toBe(200); - expect(res.body).toEqual('test'); - }); - - it('should return 404 if error cookie does not exist', async () => { - const res = await request(app).get('/.backstage/error'); - expect(res.status).toBe(404); - }); -}); diff --git a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts b/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts deleted file mode 100644 index 30724fc3cd..0000000000 --- a/plugins/auth-backend/src/service/createCookieAuthErrorMiddleware.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2024 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 Router from 'express-promise-router'; - -const AUTH_ERROR_COOKIE = 'auth-error'; - -/** - * @public - * Creates a middleware that can be used to get auth errors in redirect flow - */ -export function createCookieAuthErrorMiddleware( - appUrl: string, - authUrl: string, -) { - const router = Router(); - - router.get('/.backstage/error', async (req, res) => { - const error = req.cookies[AUTH_ERROR_COOKIE]; - if (error) { - const { hostname: domain, protocol } = new URL(authUrl); - const secure = protocol === 'https:'; - const sameSite = - new URL(appUrl).hostname !== domain && secure ? 'none' : 'lax'; - - res.clearCookie(AUTH_ERROR_COOKIE, { - path: '/api/auth/.backstage/error', - domain, - sameSite, - secure, - }); - res.status(200).json(error); - } else { - res.status(404).end(); - } - }); - - return router; -} diff --git a/plugins/auth-backend/src/service/router.ts b/plugins/auth-backend/src/service/router.ts index 57f01cfba1..4bb42c3abd 100644 --- a/plugins/auth-backend/src/service/router.ts +++ b/plugins/auth-backend/src/service/router.ts @@ -48,7 +48,6 @@ import { StaticTokenIssuer } from '../identity/StaticTokenIssuer'; import { StaticKeyStore } from '../identity/StaticKeyStore'; import { Config } from '@backstage/config'; import { bindProviderRouters, ProviderFactories } from '../providers/router'; -import { createCookieAuthErrorMiddleware } from './createCookieAuthErrorMiddleware'; /** @public */ export interface RouterOptions { @@ -170,8 +169,6 @@ export async function createRouter( userInfoDatabaseHandler, }); - router.use(createCookieAuthErrorMiddleware(appUrl, authUrl)); - // Gives a more helpful error message than a plain 404 router.use('/:provider/', req => { const { provider } = req.params; diff --git a/plugins/auth-node/src/oauth/createAuthErrorCookie.ts b/plugins/auth-node/src/oauth/createAuthErrorCookie.ts deleted file mode 100644 index 46ef4c4a1c..0000000000 --- a/plugins/auth-node/src/oauth/createAuthErrorCookie.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2024 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 { Response } from 'express'; -import { serializeError } from '@backstage/errors'; - -const ONE_MINUTE_MS = 60 * 1000; - -const AUTH_ERROR_COOKIE = 'auth-error'; - -function configureAuthErrorCookie(apiUrl: string, appOrigin: string) { - const { hostname: domain, pathname: path, protocol } = new URL(apiUrl); - const secure = protocol === 'https:'; - - // For situations where the auth-backend is running on a - // different domain than the app, we set the SameSite attribute - // to 'none' to allow third-party access to the cookie, but - // only if it's in a secure context (https). - let sameSite: 'lax' | 'none' = 'lax'; - if (new URL(appOrigin).hostname !== domain && secure) { - sameSite = 'none'; - } - - return { domain, path, secure, sameSite }; -} - -export function createAuthErrorCookie( - res: Response, - origin: string, - options: { - error: Error; - apiUrl: string; - }, -) { - const { error, apiUrl } = options; - const jsonData = serializeError(error); - - res.cookie(AUTH_ERROR_COOKIE, jsonData, { - maxAge: ONE_MINUTE_MS, - httpOnly: true, - ...configureAuthErrorCookie(apiUrl, origin), - }); -} diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts index b54de50881..e2155df444 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts @@ -743,7 +743,7 @@ describe('createOAuthRouteHandlers', () => { }); }); - it('should set cookie and redirect on caught error', async () => { + it('should set error search param and redirect on caught error', async () => { const app = wrapInApp(createOAuthRouteHandlers(baseConfig)); const res = await request(app) .get('/my-provider/handler/frame') @@ -756,15 +756,21 @@ describe('createOAuthRouteHandlers', () => { }), }); - // redirects on error with auth error cookie + // Check if it redirects on error expect(res.status).toBe(302); - const setCookieHeader = res.header['set-cookie']; - expect(setCookieHeader).toBeDefined(); - const authErrorCookie = setCookieHeader.find((cookie: string) => - cookie.startsWith('auth-error='), + // Extract the redirect URL from the location header + const redirectLocation = res.header.location; + expect(redirectLocation).toBeDefined(); + + // Create a URL object from the redirect location + const redirectUrl = new URL(redirectLocation); + + // Verify that the 'error' search param is set with the encoded error message + const errorMessage = redirectUrl.searchParams.get('error'); + expect(errorMessage).toBe( + encodeURIComponent('Auth response is missing cookie nonce'), ); - expect(authErrorCookie).toBeDefined(); }); }); }); diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts index 847dc4844f..46f8fc3eca 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts @@ -42,7 +42,6 @@ import { import { OAuthAuthenticator, OAuthAuthenticatorResult } from './types'; import { Config } from '@backstage/config'; import { CookieScopeManager } from './CookieScopeManager'; -import { createAuthErrorCookie } from './createAuthErrorCookie'; /** @public */ export interface OAuthRouteHandlersOptions { @@ -252,13 +251,8 @@ export function createOAuthRouteHandlers( : new Error('Encountered invalid error'); // Being a bit safe and not forwarding the bad value if (state?.flow === 'redirect' && state?.redirectUrl) { - createAuthErrorCookie(res, state?.redirectUrl, { - error: { name, message }, - apiUrl: `${baseUrl}/.backstage/error`, - }); - const redirectUrl = new URL(state.redirectUrl); - redirectUrl.searchParams.set('error', 'true'); + redirectUrl.searchParams.set('error', encodeURIComponent(message)); // set the error in a cookie and redirect user back to sign in where the error can be rendered res.redirect(redirectUrl.toString()); diff --git a/plugins/auth-react/api-report.md b/plugins/auth-react/api-report.md index 52e6c6bc3a..d5206261d2 100644 --- a/plugins/auth-react/api-report.md +++ b/plugins/auth-react/api-report.md @@ -36,10 +36,4 @@ export function useCookieAuthRefresh(options: { pluginId: string }): expiresAt: string; }; }; - -// @public -export function useSignInAuthError(): { - error: Error | undefined; - checkAuthError: () => void; -}; ``` diff --git a/plugins/auth-react/src/hooks/index.ts b/plugins/auth-react/src/hooks/index.ts index 0e87bab67f..1257334498 100644 --- a/plugins/auth-react/src/hooks/index.ts +++ b/plugins/auth-react/src/hooks/index.ts @@ -18,4 +18,3 @@ // which hooks are public API and should be exported from the package. export * from './useCookieAuthRefresh'; -export * from './useSignInAuthError'; diff --git a/plugins/auth-react/src/hooks/useSignInAuthError/index.tsx b/plugins/auth-react/src/hooks/useSignInAuthError/index.tsx deleted file mode 100644 index 549b5b9f1f..0000000000 --- a/plugins/auth-react/src/hooks/useSignInAuthError/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { useSignInAuthError } from './useSignInAuthError'; diff --git a/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx deleted file mode 100644 index 0c67c419f8..0000000000 --- a/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.test.tsx +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2024 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 { act, renderHook } from '@testing-library/react'; -import { discoveryApiRef } from '@backstage/core-plugin-api'; -import { TestApiProvider } from '@backstage/test-utils'; -import { useSignInAuthError } from './useSignInAuthError'; -import { serializeError } from '@backstage/errors'; - -describe('useSignInAuthError', () => { - const discoveryApiMock = { - getBaseUrl: jest.fn().mockResolvedValue('http://localhost:7000/api/auth'), - }; - - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('should return an error when the cookie returns an error object', async () => { - const errorObject = { - name: 'TestError', - message: 'This is a test error', - }; - const serializedError = serializeError(errorObject); - - global.fetch = jest.fn().mockResolvedValue({ - ok: true, - json: jest.fn().mockResolvedValue(serializedError), - } as unknown as Response); - - const { result } = renderHook(() => useSignInAuthError(), { - wrapper: ({ children }) => ( - - {children} - - ), - }); - - await act(async () => { - result.current.checkAuthError(); - }); - - expect(discoveryApiMock.getBaseUrl).toHaveBeenCalledWith('auth'); - expect(fetch).toHaveBeenCalledWith( - 'http://localhost:7000/api/auth/.backstage/error', - { - credentials: 'include', - }, - ); - expect(result.current.error).toBeInstanceOf(Error); - expect((result.current.error as Error).name).toEqual(errorObject.name); - expect((result.current.error as Error).message).toEqual( - errorObject.message, - ); - }); - - it('should return undefined when the backend does not return an error object', async () => { - global.fetch = jest.fn().mockResolvedValue({ - ok: true, - json: jest.fn().mockResolvedValue(undefined), - } as unknown as Response); - - const { result } = renderHook(() => useSignInAuthError(), { - wrapper: ({ children }) => ( - - {children} - - ), - }); - - await act(async () => { - result.current.checkAuthError(); - }); - - expect(discoveryApiMock.getBaseUrl).toHaveBeenCalledWith('auth'); - expect(fetch).toHaveBeenCalledWith( - 'http://localhost:7000/api/auth/.backstage/error', - { - credentials: 'include', - }, - ); - expect(result.current.error).toBeUndefined(); - }); -}); diff --git a/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx b/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx deleted file mode 100644 index fe146fedca..0000000000 --- a/plugins/auth-react/src/hooks/useSignInAuthError/useSignInAuthError.tsx +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2024 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 { discoveryApiRef, useApi } from '@backstage/core-plugin-api'; -import { useAsync } from '@react-hookz/web'; -import { deserializeError } from '@backstage/errors'; - -/** - * @public - * A hook that will fetch any sign in auth error in redirect auth flow - */ -export function useSignInAuthError(): { - error: Error | undefined; - checkAuthError: () => void; -} { - const discoveryApi = useApi(discoveryApiRef); - - const [state, { execute: checkAuthError }] = useAsync(async () => { - const baseUrl = await discoveryApi.getBaseUrl('auth'); - - // use native fetch instead of fetchApi because - // we are not signed in and are calling an unauthenticated endpoint - const response = await fetch(`${baseUrl}/.backstage/error`, { - credentials: 'include', - }); - const data = await response.json(); - - return data ? deserializeError(data) : undefined; - }); - - return { error: state.result, checkAuthError }; -} diff --git a/yarn.lock b/yarn.lock index dfd1cffd9e..155c0eeb9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4287,7 +4287,6 @@ __metadata: "@backstage/core-app-api": "workspace:^" "@backstage/core-plugin-api": "workspace:^" "@backstage/errors": "workspace:^" - "@backstage/plugin-auth-react": "workspace:^" "@backstage/test-utils": "workspace:^" "@backstage/theme": "workspace:^" "@backstage/version-bridge": "workspace:^" From 065f5a5624a35ce1156c4c35df78cc2f63b72391 Mon Sep 17 00:00:00 2001 From: JeevaRamanathan <64531160+JeevaRamanathan@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:59:26 +0530 Subject: [PATCH 038/268] Update contribute docs Signed-off-by: JeevaRamanathan <64531160+JeevaRamanathan@users.noreply.github.com> --- docs/contribute/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contribute/index.md b/docs/contribute/index.md index 34ed1561cb..627a2ff0d0 100644 --- a/docs/contribute/index.md +++ b/docs/contribute/index.md @@ -5,9 +5,9 @@ title: Contributors description: Documentation on how to get set up for doing development on the Backstage repository --- -Our vision for Backstage is for it to become the trusted standard toolbox (read: UX layer) for the open source infrastructure landscape. Think of it like Kubernetes for developer experience. We realize this is an ambitious goal. We can’t do it alone. +Our vision for Backstage is for it to become the trusted standard toolbox (read: UX layer) for the open source infrastructure landscape. Think of it like Kubernetes for developer experience. We realize this is an ambitious goal and we can’t do it alone. -Therefore we want to create a strong community of contributors -- all working together to create the kind of delightful experience that our developers deserve. +Therefore, we want to create a strong community of contributors — all working together to create the kind of delightful experience that our developers deserve. Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. ❤️ From b1de959466b25344a53350bd467049262f2f14ae Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Wed, 2 Oct 2024 23:42:31 -0400 Subject: [PATCH 039/268] disable task list routes without permission Signed-off-by: Stephen Glass --- .changeset/quiet-lions-lie.md | 6 ++++++ .../ScaffolderPageContextMenu.tsx | 8 +++++++- .../scaffolder/src/components/Router/Router.tsx | 16 ++++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 .changeset/quiet-lions-lie.md diff --git a/.changeset/quiet-lions-lie.md b/.changeset/quiet-lions-lie.md new file mode 100644 index 0000000000..4aa6567005 --- /dev/null +++ b/.changeset/quiet-lions-lie.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder-react': patch +'@backstage/plugin-scaffolder': patch +--- + +Scaffolder task routes require read permission to access. The tasks list option in the scaffolder page context menu only shows with permission. diff --git a/plugins/scaffolder-react/src/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.tsx b/plugins/scaffolder-react/src/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.tsx index 12ca4135f0..23b34123d1 100644 --- a/plugins/scaffolder-react/src/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.tsx +++ b/plugins/scaffolder-react/src/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.tsx @@ -27,6 +27,8 @@ import Edit from '@material-ui/icons/Edit'; import List from '@material-ui/icons/List'; import MoreVert from '@material-ui/icons/MoreVert'; import React, { useState } from 'react'; +import { usePermission } from '@backstage/plugin-permission-react'; +import { taskReadPermission } from '@backstage/plugin-scaffolder-common/alpha'; const useStyles = makeStyles(theme => ({ button: { @@ -55,6 +57,10 @@ export function ScaffolderPageContextMenu( const classes = useStyles(); const [anchorEl, setAnchorEl] = useState(); + const { allowed: canReadTasks } = usePermission({ + permission: taskReadPermission, + }); + if (!onEditorClicked && !onActionsClicked) { return null; } @@ -116,7 +122,7 @@ export function ScaffolderPageContextMenu( )} - {onTasksClicked && ( + {onTasksClicked && canReadTasks && ( diff --git a/plugins/scaffolder/src/components/Router/Router.tsx b/plugins/scaffolder/src/components/Router/Router.tsx index 5766e3d043..1121fd2766 100644 --- a/plugins/scaffolder/src/components/Router/Router.tsx +++ b/plugins/scaffolder/src/components/Router/Router.tsx @@ -59,6 +59,8 @@ import { TemplateEditorPage, CustomFieldsPage, } from '../../alpha/components/TemplateEditorPage'; +import { RequirePermission } from '@backstage/plugin-permission-react'; +import { taskReadPermission } from '@backstage/plugin-scaffolder-common/alpha'; /** * The Props for the Scaffolder Router @@ -162,9 +164,11 @@ export const Router = (props: PropsWithChildren) => { + + + } /> ) => { } /> } + element={ + + + + } /> Date: Wed, 2 Oct 2024 23:59:36 -0400 Subject: [PATCH 040/268] add tests Signed-off-by: Stephen Glass --- .../src/components/ActionsPage/ActionsPage.test.tsx | 7 ++++++- .../src/components/ListTasksPage/ListTaskPage.test.tsx | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx index bf056dd3b3..acfdabac5b 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.test.tsx @@ -23,6 +23,7 @@ import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils'; import { ApiProvider } from '@backstage/core-app-api'; import { rootRouteRef } from '../../routes'; import { userEvent } from '@testing-library/user-event'; +import { permissionApiRef } from '@backstage/plugin-permission-react'; const scaffolderApiMock: jest.Mocked = { scaffold: jest.fn(), @@ -36,7 +37,11 @@ const scaffolderApiMock: jest.Mocked = { autocomplete: jest.fn(), }; -const apis = TestApiRegistry.from([scaffolderApiRef, scaffolderApiMock]); +const mockPermissionApi = { authorize: jest.fn() }; +const apis = TestApiRegistry.from( + [scaffolderApiRef, scaffolderApiMock], + [permissionApiRef, mockPermissionApi], +); describe('TemplatePage', () => { beforeEach(() => jest.resetAllMocks()); diff --git a/plugins/scaffolder/src/components/ListTasksPage/ListTaskPage.test.tsx b/plugins/scaffolder/src/components/ListTasksPage/ListTaskPage.test.tsx index f7f75bc3e8..ad3ca7fbde 100644 --- a/plugins/scaffolder/src/components/ListTasksPage/ListTaskPage.test.tsx +++ b/plugins/scaffolder/src/components/ListTasksPage/ListTaskPage.test.tsx @@ -30,6 +30,7 @@ import { } from '@backstage/plugin-scaffolder-react'; import { act, fireEvent } from '@testing-library/react'; import { rootRouteRef } from '../../routes'; +import { permissionApiRef } from '@backstage/plugin-permission-react'; describe('', () => { const catalogApi: jest.Mocked = { @@ -49,6 +50,8 @@ describe('', () => { listTasks: jest.fn(), } as any; + const mockPermissionApi = { authorize: jest.fn() }; + it('should render the page', async () => { const entity: Entity = { apiVersion: 'v1', @@ -72,6 +75,7 @@ describe('', () => { [catalogApiRef, catalogApi], [identityApiRef, identityApi], [scaffolderApiRef, scaffolderApiMock], + [permissionApiRef, mockPermissionApi], ]} > @@ -132,6 +136,7 @@ describe('', () => { [catalogApiRef, catalogApi], [identityApiRef, identityApi], [scaffolderApiRef, scaffolderApiMock], + [permissionApiRef, mockPermissionApi], ]} > @@ -230,6 +235,7 @@ describe('', () => { [catalogApiRef, catalogApi], [identityApiRef, identityApi], [scaffolderApiRef, scaffolderApiMock], + [permissionApiRef, mockPermissionApi], ]} > From f1994b501075e84e83ca8dc9c6935e2389ac43b5 Mon Sep 17 00:00:00 2001 From: nikolar Date: Thu, 3 Oct 2024 15:05:41 -0700 Subject: [PATCH 041/268] move template buttons Signed-off-by: nikolar --- .../scaffolder-react/src/next/components/Stepper/Stepper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx index a1b31d0089..3809132707 100644 --- a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx +++ b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx @@ -63,7 +63,7 @@ const useStyles = makeStyles(theme => ({ footer: { display: 'flex', flexDirection: 'row', - justifyContent: 'right', + justifyContent: 'left', marginTop: theme.spacing(2), }, formWrapper: { From 341e5db3c1635ad6d90e6581dba80423b56b2d80 Mon Sep 17 00:00:00 2001 From: nikolar Date: Thu, 3 Oct 2024 15:18:47 -0700 Subject: [PATCH 042/268] add changeset Signed-off-by: nikolar --- .changeset/breezy-berries-yawn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/breezy-berries-yawn.md diff --git a/.changeset/breezy-berries-yawn.md b/.changeset/breezy-berries-yawn.md new file mode 100644 index 0000000000..beb1053034 --- /dev/null +++ b/.changeset/breezy-berries-yawn.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-react': patch +--- + +Update template form buttons from `justifyContent` 'right' to `justifyContent` 'left' From cfa2b0e4f93c898165177be592c33ec2e1d25c54 Mon Sep 17 00:00:00 2001 From: nikolar Date: Fri, 4 Oct 2024 11:09:20 -0700 Subject: [PATCH 043/268] update to just add overridable class Signed-off-by: nikolar --- .changeset/breezy-berries-yawn.md | 2 +- .../src/next/components/Stepper/Stepper.tsx | 36 +++++++++++-------- .../src/next/overridableComponents.ts | 2 ++ 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.changeset/breezy-berries-yawn.md b/.changeset/breezy-berries-yawn.md index beb1053034..0ef4fa68e7 100644 --- a/.changeset/breezy-berries-yawn.md +++ b/.changeset/breezy-berries-yawn.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder-react': patch --- -Update template form buttons from `justifyContent` 'right' to `justifyContent` 'left' +Add `overridableComponent` `BackstageTemplateStepperClassKey` to template stepper to enable custom styling diff --git a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx index 3809132707..41e1fd7967 100644 --- a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx +++ b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx @@ -56,20 +56,28 @@ import { merge } from 'lodash'; const validator = customizeValidator(); ajvErrors(validator.ajv); -const useStyles = makeStyles(theme => ({ - backButton: { - marginRight: theme.spacing(1), - }, - footer: { - display: 'flex', - flexDirection: 'row', - justifyContent: 'left', - marginTop: theme.spacing(2), - }, - formWrapper: { - padding: theme.spacing(2), - }, -})); +export type BackstageTemplateStepperClassKey = + | 'backButton' + | 'footer' + | 'formWrapper'; + +const useStyles = makeStyles( + theme => ({ + backButton: { + marginRight: theme.spacing(1), + }, + footer: { + display: 'flex', + flexDirection: 'row', + justifyContent: 'right', + marginTop: theme.spacing(2), + }, + formWrapper: { + padding: theme.spacing(2), + }, + }), + { name: 'BackstageTemplateStepper' }, +); /** * The Props for {@link Stepper} component diff --git a/plugins/scaffolder-react/src/next/overridableComponents.ts b/plugins/scaffolder-react/src/next/overridableComponents.ts index 56986d4f80..2045496166 100644 --- a/plugins/scaffolder-react/src/next/overridableComponents.ts +++ b/plugins/scaffolder-react/src/next/overridableComponents.ts @@ -17,10 +17,12 @@ import { Overrides } from '@material-ui/core/styles/overrides'; import { StyleRules } from '@material-ui/core/styles/withStyles'; import { ScaffolderReactTemplateCategoryPickerClassKey } from './components/TemplateCategoryPicker/TemplateCategoryPicker'; +import { BackstageTemplateStepperClassKey } from './components/Stepper/Stepper'; /** @alpha */ export type ScaffolderReactComponentsNameToClassKey = { ScaffolderReactTemplateCategoryPicker: ScaffolderReactTemplateCategoryPickerClassKey; + BackstageTemplateStepper: BackstageTemplateStepperClassKey; }; /** @alpha */ From 20950e6e2d10f6531c8987fa47fb2e65f93c4190 Mon Sep 17 00:00:00 2001 From: nikolar Date: Fri, 4 Oct 2024 11:41:57 -0700 Subject: [PATCH 044/268] add api report Signed-off-by: nikolar --- plugins/scaffolder-react/report-alpha.api.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/scaffolder-react/report-alpha.api.md b/plugins/scaffolder-react/report-alpha.api.md index 75c6d08e32..7f420f353c 100644 --- a/plugins/scaffolder-react/report-alpha.api.md +++ b/plugins/scaffolder-react/report-alpha.api.md @@ -200,11 +200,18 @@ export type ScaffolderPageContextMenuProps = { // @alpha (undocumented) export type ScaffolderReactComponentsNameToClassKey = { ScaffolderReactTemplateCategoryPicker: ScaffolderReactTemplateCategoryPickerClassKey; + BackstageTemplateStepper: BackstageTemplateStepperClassKey; }; // @alpha (undocumented) export type ScaffolderReactTemplateCategoryPickerClassKey = 'root' | 'label'; +// @alpha (undocumented) +export type BackstageTemplateStepperClassKey = + | 'backButton' + | 'footer' + | 'formWrapper'; + // @alpha export const SecretWidget: ( props: Pick< @@ -416,8 +423,9 @@ export type WorkflowProps = { // src/next/hooks/useTemplateSchema.d.ts:12:5 - (ae-undocumented) Missing documentation for "schema". // src/next/hooks/useTemplateSchema.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". // src/next/hooks/useTemplateSchema.d.ts:14:5 - (ae-undocumented) Missing documentation for "description". -// src/next/overridableComponents.d.ts:5:1 - (ae-undocumented) Missing documentation for "ScaffolderReactComponentsNameToClassKey". -// src/next/overridableComponents.d.ts:9:1 - (ae-undocumented) Missing documentation for "BackstageOverrides". +// src/next/overridableComponents.d.ts:6:1 - (ae-undocumented) Missing documentation for "ScaffolderReactComponentsNameToClassKey". +// src/next/overridableComponents.d.ts:8:5 - (ae-forgotten-export) The symbol "BackstageTemplateStepperClassKey" needs to be exported by the entry point alpha.d.ts +// src/next/overridableComponents.d.ts:11:1 - (ae-undocumented) Missing documentation for "BackstageOverrides". // (No @packageDocumentation comment for this package) ``` From e118355dfddfbd5372e5d3fbc5ee87cd3e8233fd Mon Sep 17 00:00:00 2001 From: nikolar Date: Fri, 4 Oct 2024 13:55:29 -0700 Subject: [PATCH 045/268] fix api report Signed-off-by: nikolar --- plugins/scaffolder-react/report-alpha.api.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugins/scaffolder-react/report-alpha.api.md b/plugins/scaffolder-react/report-alpha.api.md index 7f420f353c..e15ee181d2 100644 --- a/plugins/scaffolder-react/report-alpha.api.md +++ b/plugins/scaffolder-react/report-alpha.api.md @@ -206,12 +206,6 @@ export type ScaffolderReactComponentsNameToClassKey = { // @alpha (undocumented) export type ScaffolderReactTemplateCategoryPickerClassKey = 'root' | 'label'; -// @alpha (undocumented) -export type BackstageTemplateStepperClassKey = - | 'backButton' - | 'footer' - | 'formWrapper'; - // @alpha export const SecretWidget: ( props: Pick< From fb5eaf18c3da16e62a312861cf76868b53b5be35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veith=20M=2E=20B=C3=BCrgerhoff?= <62615322+VeithBuergerhoff@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:43:39 +0200 Subject: [PATCH 046/268] Update docs/features/software-templates/writing-templates.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Camila Belo Signed-off-by: Veith M. Bürgerhoff <62615322+VeithBuergerhoff@users.noreply.github.com> --- docs/features/software-templates/writing-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 2cc14f1000..7349ff94e0 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -814,7 +814,7 @@ These properties accept a `Record` ``` where the first parameter is the identifier of the filter or global and the second is a `TemplateFilter` or a `TemplateGlobal` respectively. -A `TemplateFilter` is a function which will be called using the previous `JsonValue` objets and may return a `JsonValue` object. +A `TemplateFilter` is a function which will be called using the previous `JsonValue` objects and may return a `JsonValue` object. A `TemplateGlobal` can either be a function which will be called using the passed `JsonValue` objects and may return a `JsonValue` object or it can be a `JsonValue` object itself. ```ts title="plugins/scaffolder-node/src/types.ts" From 80b9af5068f729b532d624845bfac684f738bb45 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 07:13:31 +0000 Subject: [PATCH 047/268] fix(deps): update dependency @rollup/plugin-commonjs to v26.0.3 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f5184e9149..ab92917ed3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14835,8 +14835,8 @@ __metadata: linkType: hard "@rollup/plugin-commonjs@npm:^26.0.0": - version: 26.0.1 - resolution: "@rollup/plugin-commonjs@npm:26.0.1" + version: 26.0.3 + resolution: "@rollup/plugin-commonjs@npm:26.0.3" dependencies: "@rollup/pluginutils": ^5.0.1 commondir: ^1.0.1 @@ -14849,7 +14849,7 @@ __metadata: peerDependenciesMeta: rollup: optional: true - checksum: 88d1349cc2cda4ad6193cce901356e4c14a830497fc01c91f38c94a871b203ffe657b29c9a98cd16787e3a6a8b45169dd0b471cb36d26d645478a177c958779a + checksum: 6f3ce53054f9b2edfd04a673c7572b5f8ba6b8416da55a7aef670a9b4630caf46e3e8d74b481d05e1d9f9cb98fa96228e23abad10ab2c95a6cc0b1a0065568e6 languageName: node linkType: hard From e6c05502d558bfbe96ac5028963dd58cb3171fea Mon Sep 17 00:00:00 2001 From: David Festal Date: Mon, 23 Sep 2024 16:23:06 +0200 Subject: [PATCH 048/268] refactor(backend-dynamic-feature-service): better load failure management... ... and other small enhancements (e.g. ability to get the `ScannedPluginPackage` of a loaded plugin). Signed-off-by: David Festal --- .changeset/kind-avocados-speak.md | 8 + package.json | 1 + .../report.api.md | 154 ++++---- .../src/manager/plugin-manager.test.ts | 341 ++++++++++++++++-- .../src/manager/plugin-manager.ts | 135 ++++--- .../src/manager/types.ts | 11 +- yarn.lock | 1 + 7 files changed, 498 insertions(+), 153 deletions(-) create mode 100644 .changeset/kind-avocados-speak.md diff --git a/.changeset/kind-avocados-speak.md b/.changeset/kind-avocados-speak.md new file mode 100644 index 0000000000..b57d271907 --- /dev/null +++ b/.changeset/kind-avocados-speak.md @@ -0,0 +1,8 @@ +--- +'@backstage/backend-dynamic-feature-service': patch +--- + +Enhance the API of the `DynamicPluginProvider` (available as a service) to: + +- expose the new `getScannedPackage()` method that returns the `ScannedPluginPackage` from which a given plugin has been loaded, +- add an optional `includeFailed` argument in the plugins list retrieval methods, to include the plugins that could be successfully loaded (`false` by default). diff --git a/package.json b/package.json index 425b1c1a38..4826bcd56b 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ "jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch" }, "dependencies": { + "@backstage/cli-node": "workspace:^", "@backstage/errors": "workspace:^", "@manypkg/get-packages": "^1.1.3", "@types/global-agent": "^2.1.3", diff --git a/packages/backend-dynamic-feature-service/report.api.md b/packages/backend-dynamic-feature-service/report.api.md index 9170fedf43..615b053869 100644 --- a/packages/backend-dynamic-feature-service/report.api.md +++ b/packages/backend-dynamic-feature-service/report.api.md @@ -33,11 +33,12 @@ import { ServiceRef } from '@backstage/backend-plugin-api'; import { TemplateAction } from '@backstage/plugin-scaffolder-node'; import { TokenManager } from '@backstage/backend-common'; import { UrlReaderService } from '@backstage/backend-plugin-api'; +import { WinstonLoggerOptions } from '@backstage/backend-defaults/rootLogger'; // @public (undocumented) export interface BackendDynamicPlugin extends BaseDynamicPlugin { // (undocumented) - installer: BackendDynamicPluginInstaller; + installer?: BackendDynamicPluginInstaller; // (undocumented) platform: 'node'; } @@ -50,11 +51,13 @@ export type BackendDynamicPluginInstaller = // @public (undocumented) export interface BackendPluginProvider { // (undocumented) - backendPlugins(): BackendDynamicPlugin[]; + backendPlugins(includeFailed?: boolean): BackendDynamicPlugin[]; } // @public (undocumented) export interface BaseDynamicPlugin { + // (undocumented) + failure?: string; // (undocumented) name: string; // (undocumented) @@ -75,15 +78,17 @@ export class DynamicPluginManager implements DynamicPluginProvider { // (undocumented) get availablePackages(): ScannedPluginPackage[]; // (undocumented) - backendPlugins(): BackendDynamicPlugin[]; + backendPlugins(includeFailed?: boolean): BackendDynamicPlugin[]; // (undocumented) static create( options: DynamicPluginManagerOptions, ): Promise; // (undocumented) - frontendPlugins(): FrontendDynamicPlugin[]; + frontendPlugins(includeFailed?: boolean): FrontendDynamicPlugin[]; // (undocumented) - plugins(): DynamicPlugin[]; + getScannedPackage(plugin: DynamicPlugin): ScannedPluginPackage; + // (undocumented) + plugins(includeFailed?: boolean): DynamicPlugin[]; } // @public (undocumented) @@ -103,20 +108,19 @@ export interface DynamicPluginProvider extends FrontendPluginProvider, BackendPluginProvider { // (undocumented) - plugins(): DynamicPlugin[]; + getScannedPackage(plugin: DynamicPlugin): ScannedPluginPackage; + // (undocumented) + plugins(includeFailed?: boolean): DynamicPlugin[]; } // @public (undocumented) export interface DynamicPluginsFactoryOptions { // (undocumented) - moduleLoader?(logger: LoggerService): ModuleLoader; + moduleLoader?(logger: LoggerService): ModuleLoader | Promise; } -// @public -export const dynamicPluginsFeatureDiscoveryLoader: (( - options?: DynamicPluginsFactoryOptions, -) => BackendFeature) & - BackendFeature; +// @public @deprecated (undocumented) +export const dynamicPluginsFeatureDiscoveryLoader: BackendFeature; // @public @deprecated (undocumented) export const dynamicPluginsFeatureDiscoveryServiceFactory: ServiceFactory< @@ -125,16 +129,32 @@ export const dynamicPluginsFeatureDiscoveryServiceFactory: ServiceFactory< 'singleton' >; +// @public +export const dynamicPluginsFeatureLoader: (( + options?: DynamicPluginsFeatureLoaderOptions, +) => BackendFeature) & + BackendFeature; + // @public (undocumented) +export type DynamicPluginsFeatureLoaderOptions = DynamicPluginsFactoryOptions & + DynamicPluginsSchemasOptions & + DynamicPluginsRootLoggerFactoryOptions; + +// @public @deprecated (undocumented) export const dynamicPluginsFrontendSchemas: BackendFeature; // @public (undocumented) -export const dynamicPluginsRootLoggerServiceFactory: ServiceFactory< - RootLoggerService, - 'root', - 'singleton' +export type DynamicPluginsRootLoggerFactoryOptions = Omit< + WinstonLoggerOptions, + 'meta' >; +// @public @deprecated (undocumented) +export const dynamicPluginsRootLoggerServiceFactory: (( + options?: DynamicPluginsRootLoggerFactoryOptions, +) => ServiceFactory) & + ServiceFactory; + // @public (undocumented) export interface DynamicPluginsSchemasOptions { schemaLocator?: (pluginPackage: ScannedPluginPackage) => string; @@ -148,31 +168,24 @@ export interface DynamicPluginsSchemasService { }>; } -// @public (undocumented) -export const dynamicPluginsSchemasServiceFactory: ServiceFactory< - DynamicPluginsSchemasService, - 'root', - 'singleton' ->; - -// @public (undocumented) -export const dynamicPluginsSchemasServiceFactoryWithOptions: ( +// @public @deprecated (undocumented) +export const dynamicPluginsSchemasServiceFactory: (( options?: DynamicPluginsSchemasOptions, -) => ServiceFactory; +) => ServiceFactory) & + ServiceFactory; // @public @deprecated (undocumented) -export const dynamicPluginsServiceFactory: ServiceFactory< - DynamicPluginProvider, - 'root', - 'singleton' ->; +export const dynamicPluginsServiceFactory: (( + options?: DynamicPluginsFactoryOptions, +) => ServiceFactory) & + ServiceFactory; // @public @deprecated (undocumented) export const dynamicPluginsServiceFactoryWithOptions: ( options?: DynamicPluginsFactoryOptions, ) => ServiceFactory; -// @public @deprecated (undocumented) +// @public (undocumented) export const dynamicPluginsServiceRef: ServiceRef< DynamicPluginProvider, 'root', @@ -188,7 +201,7 @@ export interface FrontendDynamicPlugin extends BaseDynamicPlugin { // @public (undocumented) export interface FrontendPluginProvider { // (undocumented) - frontendPlugins(): FrontendDynamicPlugin[]; + frontendPlugins(includeFailed?: boolean): FrontendDynamicPlugin[]; } // @public (undocumented) @@ -278,6 +291,7 @@ export interface ScannedPluginPackage { // Warnings were encountered during analysis: // +// src/features/features.d.ts:7:1 - (ae-undocumented) Missing documentation for "DynamicPluginsFeatureLoaderOptions". // src/loader/types.d.ts:4:1 - (ae-undocumented) Missing documentation for "ModuleLoader". // src/loader/types.d.ts:5:5 - (ae-undocumented) Missing documentation for "bootstrap". // src/loader/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "load". @@ -293,54 +307,58 @@ export interface ScannedPluginPackage { // src/manager/plugin-manager.d.ts:31:5 - (ae-undocumented) Missing documentation for "backendPlugins". // src/manager/plugin-manager.d.ts:32:5 - (ae-undocumented) Missing documentation for "frontendPlugins". // src/manager/plugin-manager.d.ts:33:5 - (ae-undocumented) Missing documentation for "plugins". +// src/manager/plugin-manager.d.ts:34:5 - (ae-undocumented) Missing documentation for "getScannedPackage". // src/manager/plugin-manager.d.ts:39:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceRef". // src/manager/plugin-manager.d.ts:43:1 - (ae-undocumented) Missing documentation for "DynamicPluginsFactoryOptions". // src/manager/plugin-manager.d.ts:44:5 - (ae-undocumented) Missing documentation for "moduleLoader". // src/manager/plugin-manager.d.ts:50:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceFactoryWithOptions". // src/manager/plugin-manager.d.ts:55:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceFactory". // src/manager/plugin-manager.d.ts:60:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFeatureDiscoveryServiceFactory". -// src/manager/types.d.ts:27:1 - (ae-undocumented) Missing documentation for "LegacyPluginEnvironment". -// src/manager/types.d.ts:45:1 - (ae-undocumented) Missing documentation for "DynamicPluginProvider". -// src/manager/types.d.ts:46:5 - (ae-undocumented) Missing documentation for "plugins". -// src/manager/types.d.ts:51:1 - (ae-undocumented) Missing documentation for "BackendPluginProvider". -// src/manager/types.d.ts:52:5 - (ae-undocumented) Missing documentation for "backendPlugins". -// src/manager/types.d.ts:57:1 - (ae-undocumented) Missing documentation for "FrontendPluginProvider". -// src/manager/types.d.ts:58:5 - (ae-undocumented) Missing documentation for "frontendPlugins". -// src/manager/types.d.ts:63:1 - (ae-undocumented) Missing documentation for "BaseDynamicPlugin". -// src/manager/types.d.ts:64:5 - (ae-undocumented) Missing documentation for "name". -// src/manager/types.d.ts:65:5 - (ae-undocumented) Missing documentation for "version". -// src/manager/types.d.ts:66:5 - (ae-undocumented) Missing documentation for "role". -// src/manager/types.d.ts:67:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:72:1 - (ae-undocumented) Missing documentation for "DynamicPlugin". -// src/manager/types.d.ts:76:1 - (ae-undocumented) Missing documentation for "FrontendDynamicPlugin". -// src/manager/types.d.ts:77:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:82:1 - (ae-undocumented) Missing documentation for "BackendDynamicPlugin". -// src/manager/types.d.ts:83:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:84:5 - (ae-undocumented) Missing documentation for "installer". -// src/manager/types.d.ts:89:1 - (ae-undocumented) Missing documentation for "BackendDynamicPluginInstaller". -// src/manager/types.d.ts:93:1 - (ae-undocumented) Missing documentation for "NewBackendPluginInstaller". -// src/manager/types.d.ts:94:5 - (ae-undocumented) Missing documentation for "kind". -// src/manager/types.d.ts:95:5 - (ae-undocumented) Missing documentation for "install". -// src/manager/types.d.ts:108:1 - (ae-undocumented) Missing documentation for "LegacyBackendPluginInstaller". -// src/manager/types.d.ts:109:5 - (ae-undocumented) Missing documentation for "kind". -// src/manager/types.d.ts:110:5 - (ae-undocumented) Missing documentation for "router". -// src/manager/types.d.ts:114:5 - (ae-undocumented) Missing documentation for "catalog". -// src/manager/types.d.ts:115:5 - (ae-undocumented) Missing documentation for "scaffolder". -// src/manager/types.d.ts:116:5 - (ae-undocumented) Missing documentation for "search". -// src/manager/types.d.ts:117:5 - (ae-undocumented) Missing documentation for "events". -// src/manager/types.d.ts:118:5 - (ae-undocumented) Missing documentation for "permissions". -// src/manager/types.d.ts:125:1 - (ae-undocumented) Missing documentation for "isBackendDynamicPluginInstaller". +// src/manager/plugin-manager.d.ts:65:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFeatureDiscoveryLoader". +// src/manager/types.d.ts:28:1 - (ae-undocumented) Missing documentation for "LegacyPluginEnvironment". +// src/manager/types.d.ts:46:1 - (ae-undocumented) Missing documentation for "DynamicPluginProvider". +// src/manager/types.d.ts:47:5 - (ae-undocumented) Missing documentation for "plugins". +// src/manager/types.d.ts:48:5 - (ae-undocumented) Missing documentation for "getScannedPackage". +// src/manager/types.d.ts:53:1 - (ae-undocumented) Missing documentation for "BackendPluginProvider". +// src/manager/types.d.ts:54:5 - (ae-undocumented) Missing documentation for "backendPlugins". +// src/manager/types.d.ts:59:1 - (ae-undocumented) Missing documentation for "FrontendPluginProvider". +// src/manager/types.d.ts:60:5 - (ae-undocumented) Missing documentation for "frontendPlugins". +// src/manager/types.d.ts:65:1 - (ae-undocumented) Missing documentation for "BaseDynamicPlugin". +// src/manager/types.d.ts:66:5 - (ae-undocumented) Missing documentation for "name". +// src/manager/types.d.ts:67:5 - (ae-undocumented) Missing documentation for "version". +// src/manager/types.d.ts:68:5 - (ae-undocumented) Missing documentation for "role". +// src/manager/types.d.ts:69:5 - (ae-undocumented) Missing documentation for "platform". +// src/manager/types.d.ts:70:5 - (ae-undocumented) Missing documentation for "failure". +// src/manager/types.d.ts:75:1 - (ae-undocumented) Missing documentation for "DynamicPlugin". +// src/manager/types.d.ts:79:1 - (ae-undocumented) Missing documentation for "FrontendDynamicPlugin". +// src/manager/types.d.ts:80:5 - (ae-undocumented) Missing documentation for "platform". +// src/manager/types.d.ts:85:1 - (ae-undocumented) Missing documentation for "BackendDynamicPlugin". +// src/manager/types.d.ts:86:5 - (ae-undocumented) Missing documentation for "platform". +// src/manager/types.d.ts:87:5 - (ae-undocumented) Missing documentation for "installer". +// src/manager/types.d.ts:92:1 - (ae-undocumented) Missing documentation for "BackendDynamicPluginInstaller". +// src/manager/types.d.ts:96:1 - (ae-undocumented) Missing documentation for "NewBackendPluginInstaller". +// src/manager/types.d.ts:97:5 - (ae-undocumented) Missing documentation for "kind". +// src/manager/types.d.ts:98:5 - (ae-undocumented) Missing documentation for "install". +// src/manager/types.d.ts:111:1 - (ae-undocumented) Missing documentation for "LegacyBackendPluginInstaller". +// src/manager/types.d.ts:112:5 - (ae-undocumented) Missing documentation for "kind". +// src/manager/types.d.ts:113:5 - (ae-undocumented) Missing documentation for "router". +// src/manager/types.d.ts:117:5 - (ae-undocumented) Missing documentation for "catalog". +// src/manager/types.d.ts:118:5 - (ae-undocumented) Missing documentation for "scaffolder". +// src/manager/types.d.ts:119:5 - (ae-undocumented) Missing documentation for "search". +// src/manager/types.d.ts:120:5 - (ae-undocumented) Missing documentation for "events". +// src/manager/types.d.ts:121:5 - (ae-undocumented) Missing documentation for "permissions". +// src/manager/types.d.ts:128:1 - (ae-undocumented) Missing documentation for "isBackendDynamicPluginInstaller". // src/scanner/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "ScannedPluginPackage". // src/scanner/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "location". // src/scanner/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "manifest". // src/scanner/types.d.ts:12:1 - (ae-undocumented) Missing documentation for "ScannedPluginManifest". -// src/schemas/appBackendModule.d.ts:2:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFrontendSchemas". -// src/schemas/rootLoggerServiceFactory.d.ts:2:22 - (ae-undocumented) Missing documentation for "dynamicPluginsRootLoggerServiceFactory". +// src/schemas/frontend.d.ts:5:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFrontendSchemas". +// src/schemas/rootLogger.d.ts:5:1 - (ae-undocumented) Missing documentation for "DynamicPluginsRootLoggerFactoryOptions". +// src/schemas/rootLogger.d.ts:10:22 - (ae-undocumented) Missing documentation for "dynamicPluginsRootLoggerServiceFactory". // src/schemas/schemas.d.ts:7:1 - (ae-undocumented) Missing documentation for "DynamicPluginsSchemasService". // src/schemas/schemas.d.ts:8:5 - (ae-undocumented) Missing documentation for "addDynamicPluginsSchemas". // src/schemas/schemas.d.ts:21:1 - (ae-undocumented) Missing documentation for "DynamicPluginsSchemasOptions". -// src/schemas/schemas.d.ts:36:22 - (ae-undocumented) Missing documentation for "dynamicPluginsSchemasServiceFactoryWithOptions". -// src/schemas/schemas.d.ts:40:22 - (ae-undocumented) Missing documentation for "dynamicPluginsSchemasServiceFactory". +// src/schemas/schemas.d.ts:37:22 - (ae-undocumented) Missing documentation for "dynamicPluginsSchemasServiceFactory". // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.test.ts b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.test.ts index 5c01a3dfe5..6c129c07e2 100644 --- a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.test.ts +++ b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.test.ts @@ -44,6 +44,7 @@ import { PluginScanner } from '../scanner/plugin-scanner'; import { findPaths } from '@backstage/cli-common'; import { createMockDirectory } from '@backstage/backend-test-utils'; import { rootLifecycleServiceFactory } from '@backstage/backend-defaults/rootLifecycle'; +import { PackageRole } from '@backstage/cli-node'; describe('backend-dynamic-feature-service', () => { const mockDir = createMockDirectory(); @@ -299,6 +300,29 @@ describe('backend-dynamic-feature-service', () => { ); }, }, + { + name: 'should ignore plugin package with incompatible role', + packageManifest: { + name: 'backend-dynamic-plugin-test', + version: '0.0.0', + backstage: { + role: 'node-library', + }, + main: 'dist/index.cjs.js', + }, + expectedLogs(location) { + return { + infos: [ + { + message: `skipping dynamic plugin package 'backend-dynamic-plugin-test' from '${location}': incompatible role 'node-library'`, + }, + ], + }; + }, + checkLoadedPlugins(plugins) { + expect(plugins).toMatchObject([]); + }, + }, { name: 'should fail when no index file', packageManifest: { @@ -342,7 +366,17 @@ describe('backend-dynamic-feature-service', () => { }; }, checkLoadedPlugins(plugins) { - expect(plugins).toMatchObject([]); + expect(plugins).toMatchObject([ + { + name: 'backend-dynamic-plugin-test', + version: '0.0.0', + role: 'backend-plugin', + platform: 'node', + failure: expect.stringMatching( + `^Error: Cannot find module '[^']*' from .*`, + ), + }, + ]); }, }, { @@ -369,7 +403,15 @@ describe('backend-dynamic-feature-service', () => { }; }, checkLoadedPlugins(plugins) { - expect(plugins).toMatchObject([]); + expect(plugins).toMatchObject([ + { + name: 'backend-dynamic-plugin-test', + version: '0.0.0', + role: 'backend-plugin', + platform: 'node', + failure: `the module should either export a 'BackendFeature' or 'BackendFeatureFactory' as default export, or export a 'const dynamicPluginInstaller: BackendDynamicPluginInstaller' field as dynamic loading entrypoint.`, + }, + ]); }, }, { @@ -397,7 +439,15 @@ describe('backend-dynamic-feature-service', () => { }; }, checkLoadedPlugins(plugins) { - expect(plugins).toMatchObject([]); + expect(plugins).toMatchObject([ + { + name: 'backend-dynamic-plugin-test', + version: '0.0.0', + role: 'backend-plugin', + platform: 'node', + failure: `the module should either export a 'BackendFeature' or 'BackendFeatureFactory' as default export, or export a 'const dynamicPluginInstaller: BackendDynamicPluginInstaller' field as dynamic loading entrypoint.`, + }, + ]); }, }, { @@ -428,7 +478,17 @@ describe('backend-dynamic-feature-service', () => { }; }, checkLoadedPlugins(plugins) { - expect(plugins).toMatchObject([]); + expect(plugins).toMatchObject([ + { + name: 'backend-dynamic-plugin-test', + version: '0.0.0', + role: 'backend-plugin', + platform: 'node', + failure: expect.stringMatching( + `^SyntaxError: Unexpected identifier.*`, + ), + }, + ]); }, }, { @@ -495,6 +555,27 @@ describe('backend-dynamic-feature-service', () => { ]); }, }, + { + name: 'should successfully load a frontend plugin (experimental dynamic container)', + packageManifest: { + name: 'frontend-dynamic-plugin-test', + version: '0.0.0', + backstage: { + role: 'frontend-dynamic-container' as PackageRole, + }, + main: 'dist/index.esm.js', + }, + checkLoadedPlugins(plugins) { + expect(plugins).toMatchObject([ + { + name: 'frontend-dynamic-plugin-test', + version: '0.0.0', + role: 'frontend-dynamic-container', + platform: 'web', + }, + ]); + }, + }, ])('$name', async (tc: TestCase): Promise => { const plugin: ScannedPluginPackage = { location: url.pathToFileURL(mockDir.resolve(randomUUID())), @@ -538,33 +619,54 @@ describe('backend-dynamic-feature-service', () => { }); }); - describe('backendPlugins', () => { + describe('plugin getters', () => { + const plugins: BaseDynamicPlugin[] = [ + { + name: 'a-frontend-plugin', + platform: 'web', + role: 'frontend-plugin', + version: '0.0.0', + }, + { + name: 'a-frontend-module', + platform: 'web', + role: 'frontend-plugin-module', + version: '0.0.0', + }, + { + name: 'a-failing-frontend-plugin', + platform: 'web', + role: 'frontend-plugin', + version: '0.0.0', + failure: 'Some frontend failure', + }, + { + name: 'a-backend-plugin', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + }, + { + name: 'a-backend-module', + platform: 'node', + role: 'backend-plugin-module', + version: '0.0.0', + }, + { + name: 'a-failing-backend-plugin', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + failure: 'Some backend failure', + }, + ]; + it('should return only backend plugins and modules', async () => { const logger = new MockedLogger(); const pluginManager = new (DynamicPluginManager as any)( logger, [], ) as DynamicPluginManager; - const plugins: BaseDynamicPlugin[] = [ - { - name: 'a-frontend-plugin', - platform: 'web', - role: 'frontend-plugin', - version: '0.0.0', - }, - { - name: 'a-backend-plugin', - platform: 'node', - role: 'backend-plugin', - version: '0.0.0', - }, - { - name: 'a-backend-module', - platform: 'node', - role: 'backend-plugin-module', - version: '0.0.0', - }, - ]; (pluginManager as any)._plugins = plugins; expect(pluginManager.backendPlugins()).toEqual([ { @@ -580,17 +682,109 @@ describe('backend-dynamic-feature-service', () => { version: '0.0.0', }, ]); + expect(pluginManager.backendPlugins(false)).toEqual([ + { + name: 'a-backend-plugin', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + }, + { + name: 'a-backend-module', + platform: 'node', + role: 'backend-plugin-module', + version: '0.0.0', + }, + ]); + expect(pluginManager.backendPlugins(true)).toEqual([ + { + name: 'a-backend-plugin', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + }, + { + name: 'a-backend-module', + platform: 'node', + role: 'backend-plugin-module', + version: '0.0.0', + }, + { + name: 'a-failing-backend-plugin', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + failure: 'Some backend failure', + }, + ]); }); - }); - describe('frontendPlugins', () => { it('should return only frontend plugins', async () => { const logger = new MockedLogger(); const pluginManager = new (DynamicPluginManager as any)( logger, [], ) as DynamicPluginManager; - const plugins: BaseDynamicPlugin[] = [ + (pluginManager as any)._plugins = plugins; + expect(pluginManager.frontendPlugins()).toEqual([ + { + name: 'a-frontend-plugin', + platform: 'web', + role: 'frontend-plugin', + version: '0.0.0', + }, + { + name: 'a-frontend-module', + platform: 'web', + role: 'frontend-plugin-module', + version: '0.0.0', + }, + ]); + expect(pluginManager.frontendPlugins(false)).toEqual([ + { + name: 'a-frontend-plugin', + platform: 'web', + role: 'frontend-plugin', + version: '0.0.0', + }, + { + name: 'a-frontend-module', + platform: 'web', + role: 'frontend-plugin-module', + version: '0.0.0', + }, + ]); + expect(pluginManager.frontendPlugins(true)).toEqual([ + { + name: 'a-frontend-plugin', + platform: 'web', + role: 'frontend-plugin', + version: '0.0.0', + }, + { + name: 'a-frontend-module', + platform: 'web', + role: 'frontend-plugin-module', + version: '0.0.0', + }, + { + name: 'a-failing-frontend-plugin', + platform: 'web', + role: 'frontend-plugin', + version: '0.0.0', + failure: 'Some frontend failure', + }, + ]); + }); + + it('should return all plugins', async () => { + const logger = new MockedLogger(); + const pluginManager = new (DynamicPluginManager as any)( + logger, + [], + ) as DynamicPluginManager; + (pluginManager as any)._plugins = plugins; + expect(pluginManager.plugins()).toEqual([ { name: 'a-frontend-plugin', platform: 'web', @@ -615,9 +809,8 @@ describe('backend-dynamic-feature-service', () => { role: 'backend-plugin-module', version: '0.0.0', }, - ]; - (pluginManager as any)._plugins = plugins; - expect(pluginManager.frontendPlugins()).toEqual([ + ]); + expect(pluginManager.plugins(false)).toEqual([ { name: 'a-frontend-plugin', platform: 'web', @@ -630,7 +823,93 @@ describe('backend-dynamic-feature-service', () => { role: 'frontend-plugin-module', version: '0.0.0', }, + { + name: 'a-backend-plugin', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + }, + { + name: 'a-backend-module', + platform: 'node', + role: 'backend-plugin-module', + version: '0.0.0', + }, ]); + expect(pluginManager.plugins(true)).toEqual([ + { + name: 'a-frontend-plugin', + platform: 'web', + role: 'frontend-plugin', + version: '0.0.0', + }, + { + name: 'a-frontend-module', + platform: 'web', + role: 'frontend-plugin-module', + version: '0.0.0', + }, + { + name: 'a-failing-frontend-plugin', + platform: 'web', + role: 'frontend-plugin', + version: '0.0.0', + failure: 'Some frontend failure', + }, + { + name: 'a-backend-plugin', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + }, + { + name: 'a-backend-module', + platform: 'node', + role: 'backend-plugin-module', + version: '0.0.0', + }, + { + name: 'a-failing-backend-plugin', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + failure: 'Some backend failure', + }, + ]); + }); + }); + + describe('get scanned package', () => { + it('should return the scanned package of the plugin', async () => { + const logger = new MockedLogger(); + const packageFolder = mockDir.resolve(randomUUID()); + const scannedPackage = { + manifest: { + name: 'backend-dynamic-plugin-test', + version: '0.0.0', + backstage: { + role: 'backend-plugin', + }, + main: 'dist/index.cjs.js', + }, + location: url.pathToFileURL(packageFolder), + }; + const plugin = { + name: 'backend-dynamic-plugin-test', + version: '0.0.0', + role: 'backend-plugin', + platform: 'node', + installer: { + kind: 'new', + }, + } as BackendDynamicPlugin; + + const pluginManager = new (DynamicPluginManager as any)(logger, [ + scannedPackage, + ]) as DynamicPluginManager; + (pluginManager as any)._plugins = [plugin]; + + expect(pluginManager.getScannedPackage(plugin)).toEqual(scannedPackage); }); }); diff --git a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts index fef0b6000d..5b88c0619b 100644 --- a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts +++ b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts @@ -34,7 +34,7 @@ import { createServiceFactory, createServiceRef, } from '@backstage/backend-plugin-api'; -import { PackageRoles } from '@backstage/cli-node'; +import { PackageRole, PackageRoles } from '@backstage/cli-node'; import { findPaths } from '@backstage/cli-common'; import path from 'path'; import * as fs from 'fs'; @@ -104,7 +104,7 @@ export class DynamicPluginManager implements DynamicPluginProvider { private constructor( private readonly logger: LoggerService, - private packages: ScannedPluginPackage[], + private readonly packages: ScannedPluginPackage[], private readonly moduleLoader: ModuleLoader, ) { this._plugins = []; @@ -123,26 +123,39 @@ export class DynamicPluginManager implements DynamicPluginProvider { const loadedPlugins: DynamicPlugin[] = []; for (const scannedPlugin of this.packages) { - const platform = PackageRoles.getRoleInfo( - scannedPlugin.manifest.backstage.role, - ).platform; + const role = scannedPlugin.manifest.backstage.role; + const platform = PackageRoles.getRoleInfo(role).platform; + const isPlugin = + role.endsWith('-plugin') || + role.endsWith('-plugin-module') || + role === ('frontend-dynamic-container' as PackageRole); - if ( - platform === 'node' && - scannedPlugin.manifest.backstage.role.includes('-plugin') - ) { - const plugin = await this.loadBackendPlugin(scannedPlugin); - if (plugin !== undefined) { - loadedPlugins.push(plugin); - } - } else { - loadedPlugins.push({ - name: scannedPlugin.manifest.name, - version: scannedPlugin.manifest.version, - role: scannedPlugin.manifest.backstage.role, - platform: 'web', - // TODO(davidfestal): add required front-end plugin information here. - }); + if (!isPlugin) { + this.logger.info( + `skipping dynamic plugin package '${scannedPlugin.manifest.name}' from '${scannedPlugin.location}': incompatible role '${role}'`, + ); + continue; + } + + switch (platform) { + case 'node': + loadedPlugins.push(await this.loadBackendPlugin(scannedPlugin)); + break; + + case 'web': + loadedPlugins.push({ + name: scannedPlugin.manifest.name, + version: scannedPlugin.manifest.version, + role: scannedPlugin.manifest.backstage.role, + platform: 'web', + // TODO(davidfestal): add required front-end plugin information here. + }); + break; + + default: + this.logger.info( + `skipping dynamic plugin package '${scannedPlugin.manifest.name}' from '${scannedPlugin.location}': unrelated platform '${platform}'`, + ); } } return loadedPlugins; @@ -150,66 +163,88 @@ export class DynamicPluginManager implements DynamicPluginProvider { private async loadBackendPlugin( plugin: ScannedPluginPackage, - ): Promise { + ): Promise { const packagePath = url.fileURLToPath( `${plugin.location}/${plugin.manifest.main}`, ); + const dynamicPlugin: BackendDynamicPlugin = { + name: plugin.manifest.name, + version: plugin.manifest.version, + platform: 'node', + role: plugin.manifest.backstage.role, + }; + try { const pluginModule = await this.moduleLoader.load(packagePath); - let dynamicPluginInstaller; if (isBackendFeature(pluginModule.default)) { - dynamicPluginInstaller = { + dynamicPlugin.installer = { kind: 'new', install: () => pluginModule.default, }; } else if (isBackendFeatureFactory(pluginModule.default)) { - dynamicPluginInstaller = { + dynamicPlugin.installer = { kind: 'new', install: pluginModule.default, }; - } else { - dynamicPluginInstaller = pluginModule.dynamicPluginInstaller; + } else if ( + isBackendDynamicPluginInstaller(pluginModule.dynamicPluginInstaller) + ) { + dynamicPlugin.installer = pluginModule.dynamicPluginInstaller; } - if (!isBackendDynamicPluginInstaller(dynamicPluginInstaller)) { - this.logger.error( - `dynamic backend plugin '${plugin.manifest.name}' could not be loaded from '${plugin.location}': the module should either export a 'BackendFeature' or 'BackendFeatureFactory' as default export, or export a 'const dynamicPluginInstaller: BackendDynamicPluginInstaller' field as dynamic loading entrypoint.`, + if (dynamicPlugin.installer) { + this.logger.info( + `loaded dynamic backend plugin '${plugin.manifest.name}' from '${plugin.location}'`, + ); + } else { + dynamicPlugin.failure = `the module should either export a 'BackendFeature' or 'BackendFeatureFactory' as default export, or export a 'const dynamicPluginInstaller: BackendDynamicPluginInstaller' field as dynamic loading entrypoint.`; + this.logger.error( + `dynamic backend plugin '${plugin.manifest.name}' could not be loaded from '${plugin.location}': ${dynamicPlugin.failure}`, ); - return undefined; } - this.logger.info( - `loaded dynamic backend plugin '${plugin.manifest.name}' from '${plugin.location}'`, - ); - return { - name: plugin.manifest.name, - version: plugin.manifest.version, - platform: 'node', - role: plugin.manifest.backstage.role, - installer: dynamicPluginInstaller, - }; + return dynamicPlugin; } catch (error) { + const typedError = + typeof error === 'object' && 'message' in error && 'name' in error + ? error + : new Error(error); + dynamicPlugin.failure = `${typedError.name}: ${typedError.message}`; this.logger.error( `an error occurred while loading dynamic backend plugin '${plugin.manifest.name}' from '${plugin.location}'`, - error, + typedError, ); - return undefined; + return dynamicPlugin; } } - backendPlugins(): BackendDynamicPlugin[] { - return this._plugins.filter( + backendPlugins(includeFailed?: boolean): BackendDynamicPlugin[] { + return this.plugins(includeFailed).filter( (p): p is BackendDynamicPlugin => p.platform === 'node', ); } - frontendPlugins(): FrontendDynamicPlugin[] { - return this._plugins.filter( + frontendPlugins(includeFailed?: boolean): FrontendDynamicPlugin[] { + return this.plugins(includeFailed).filter( (p): p is FrontendDynamicPlugin => p.platform === 'web', ); } - plugins(): DynamicPlugin[] { - return this._plugins; + plugins(includeFailed?: boolean): DynamicPlugin[] { + return this._plugins.filter(p => includeFailed || !p.failure); + } + + getScannedPackage(plugin: DynamicPlugin): ScannedPluginPackage { + const pkg = this.packages.find( + p => + p.manifest.name === plugin.name && + p.manifest.version === plugin.version, + ); + if (pkg === undefined) { + throw new Error( + `The scanned package of a dynamic plugin should always be available: ${plugin.name}/${plugin.version}`, + ); + } + return pkg; } } @@ -279,7 +314,7 @@ class DynamicPluginsEnabledFeatureDiscoveryService ...this.dynamicPlugins .backendPlugins() .flatMap((plugin): BackendFeature[] => { - if (plugin.installer.kind === 'new') { + if (plugin.installer?.kind === 'new') { const installed = plugin.installer.install(); if (Array.isArray(installed)) { return installed; diff --git a/packages/backend-dynamic-feature-service/src/manager/types.ts b/packages/backend-dynamic-feature-service/src/manager/types.ts index a4f2937fd5..d3989b5ff9 100644 --- a/packages/backend-dynamic-feature-service/src/manager/types.ts +++ b/packages/backend-dynamic-feature-service/src/manager/types.ts @@ -43,6 +43,7 @@ import { TemplateAction } from '@backstage/plugin-scaffolder-node'; import { IndexBuilder } from '@backstage/plugin-search-backend-node'; import { EventsBackend } from '@backstage/plugin-events-backend'; import { PermissionPolicy } from '@backstage/plugin-permission-node'; +import { ScannedPluginPackage } from '../scanner'; /** * @public @@ -78,21 +79,22 @@ export type LegacyPluginEnvironment = { export interface DynamicPluginProvider extends FrontendPluginProvider, BackendPluginProvider { - plugins(): DynamicPlugin[]; + plugins(includeFailed?: boolean): DynamicPlugin[]; + getScannedPackage(plugin: DynamicPlugin): ScannedPluginPackage; } /** * @public */ export interface BackendPluginProvider { - backendPlugins(): BackendDynamicPlugin[]; + backendPlugins(includeFailed?: boolean): BackendDynamicPlugin[]; } /** * @public */ export interface FrontendPluginProvider { - frontendPlugins(): FrontendDynamicPlugin[]; + frontendPlugins(includeFailed?: boolean): FrontendDynamicPlugin[]; } /** @@ -103,6 +105,7 @@ export interface BaseDynamicPlugin { version: string; role: PackageRole; platform: PackagePlatform; + failure?: string; } /** @@ -122,7 +125,7 @@ export interface FrontendDynamicPlugin extends BaseDynamicPlugin { */ export interface BackendDynamicPlugin extends BaseDynamicPlugin { platform: 'node'; - installer: BackendDynamicPluginInstaller; + installer?: BackendDynamicPluginInstaller; } /** diff --git a/yarn.lock b/yarn.lock index f5184e9149..7285cc8a19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -40001,6 +40001,7 @@ __metadata: resolution: "root@workspace:." dependencies: "@backstage/cli": "workspace:*" + "@backstage/cli-node": "workspace:^" "@backstage/codemods": "workspace:*" "@backstage/create-app": "workspace:*" "@backstage/e2e-test-utils": "workspace:*" From d18d4942f9159e9b57f21e1fbd007e7a416f03fd Mon Sep 17 00:00:00 2001 From: David Festal Date: Wed, 25 Sep 2024 15:40:10 +0200 Subject: [PATCH 049/268] refactor(backend-dynamic-feature-service): single line activation. - DynamicPlugins service is restored, since it is required for plugins to depend on it in order to get the details of loaded dynamic plugins - An all-in-one feature loader is provided that allows 1-liner installation of both the dynamic features and additional services or plugins required to have the dynamic plugins work correctly with dynamic plugins config schemas. Signed-off-by: David Festal --- .changeset/fluffy-dogs-mate.md | 8 ++ .../backend-dynamic-feature-service/README.md | 3 +- .../src/features/features.ts | 111 ++++++++++++++++++ .../src/features/index.ts | 17 +++ .../src/index.ts | 1 + .../src/manager/plugin-manager.ts | 82 ++++--------- .../src/scanner/plugin-scanner.ts | 4 +- .../{appBackendModule.ts => frontend.ts} | 5 +- .../src/schemas/index.ts | 8 +- .../src/schemas/rootLogger.ts | 86 ++++++++++++++ .../src/schemas/rootLoggerServiceFactory.ts | 63 ---------- .../src/schemas/schemas.ts | 13 +- 12 files changed, 263 insertions(+), 138 deletions(-) create mode 100644 .changeset/fluffy-dogs-mate.md create mode 100644 packages/backend-dynamic-feature-service/src/features/features.ts create mode 100644 packages/backend-dynamic-feature-service/src/features/index.ts rename packages/backend-dynamic-feature-service/src/schemas/{appBackendModule.ts => frontend.ts} (92%) create mode 100644 packages/backend-dynamic-feature-service/src/schemas/rootLogger.ts delete mode 100644 packages/backend-dynamic-feature-service/src/schemas/rootLoggerServiceFactory.ts diff --git a/.changeset/fluffy-dogs-mate.md b/.changeset/fluffy-dogs-mate.md new file mode 100644 index 0000000000..cb7a78d0fb --- /dev/null +++ b/.changeset/fluffy-dogs-mate.md @@ -0,0 +1,8 @@ +--- +'@backstage/backend-dynamic-feature-service': patch +--- + +Enhance and simplify the activation of the dynamic plugins feature: + +- The dynamic plugins service (which implements the `DynamicPluginsProvider`) is restored, since it is required for plugins to depend on it in order to get the details of loaded dynamic plugins (possibly with loading errors to be surfaced in some UI). +- A new all-in-one feature loader (`dynamicPluginsFeatureLoader`) is provided that allows a 1-liner activation of both the dynamic features and additional services or plugins required to have the dynamic plugins work correctly with dynamic plugins config schemas. Previous service factories or feature loaders are deprecated. diff --git a/packages/backend-dynamic-feature-service/README.md b/packages/backend-dynamic-feature-service/README.md index 33033cf884..f4ca11bb1f 100644 --- a/packages/backend-dynamic-feature-service/README.md +++ b/packages/backend-dynamic-feature-service/README.md @@ -15,8 +15,7 @@ In the `backend` application, it can be enabled by adding the `backend-dynamic-f ```ts const backend = createBackend(); + -+ backend.add(dynamicPluginsFeatureDiscoveryServiceFactory) // overridden version of the FeatureDiscoveryService which provides features loaded by dynamic plugins -+ backend.add(dynamicPluginsServiceFactory) ++ backend.add(dynamicPluginsFeatureLoader) which provides features loaded by dynamic plugins + ``` diff --git a/packages/backend-dynamic-feature-service/src/features/features.ts b/packages/backend-dynamic-feature-service/src/features/features.ts new file mode 100644 index 0000000000..4788f1da75 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/features.ts @@ -0,0 +1,111 @@ +/* + * Copyright 2024 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 { + coreServices, + createBackendFeatureLoader, +} from '@backstage/backend-plugin-api'; +import { + DynamicPluginsSchemasOptions, + dynamicPluginsFrontendSchemas, + dynamicPluginsRootLoggerServiceFactory, + dynamicPluginsSchemasServiceFactory, +} from '../schemas'; +import { + DynamicPluginsFactoryOptions, + dynamicPluginsFeatureDiscoveryLoader, + dynamicPluginsServiceFactory, +} from '../manager'; +import { DynamicPluginsRootLoggerFactoryOptions } from '../schemas'; +import { configKey } from '../scanner/plugin-scanner'; + +/** + * @public + */ +export type DynamicPluginsFeatureLoaderOptions = DynamicPluginsFactoryOptions & + DynamicPluginsSchemasOptions & + DynamicPluginsRootLoggerFactoryOptions; + +const dynamicPluginsFeatureLoaderWithOptions = ( + options?: DynamicPluginsFeatureLoaderOptions, +) => + createBackendFeatureLoader({ + deps: { + config: coreServices.rootConfig, + }, + *loader({ config }) { + const dynamicPluginsEnabled = config.has(configKey); + + yield* [ + dynamicPluginsSchemasServiceFactory(options), + dynamicPluginsServiceFactory(options), + ]; + if (dynamicPluginsEnabled) { + yield* [ + dynamicPluginsRootLoggerServiceFactory(options), + dynamicPluginsFrontendSchemas, + dynamicPluginsFeatureDiscoveryLoader, + ]; + } + }, + }); + +/** + * A backend feature loader that fully enable backend dynamic plugins. + * More precisely it: + * - adds the dynamic plugins root service (typically depended upon by plugins), + * - adds additional required features to allow supporting dynamic plugins config schemas + * in the frontend application and the backend root logger, + * - uses the dynamic plugins service to discover and expose dynamic plugins as features. + * + * @public + * + * @example + * Using the `dynamicPluginsFeatureLoader` loader in a backend instance: + * ```ts + * //... + * import { createBackend } from '@backstage/backend-defaults'; + * import { dynamicPluginsFeatureLoader } from '@backstage/backend-dynamic-feature-service'; + * + * const backend = createBackend(); + * backend.add(dynamicPluginsFeatureLoader); + * //... + * backend.start(); + * ``` + * + * @example + * Passing options to the `dynamicPluginsFeatureLoader` loader in a backend instance: + * ```ts + * //... + * import { createBackend } from '@backstage/backend-defaults'; + * import { dynamicPluginsFeatureLoader } from '@backstage/backend-dynamic-feature-service'; + * import { myCustomModuleLoader } from './myCustomModuleLoader'; + * import { myCustomSchemaLocator } from './myCustomSchemaLocator'; + * + * const backend = createBackend(); + * backend.add(dynamicPluginsFeatureLoader({ + * moduleLoader: myCustomModuleLoader, + * schemaLocator: myCustomSchemaLocator, + * + * })); + * //... + * backend.start(); + * ``` + */ +export const dynamicPluginsFeatureLoader = Object.assign( + dynamicPluginsFeatureLoaderWithOptions, + dynamicPluginsFeatureLoaderWithOptions(), +); diff --git a/packages/backend-dynamic-feature-service/src/features/index.ts b/packages/backend-dynamic-feature-service/src/features/index.ts new file mode 100644 index 0000000000..c877359d42 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './features'; diff --git a/packages/backend-dynamic-feature-service/src/index.ts b/packages/backend-dynamic-feature-service/src/index.ts index 3768146124..abdbff677b 100644 --- a/packages/backend-dynamic-feature-service/src/index.ts +++ b/packages/backend-dynamic-feature-service/src/index.ts @@ -18,3 +18,4 @@ export * from './loader'; export * from './scanner'; export * from './manager'; export * from './schemas'; +export * from './features'; diff --git a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts index 5b88c0619b..87ff4334ed 100644 --- a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts +++ b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts @@ -250,7 +250,6 @@ export class DynamicPluginManager implements DynamicPluginProvider { /** * @public - * @deprecated The `featureDiscoveryService` is deprecated in favor of using {@link dynamicPluginsFeatureDiscoveryLoader} instead. */ export const dynamicPluginsServiceRef = createServiceRef( { @@ -268,7 +267,7 @@ export interface DynamicPluginsFactoryOptions { /** * @public - * @deprecated Use {@link dynamicPluginsFeatureDiscoveryLoader} instead. + * @deprecated Use {@link dynamicPluginsFeatureLoader} instead, which gathers all services and features required for dynamic plugins. */ export const dynamicPluginsServiceFactoryWithOptions = ( options?: DynamicPluginsFactoryOptions, @@ -291,10 +290,12 @@ export const dynamicPluginsServiceFactoryWithOptions = ( /** * @public - * @deprecated Use {@link dynamicPluginsFeatureDiscoveryLoader} instead. + * @deprecated Use {@link dynamicPluginsFeatureLoader} instead, which gathers all services and features required for dynamic plugins. */ -export const dynamicPluginsServiceFactory = - dynamicPluginsServiceFactoryWithOptions(); +export const dynamicPluginsServiceFactory = Object.assign( + dynamicPluginsServiceFactoryWithOptions, + dynamicPluginsServiceFactoryWithOptions(), +); class DynamicPluginsEnabledFeatureDiscoveryService implements FeatureDiscoveryService @@ -331,7 +332,7 @@ class DynamicPluginsEnabledFeatureDiscoveryService /** * @public - * @deprecated The `featureDiscoveryService` is deprecated in favor of using {@link dynamicPluginsFeatureDiscoveryLoader} instead. + * @deprecated Use {@link dynamicPluginsFeatureLoader} instead, which gathers all services and features required for dynamic plugins. */ export const dynamicPluginsFeatureDiscoveryServiceFactory = createServiceFactory({ @@ -345,65 +346,22 @@ export const dynamicPluginsFeatureDiscoveryServiceFactory = }, }); -const dynamicPluginsFeatureDiscoveryLoaderWithOptions = ( - options?: DynamicPluginsFactoryOptions, -) => - createBackendFeatureLoader({ - deps: { - config: coreServices.rootConfig, - logger: coreServices.rootLogger, - }, - async loader({ config, logger }) { - const manager = await DynamicPluginManager.create({ - config, - logger, - preferAlpha: true, - moduleLoader: options?.moduleLoader?.(logger), - }); - const service = new DynamicPluginsEnabledFeatureDiscoveryService(manager); - const { features } = await service.getBackendFeatures(); - return features; - }, - }); - /** - * A backend feature loader that uses the dynamic plugins system to discover features. - * * @public - * - * @example - * Using the `dynamicPluginsFeatureDiscoveryLoader` loader in a backend instance: - * ```ts - * //... - * import { createBackend } from '@backstage/backend-defaults'; - * import { dynamicPluginsFeatureDiscoveryLoader } from '@backstage/backend-dynamic-feature-service'; - * - * const backend = createBackend(); - * backend.add(dynamicPluginsFeatureDiscoveryLoader); - * //... - * backend.start(); - * ``` - * - * @example - * Passing options to the `dynamicPluginsFeatureDiscoveryLoader` loader in a backend instance: - * ```ts - * //... - * import { createBackend } from '@backstage/backend-defaults'; - * import { dynamicPluginsFeatureDiscoveryLoader } from '@backstage/backend-dynamic-feature-service'; - * import { myCustomModuleLoader } from './myCustomModuleLoader'; - * - * const backend = createBackend(); - * backend.add(dynamicPluginsFeatureDiscoveryLoader({ - * moduleLoader: myCustomModuleLoader - * })); - * //... - * backend.start(); - * ``` + * @deprecated Use {@link dynamicPluginsFeatureLoader} instead, which gathers all services and features required for dynamic plugins. */ -export const dynamicPluginsFeatureDiscoveryLoader = Object.assign( - dynamicPluginsFeatureDiscoveryLoaderWithOptions, - dynamicPluginsFeatureDiscoveryLoaderWithOptions(), -); +export const dynamicPluginsFeatureDiscoveryLoader = createBackendFeatureLoader({ + deps: { + dynamicPlugins: dynamicPluginsServiceRef, + }, + async loader({ dynamicPlugins }) { + const service = new DynamicPluginsEnabledFeatureDiscoveryService( + dynamicPlugins, + ); + const { features } = await service.getBackendFeatures(); + return features; + }, +}); function isBackendFeature(value: unknown): value is BackendFeature { return ( diff --git a/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner.ts b/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner.ts index 9229f5d78a..80ae2ed876 100644 --- a/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner.ts +++ b/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner.ts @@ -35,6 +35,8 @@ export interface ScanRootResponse { packages: ScannedPluginPackage[]; } +export const configKey = 'dynamicPlugins'; + export class PluginScanner { private _rootDirectory?: string; private configUnsubscribe?: () => void; @@ -68,7 +70,7 @@ export class PluginScanner { } private applyConfig(): void | never { - const dynamicPlugins = this.config.getOptional('dynamicPlugins'); + const dynamicPlugins = this.config.getOptional(configKey); if (!dynamicPlugins) { this.logger.info("'dynamicPlugins' config entry not found."); this._rootDirectory = undefined; diff --git a/packages/backend-dynamic-feature-service/src/schemas/appBackendModule.ts b/packages/backend-dynamic-feature-service/src/schemas/frontend.ts similarity index 92% rename from packages/backend-dynamic-feature-service/src/schemas/appBackendModule.ts rename to packages/backend-dynamic-feature-service/src/schemas/frontend.ts index 6e54379e90..306ecc9255 100644 --- a/packages/backend-dynamic-feature-service/src/schemas/appBackendModule.ts +++ b/packages/backend-dynamic-feature-service/src/schemas/frontend.ts @@ -25,7 +25,10 @@ import { loadCompiledConfigSchema, } from '@backstage/plugin-app-node'; -/** @public */ +/** + * @public + * @deprecated Use {@link dynamicPluginsFeatureLoader} instead, which gathers all services and features required for dynamic plugins. + */ export const dynamicPluginsFrontendSchemas = createBackendModule({ pluginId: 'app', moduleId: 'core.dynamicplugins.frontendSchemas', diff --git a/packages/backend-dynamic-feature-service/src/schemas/index.ts b/packages/backend-dynamic-feature-service/src/schemas/index.ts index 14c6734b6b..d67e77232b 100644 --- a/packages/backend-dynamic-feature-service/src/schemas/index.ts +++ b/packages/backend-dynamic-feature-service/src/schemas/index.ts @@ -16,10 +16,12 @@ export { dynamicPluginsSchemasServiceFactory, - dynamicPluginsSchemasServiceFactoryWithOptions, type DynamicPluginsSchemasService, type DynamicPluginsSchemasOptions, } from './schemas'; -export { dynamicPluginsFrontendSchemas } from './appBackendModule'; -export { dynamicPluginsRootLoggerServiceFactory } from './rootLoggerServiceFactory'; +export { dynamicPluginsFrontendSchemas } from './frontend'; +export { + dynamicPluginsRootLoggerServiceFactory, + type DynamicPluginsRootLoggerFactoryOptions, +} from './rootLogger'; diff --git a/packages/backend-dynamic-feature-service/src/schemas/rootLogger.ts b/packages/backend-dynamic-feature-service/src/schemas/rootLogger.ts new file mode 100644 index 0000000000..ac4bf3fa5e --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/schemas/rootLogger.ts @@ -0,0 +1,86 @@ +/* + * Copyright 2024 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 { + createServiceFactory, + coreServices, +} from '@backstage/backend-plugin-api'; +import { + WinstonLogger, + WinstonLoggerOptions, +} from '@backstage/backend-defaults/rootLogger'; +import { createConfigSecretEnumerator } from '@backstage/backend-defaults/rootConfig'; +import { transports, format } from 'winston'; +import { loadConfigSchema } from '@backstage/config-loader'; +import { getPackages } from '@manypkg/get-packages'; +import { dynamicPluginsSchemasServiceRef } from './schemas'; + +/** + * @public + */ +export type DynamicPluginsRootLoggerFactoryOptions = Omit< + WinstonLoggerOptions, + 'meta' +>; + +const dynamicPluginsRootLoggerServiceFactoryWithOptions = ( + options?: DynamicPluginsRootLoggerFactoryOptions, +) => + createServiceFactory({ + service: coreServices.rootLogger, + deps: { + config: coreServices.rootConfig, + schemas: dynamicPluginsSchemasServiceRef, + }, + async factory({ config, schemas }) { + const logger = WinstonLogger.create({ + level: process.env.LOG_LEVEL || 'info', + format: + process.env.NODE_ENV === 'production' + ? format.json() + : WinstonLogger.colorFormat(), + transports: [new transports.Console()], + ...options, + meta: { + service: 'backstage', + }, + }); + + const configSchema = await loadConfigSchema({ + dependencies: ( + await getPackages(process.cwd()) + ).packages.map(p => p.packageJson.name), + }); + + const secretEnumerator = await createConfigSecretEnumerator({ + logger, + schema: (await schemas.addDynamicPluginsSchemas(configSchema)).schema, + }); + logger.addRedactions(secretEnumerator(config)); + config.subscribe?.(() => logger.addRedactions(secretEnumerator(config))); + + return logger; + }, + }); + +/** + * @public + * @deprecated Use {@link dynamicPluginsFeatureLoader} instead, which gathers all services and features required for dynamic plugins. + */ +export const dynamicPluginsRootLoggerServiceFactory = Object.assign( + dynamicPluginsRootLoggerServiceFactoryWithOptions, + dynamicPluginsRootLoggerServiceFactoryWithOptions(), +); diff --git a/packages/backend-dynamic-feature-service/src/schemas/rootLoggerServiceFactory.ts b/packages/backend-dynamic-feature-service/src/schemas/rootLoggerServiceFactory.ts deleted file mode 100644 index 00d5c85e6e..0000000000 --- a/packages/backend-dynamic-feature-service/src/schemas/rootLoggerServiceFactory.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2024 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 { - createServiceFactory, - coreServices, -} from '@backstage/backend-plugin-api'; -import { WinstonLogger } from '@backstage/backend-defaults/rootLogger'; -import { transports, format } from 'winston'; -import { createConfigSecretEnumerator } from '@backstage/backend-common'; -import { loadConfigSchema } from '@backstage/config-loader'; -import { getPackages } from '@manypkg/get-packages'; -import { dynamicPluginsSchemasServiceRef } from './schemas'; - -/** @public */ -export const dynamicPluginsRootLoggerServiceFactory = createServiceFactory({ - service: coreServices.rootLogger, - deps: { - config: coreServices.rootConfig, - schemas: dynamicPluginsSchemasServiceRef, - }, - async factory({ config, schemas }) { - const logger = WinstonLogger.create({ - meta: { - service: 'backstage', - }, - level: process.env.LOG_LEVEL || 'info', - format: - process.env.NODE_ENV === 'production' - ? format.json() - : WinstonLogger.colorFormat(), - transports: [new transports.Console()], - }); - - const configSchema = await loadConfigSchema({ - dependencies: ( - await getPackages(process.cwd()) - ).packages.map(p => p.packageJson.name), - }); - - const secretEnumerator = await createConfigSecretEnumerator({ - logger, - schema: (await schemas.addDynamicPluginsSchemas(configSchema)).schema, - }); - logger.addRedactions(secretEnumerator(config)); - config.subscribe?.(() => logger.addRedactions(secretEnumerator(config))); - - return logger; - }, -}); diff --git a/packages/backend-dynamic-feature-service/src/schemas/schemas.ts b/packages/backend-dynamic-feature-service/src/schemas/schemas.ts index 1cfb42a093..52fb5eab6d 100644 --- a/packages/backend-dynamic-feature-service/src/schemas/schemas.ts +++ b/packages/backend-dynamic-feature-service/src/schemas/schemas.ts @@ -30,6 +30,7 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import { JsonObject } from '@backstage/types'; import { PluginScanner } from '../scanner/plugin-scanner'; import { ConfigSchema, loadConfigSchema } from '@backstage/config-loader'; +import { dynamicPluginsFeatureLoader } from '../features'; /** * @@ -68,10 +69,7 @@ export interface DynamicPluginsSchemasOptions { schemaLocator?: (pluginPackage: ScannedPluginPackage) => string; } -/** - * @public - */ -export const dynamicPluginsSchemasServiceFactoryWithOptions = ( +const dynamicPluginsSchemasServiceFactoryWithOptions = ( options?: DynamicPluginsSchemasOptions, ) => createServiceFactory({ @@ -143,9 +141,12 @@ export const dynamicPluginsSchemasServiceFactoryWithOptions = ( /** * @public + * @deprecated Use {@link dynamicPluginsFeatureLoader} instead, which gathers all services and features required for dynamic plugins. */ -export const dynamicPluginsSchemasServiceFactory = - dynamicPluginsSchemasServiceFactoryWithOptions(); +export const dynamicPluginsSchemasServiceFactory = Object.assign( + dynamicPluginsSchemasServiceFactoryWithOptions, + dynamicPluginsSchemasServiceFactoryWithOptions(), +); /** @internal */ async function gatherDynamicPluginsSchemas( From 4c89e4759d183aeb15964f30ae6cc7362681ea48 Mon Sep 17 00:00:00 2001 From: David Festal Date: Mon, 7 Oct 2024 13:33:44 +0200 Subject: [PATCH 050/268] refactor(backend-dynamic-feature-service): allow passing an async module loader in the `DynamicPluginsFeatureLoaderOptions`. Signed-off-by: David Festal --- .changeset/lemon-badgers-share.md | 5 +++++ .../src/loader/CommonJSModuleLoader.ts | 13 ++++++++----- .../src/manager/plugin-manager.ts | 6 +++--- 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 .changeset/lemon-badgers-share.md diff --git a/.changeset/lemon-badgers-share.md b/.changeset/lemon-badgers-share.md new file mode 100644 index 0000000000..c00b43c403 --- /dev/null +++ b/.changeset/lemon-badgers-share.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-dynamic-feature-service': patch +--- + +Allow passing an async module loader in the `DynamicPluginsFeatureLoaderOptions`. diff --git a/packages/backend-dynamic-feature-service/src/loader/CommonJSModuleLoader.ts b/packages/backend-dynamic-feature-service/src/loader/CommonJSModuleLoader.ts index 66af367cea..f9d4a48a44 100644 --- a/packages/backend-dynamic-feature-service/src/loader/CommonJSModuleLoader.ts +++ b/packages/backend-dynamic-feature-service/src/loader/CommonJSModuleLoader.ts @@ -18,7 +18,11 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import path from 'path'; export class CommonJSModuleLoader implements ModuleLoader { - constructor(public readonly logger: LoggerService) {} + private module: any; + + constructor(public readonly logger: LoggerService) { + this.module = require('node:module'); + } async bootstrap( backstageRoot: string, @@ -28,9 +32,8 @@ export class CommonJSModuleLoader implements ModuleLoader { const dynamicNodeModulesPaths = [ ...dynamicPluginsPaths.map(p => path.resolve(p, 'node_modules')), ]; - const Module = require('module'); - const oldNodeModulePaths = Module._nodeModulePaths; - Module._nodeModulePaths = (from: string): string[] => { + const oldNodeModulePaths = this.module._nodeModulePaths; + this.module._nodeModulePaths = (from: string): string[] => { const result: string[] = oldNodeModulePaths(from); if (!dynamicPluginsPaths.some(p => from.startsWith(p))) { return result; @@ -49,6 +52,6 @@ export class CommonJSModuleLoader implements ModuleLoader { } async load(packagePath: string): Promise { - return await require(/* webpackIgnore: true */ packagePath); + return await this.module.prototype.require(packagePath); } } diff --git a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts index 87ff4334ed..a3b4bfbf98 100644 --- a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts +++ b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts @@ -88,7 +88,7 @@ export class DynamicPluginManager implements DynamicPluginProvider { ), ); - moduleLoader.bootstrap(backstageRoot, dynamicPluginsPaths); + await moduleLoader.bootstrap(backstageRoot, dynamicPluginsPaths); scanner.subscribeToRootDirectoryChange(async () => { manager._availablePackages = (await scanner.scanRoot()).packages; @@ -262,7 +262,7 @@ export const dynamicPluginsServiceRef = createServiceRef( * @public */ export interface DynamicPluginsFactoryOptions { - moduleLoader?(logger: LoggerService): ModuleLoader; + moduleLoader?(logger: LoggerService): ModuleLoader | Promise; } /** @@ -283,7 +283,7 @@ export const dynamicPluginsServiceFactoryWithOptions = ( config, logger, preferAlpha: true, - moduleLoader: options?.moduleLoader?.(logger), + moduleLoader: await options?.moduleLoader?.(logger), }); }, }); From bb5b95f61309834ac5e98a65fa673f6fa6198998 Mon Sep 17 00:00:00 2001 From: David Festal Date: Mon, 7 Oct 2024 13:35:36 +0200 Subject: [PATCH 051/268] refactor(backend-dynamic-feature-service): all-in-one feature integration tests Signed-off-by: David Festal --- .../package.json | 2 + .../src/features/__fixtures__/.gitignore | 2 + .../dist/configSchema.json | 18 ++ .../test-backend-dynamic/dist/index.cjs.js | 59 ++++ .../index.js | 7 + .../package.json | 7 + .../test-backend-dynamic/package.json | 35 ++ .../test-dynamic/dist/configSchema.json | 18 ++ .../test-dynamic/dist/mf-manifest.json | 29 ++ .../test-dynamic/dist/remoteEntry.js | 17 + .../test-dynamic/package.json | 20 ++ .../node_modules/.shouldNotBeUsed | 0 .../@backstage/backend-plugin-api/index.js | 1 + .../backend-plugin-api/package.json | 7 + .../src/features/features.test.ts | 306 ++++++++++++++++++ .../src/schemas/frontend.ts | 1 + yarn.lock | 2 + 17 files changed, 531 insertions(+) create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/.gitignore create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/dist/configSchema.json create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/dist/index.cjs.js create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/node_modules/private-dep-with-frontend-plugin-index-path/index.js create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/node_modules/private-dep-with-frontend-plugin-index-path/package.json create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/package.json create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/configSchema.json create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/mf-manifest.json create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/remoteEntry.js create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/package.json create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/.shouldNotBeUsed create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/@backstage/backend-plugin-api/index.js create mode 100644 packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/@backstage/backend-plugin-api/package.json create mode 100644 packages/backend-dynamic-feature-service/src/features/features.test.ts diff --git a/packages/backend-dynamic-feature-service/package.json b/packages/backend-dynamic-feature-service/package.json index b1f6cf79e7..567f8b75ca 100644 --- a/packages/backend-dynamic-feature-service/package.json +++ b/packages/backend-dynamic-feature-service/package.json @@ -76,6 +76,8 @@ "devDependencies": { "@backstage/backend-test-utils": "workspace:^", "@backstage/cli": "workspace:^", + "@backstage/plugin-app-backend": "workspace:^", + "triple-beam": "^1.4.1", "wait-for-expect": "^3.0.2" } } diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/.gitignore b/packages/backend-dynamic-feature-service/src/features/__fixtures__/.gitignore new file mode 100644 index 0000000000..8f91d44d47 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/.gitignore @@ -0,0 +1,2 @@ +!dist +!node_modules diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/dist/configSchema.json b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/dist/configSchema.json new file mode 100644 index 0000000000..445c79a413 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/dist/configSchema.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "test-backend": { + "type": "object", + "required": [ + "secretValue" + ], + "properties": { + "secretValue": { + "type": "string", + "visibility": "secret" + } + } + } + } +} diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/dist/index.cjs.js b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/dist/index.cjs.js new file mode 100644 index 0000000000..6cc4a4f125 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/dist/index.cjs.js @@ -0,0 +1,59 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +const { dynamicPluginsServiceRef } = require('../../../../../manager'); +var backendPluginApi = require('@backstage/backend-plugin-api'); +const express = require('express'); +const path = require('path'); +const url = require('url'); + +const privateDep = require('private-dep-with-frontend-plugin-index-path'); + +const testPlugin = backendPluginApi.createBackendPlugin({ + pluginId: "test", + register(env) { + env.registerInit({ + deps: { + http: backendPluginApi.coreServices.httpRouter, + logger: backendPluginApi.coreServices.rootLogger, + discovery: backendPluginApi.coreServices.discovery, + dynamicPlugins: dynamicPluginsServiceRef, + metadata: backendPluginApi.coreServices.pluginMetadata, + }, + async init({ + http, + logger, + discovery, + dynamicPlugins, + metadata, + }) { + logger.info("This secret value should be hidden by the dynamic-plugin-aware logger: AVerySecretValue"); + const externalBaseUrl = await discovery.getExternalBaseUrl(metadata.getId()); + const router = express.Router(); + const frontendPluginsIndexPath = privateDep.frontendPluginsIndexPath; + const frontendPluginManifests = Object.fromEntries(dynamicPlugins.frontendPlugins().map(fp => { + const pluginScannedPackage = dynamicPlugins.getScannedPackage(fp); + const pkgDistLocation = path.resolve( + url.fileURLToPath(pluginScannedPackage.location), + 'dist', + ); + router.use(`/${frontendPluginsIndexPath}/${fp.name}`, express.static(pkgDistLocation)) + return [fp.name, `${externalBaseUrl}/${frontendPluginsIndexPath}/${fp.name}/mf-manifest.json`] + })); + router.get(`/${frontendPluginsIndexPath}`, (req, res) => { + res.status(200).json(frontendPluginManifests); + }); + http.use(router); + http.addAuthPolicy({ + path: `/`, + allow: 'unauthenticated', + }); + + } + }); + } +}); + +exports.default = testPlugin; +//# sourceMappingURL=alpha.cjs.js.map diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/node_modules/private-dep-with-frontend-plugin-index-path/index.js b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/node_modules/private-dep-with-frontend-plugin-index-path/index.js new file mode 100644 index 0000000000..e0fb6a55de --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/node_modules/private-dep-with-frontend-plugin-index-path/index.js @@ -0,0 +1,7 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +const frontendPluginsIndexPath = 'frontend-plugins'; + +exports.frontendPluginsIndexPath = frontendPluginsIndexPath; diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/node_modules/private-dep-with-frontend-plugin-index-path/package.json b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/node_modules/private-dep-with-frontend-plugin-index-path/package.json new file mode 100644 index 0000000000..4717963f57 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/node_modules/private-dep-with-frontend-plugin-index-path/package.json @@ -0,0 +1,7 @@ +{ + "name": "private-dep-with-frontend-plugin-index-path", + "version": "0.0.0", + "description": "private dependency of the test backend plugin", + "main": "index.js", + "dependencies": {} +} diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/package.json b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/package.json new file mode 100644 index 0000000000..4fb0100125 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic/package.json @@ -0,0 +1,35 @@ +{ + "name": "plugin-test-backend-dynamic", + "version": "0.0.0", + "description": "A test dynamic backend module that exposes the dynamic frontend plugins to an endpoint.", + "backstage": { + "role": "backend-plugin", + "pluginId": "test", + "pluginPackages": [ + "plugin-test", + "plugin-test-backend" + ] + }, + "publishConfig": { + "access": "public" + }, + "keywords": [ + "backstage", + "dynamic" + ], + "exports": { + ".": { + "require": "./dist/index.cjs.js", + "default": "./dist/index.cjs.js" + }, + "./package.json": "./package.json" + }, + "main": "./dist/index.cjs.js", + "files": [ + "dist" + ], + "dependencies": { + "private-dep-with-frontend-plugin-index-path": "0.0.0" + }, + "bundleDependencies": true +} diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/configSchema.json b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/configSchema.json new file mode 100644 index 0000000000..a1f22b0374 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/configSchema.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "test-frontend": { + "type": "object", + "required": [ + "frontendValue" + ], + "properties": { + "frontendValue": { + "type": "string", + "visibility": "frontend" + } + } + } + } +} diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/mf-manifest.json b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/mf-manifest.json new file mode 100644 index 0000000000..99a2949671 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/mf-manifest.json @@ -0,0 +1,29 @@ +{ + "id": "backstage__plugin_test", + "name": "backstage__plugin_test", + "metaData": { + "name": "backstage__plugin_test", + "type": "app", + "buildInfo": { + "buildVersion": "0.0.0", + "buildName": "@backstage/plugin-test" + }, + "remoteEntry": { + "name": "remoteEntry.js", + "path": "", + "type": "global" + }, + "types": { + "path": "", + "name": "", + "zip": "", + "api": "" + }, + "globalName": "backstage__plugin_test", + "pluginVersion": "0.0.0", + "publicPath": "auto" + }, + "shared": [], + "remotes": [], + "exposes": [] +} diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/remoteEntry.js b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/remoteEntry.js new file mode 100644 index 0000000000..b4554e2a8c --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/dist/remoteEntry.js @@ -0,0 +1,17 @@ +/* + * Copyright 2023 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. + */ + +(function doNothing(){})(); diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/package.json b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/package.json new file mode 100644 index 0000000000..06531a2363 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-dynamic/package.json @@ -0,0 +1,20 @@ +{ + "name": "plugin-test-dynamic", + "version": "0.0.0", + "description": "A test dynamic, module-federation-based, Backstage frontend plugin that does nothing", + "backstage": { + "role": "frontend-dynamic-container", + "pluginId": "test", + "pluginPackages": [ + "plugin-test" + ] + }, + "publishConfig": { + "access": "public" + }, + "keywords": [ + "backstage", + "dynamic" + ], + "main": "remote-entry.js" +} diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/.shouldNotBeUsed b/packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/.shouldNotBeUsed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/@backstage/backend-plugin-api/index.js b/packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/@backstage/backend-plugin-api/index.js new file mode 100644 index 0000000000..05b446cbe6 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/@backstage/backend-plugin-api/index.js @@ -0,0 +1 @@ +throw new Error("False @backstage/backend-plugin-api package which should be skipped by the CommonJSModuleLoader"); \ No newline at end of file diff --git a/packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/@backstage/backend-plugin-api/package.json b/packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/@backstage/backend-plugin-api/package.json new file mode 100644 index 0000000000..7b2e68e264 --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/__fixtures__/node_modules/@backstage/backend-plugin-api/package.json @@ -0,0 +1,7 @@ +{ + "name": "@backstage/backend-plugin-api", + "version": "0.0.0", + "description": "dummy backstage package that should be skipped by the ComonJSLoduleLoader", + "main": "index.js", + "dependencies": {} +} diff --git a/packages/backend-dynamic-feature-service/src/features/features.test.ts b/packages/backend-dynamic-feature-service/src/features/features.test.ts new file mode 100644 index 0000000000..daee127edc --- /dev/null +++ b/packages/backend-dynamic-feature-service/src/features/features.test.ts @@ -0,0 +1,306 @@ +/* + * Copyright 2023 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 { + startTestBackend, + mockServices, + createMockDirectory, +} from '@backstage/backend-test-utils'; +import { dynamicPluginsFeatureLoader } from './features'; +import { DynamicPlugin, dynamicPluginsServiceRef } from '../manager'; +import path, { resolve as resolvePath } from 'path'; +import { + BackendFeature, + createBackendPlugin, + LoggerService, +} from '@backstage/backend-plugin-api'; +import { CommonJSModuleLoader } from '../loader/CommonJSModuleLoader'; +import * as winston from 'winston'; +import { MESSAGE } from 'triple-beam'; +import { overridePackagePathResolution } from '@backstage/backend-plugin-api/testUtils'; + +async function jestFreeTypescriptAwareModuleLoader( + logger: LoggerService, + dontBootstrap: boolean = false, +) { + const loader = new CommonJSModuleLoader(logger); + (loader as any).module = await loader.load('node:module'); + loader.load(path.resolve(__dirname, '../../../cli/config/nodeTransform.cjs')); + if (dontBootstrap) { + loader.bootstrap = async () => {}; + } + return loader; +} + +class MockedTransport extends winston.transports.Console { + readonly logs: string[] = []; + + public log(info: any, callback: () => void) { + if (!info[MESSAGE]?.includes('info: Plugin initialization ')) { + this.logs.push(info[MESSAGE]); + } + super.log!(info, callback); + } + public logv(info: any, callback: () => void) { + if (!info[MESSAGE]?.includes('info: Plugin initialization ')) { + this.logs.push(info[MESSAGE]); + } + super.log!(info, callback); + } +} + +class DynamicPluginLister { + readonly loadedPlugins: DynamicPlugin[] = []; + feature(): BackendFeature { + // eslint-disable-next-line consistent-this + const that = this; + return createBackendPlugin({ + pluginId: 'dynamicPluginsLister', + register(reg) { + reg.registerInit({ + deps: { + dynamicPlugins: dynamicPluginsServiceRef, + }, + async init({ dynamicPlugins }) { + that.loadedPlugins.push(...dynamicPlugins.plugins(true)); + }, + }); + }, + }); + } +} + +describe('dynamicPluginsFeatureLoader', () => { + const dynamicPluginsRootDirectory = resolvePath( + __dirname, + '__fixtures__/dynamic-plugins-root', + ); + + // A dummy `@backstage/backend-plugin-api` package which throws an error is available inside the test fixtures, + // in a `node_modules` folder which is a sibling of the `dynamic-plugins-root`. + // This test demonstrates how, without the skipping logic implemented in the {@link CommonJSModelLoader}, + // this dummy package would be loaded by the backend dynamic plugins instead of the one of the backstage root. + it('should fail because the model loader is not skipping modules living in unexpected locations.', async () => { + const dynamicPLuginsLister = new DynamicPluginLister(); + const mockedTransport = new MockedTransport(); + await startTestBackend({ + features: [ + mockServices.rootConfig.factory({ + data: { + dynamicPlugins: { + rootDirectory: dynamicPluginsRootDirectory, + }, + }, + }), + dynamicPluginsFeatureLoader({ + moduleLoader: logger => + jestFreeTypescriptAwareModuleLoader(logger, true), + transports: [mockedTransport], + format: winston.format.simple(), + }), + dynamicPLuginsLister.feature(), + ], + }); + expect(mockedTransport.logs).toContainEqual( + expect.stringMatching( + "error: an error occurred while loading dynamic backend plugin 'plugin-test-backend-dynamic' from '.*/packages/backend-dynamic-feature-service/src/features/__fixtures__/dynamic-plugins-root/test-backend-dynamic", + ), + ); + expect(dynamicPLuginsLister.loadedPlugins).toMatchObject([ + { + name: 'plugin-test-backend-dynamic', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + failure: + 'Error: False @backstage/backend-plugin-api package which should be skipped by the CommonJSModuleLoader', + }, + expect.anything(), + ]); + }); + + it('should load and show the 2 dynamic plugins in a list of dynamic plugins returned by a static backend plugin', async () => { + const dynamicPLuginsLister = new DynamicPluginLister(); + await startTestBackend({ + features: [ + mockServices.rootConfig.factory({ + data: { + dynamicPlugins: { + rootDirectory: dynamicPluginsRootDirectory, + }, + }, + }), + dynamicPluginsFeatureLoader({ + moduleLoader: jestFreeTypescriptAwareModuleLoader, + }), + dynamicPLuginsLister.feature(), + ], + }); + + expect(dynamicPLuginsLister.loadedPlugins).toMatchObject([ + { + installer: { + kind: 'new', + }, + name: 'plugin-test-backend-dynamic', + platform: 'node', + role: 'backend-plugin', + version: '0.0.0', + }, + { + name: 'plugin-test-dynamic', + platform: 'web', + role: 'frontend-dynamic-container', + version: '0.0.0', + }, + ]); + }); + + it('should redact the secret config values of dynamic plugin config schemas in logs', async () => { + const mockedTransport = new MockedTransport(); + await startTestBackend({ + features: [ + mockServices.rootConfig.factory({ + data: { + dynamicPlugins: { + rootDirectory: dynamicPluginsRootDirectory, + }, + 'test-backend': { + secretValue: 'AVerySecretValue', + }, + }, + }), + dynamicPluginsFeatureLoader({ + moduleLoader: jestFreeTypescriptAwareModuleLoader, + transports: [mockedTransport], + format: winston.format.simple(), + }), + ], + }); + + expect(mockedTransport.logs).toContainEqual( + 'info: Found 1 new secrets in config that will be redacted {"service":"backstage"}', + ); + + expect(mockedTransport.logs).toContainEqual( + 'info: This secret value should be hidden by the dynamic-plugin-aware logger: *** {"service":"backstage"}', + ); + }); + + const mockAppDir = createMockDirectory(); + overridePackagePathResolution({ + packageName: 'app', + path: mockAppDir.path, + }); + + it('should inject frontend config values of dynamic frontend plugin config schemas to the frontend application', async () => { + mockAppDir.setContent({ + 'package.json': '{}', + dist: { + static: {}, + 'index.html.tmpl': '', + '.config-schema.json': ` +{ + "backstageConfigSchemaVersion": 1, + "schemas": [] +} +`, + }, + }); + + const { server } = await startTestBackend({ + features: [ + mockServices.rootConfig.factory({ + data: { + dynamicPlugins: { + rootDirectory: dynamicPluginsRootDirectory, + }, + 'test-frontend': { + frontendValue: 'AFrontendValue', + }, + }, + }), + dynamicPluginsFeatureLoader({ + moduleLoader: jestFreeTypescriptAwareModuleLoader, + }), + import('@backstage/plugin-app-backend/alpha'), + ], + }); + + await expect( + fetch(`http://localhost:${server.port()}`).then(res => res.text()), + ).resolves.toBe(` + +`); + }); + + it('should access the module federation assets of the frontend plugin through the backend plugin', async () => { + const { server } = await startTestBackend({ + features: [ + mockServices.rootConfig.factory({ + data: { + dynamicPlugins: { + rootDirectory: dynamicPluginsRootDirectory, + }, + }, + }), + dynamicPluginsFeatureLoader({ + moduleLoader: jestFreeTypescriptAwareModuleLoader, + }), + ], + }); + + const list = await fetch( + `http://localhost:${server.port()}/api/test/frontend-plugins`, + ); + expect(list.ok).toBe(true); + expect(await list.json()).toEqual({ + 'plugin-test-dynamic': `http://localhost:${server.port()}/api/test/frontend-plugins/plugin-test-dynamic/mf-manifest.json`, + }); + + const manifest = await fetch( + `http://localhost:${server.port()}/api/test/frontend-plugins/plugin-test-dynamic/mf-manifest.json`, + ); + expect(manifest.ok).toBe(true); + expect(await manifest.json()).toMatchObject({ + exposes: [], + id: 'backstage__plugin_test', + name: 'backstage__plugin_test', + metaData: { + buildInfo: { + buildName: '@backstage/plugin-test', + buildVersion: '0.0.0', + }, + globalName: 'backstage__plugin_test', + name: 'backstage__plugin_test', + pluginVersion: '0.0.0', + publicPath: 'auto', + }, + }); + }); +}); diff --git a/packages/backend-dynamic-feature-service/src/schemas/frontend.ts b/packages/backend-dynamic-feature-service/src/schemas/frontend.ts index 306ecc9255..d101487318 100644 --- a/packages/backend-dynamic-feature-service/src/schemas/frontend.ts +++ b/packages/backend-dynamic-feature-service/src/schemas/frontend.ts @@ -44,6 +44,7 @@ export const dynamicPluginsFrontendSchemas = createBackendModule({ config.getOptionalString('app.packageName') ?? 'app'; const appDistDir = resolvePackagePath(appPackageName, 'dist'); const compiledConfigSchema = await loadCompiledConfigSchema(appDistDir); + // TODO(davidfestal): Add dynamic pliugin config schemas even if the compiled schemas are empty. if (compiledConfigSchema) { configSchemaExtension.setConfigSchema( (await schemas.addDynamicPluginsSchemas(compiledConfigSchema)) diff --git a/yarn.lock b/yarn.lock index 7285cc8a19..c360f2247d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3712,6 +3712,7 @@ __metadata: "@backstage/config": "workspace:^" "@backstage/config-loader": "workspace:^" "@backstage/errors": "workspace:^" + "@backstage/plugin-app-backend": "workspace:^" "@backstage/plugin-app-node": "workspace:^" "@backstage/plugin-auth-node": "workspace:^" "@backstage/plugin-catalog-backend": "workspace:^" @@ -3729,6 +3730,7 @@ __metadata: express: ^4.17.1 fs-extra: ^11.2.0 lodash: ^4.17.21 + triple-beam: ^1.4.1 wait-for-expect: ^3.0.2 winston: ^3.2.1 languageName: unknown From 190241b2ffa1bf78d74b0ce65d8a1bc37c3daf42 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 09:10:41 +0000 Subject: [PATCH 052/268] chore(deps): update actions/checkout digest to eef6144 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/api-breaking-changes-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/api-breaking-changes-comment.yml b/.github/workflows/api-breaking-changes-comment.yml index e28f147706..038061adac 100644 --- a/.github/workflows/api-breaking-changes-comment.yml +++ b/.github/workflows/api-breaking-changes-comment.yml @@ -90,7 +90,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 # Identify comment to be updated - name: Find comment for API Changes From 5e5e4a850c1a779012b9644181cc805655964ee1 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Tue, 8 Oct 2024 09:25:02 -0400 Subject: [PATCH 053/268] fix redirect error encoding Signed-off-by: Stephen Glass --- .../core-components/src/layout/SignInPage/SignInPage.tsx | 2 +- packages/core-components/src/layout/SignInPage/providers.tsx | 5 +---- plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts | 4 +--- plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index 8e1249f83e..c3139f9316 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -167,7 +167,7 @@ export const SingleSignInPage = ({ useMountEffect(() => { if (errorParam) { - setError(new Error(decodeURIComponent(errorParam))); + setError(new Error(errorParam)); } login({ checkExisting: true }); }); diff --git a/packages/core-components/src/layout/SignInPage/providers.tsx b/packages/core-components/src/layout/SignInPage/providers.tsx index 9cb2fa3c9f..c1c3b744c1 100644 --- a/packages/core-components/src/layout/SignInPage/providers.tsx +++ b/packages/core-components/src/layout/SignInPage/providers.tsx @@ -101,10 +101,7 @@ export const useSignInProviders = ( const errorParam = searchParams.get('error'); if (errorParam) { errorApi.post( - new ForwardedError(t('signIn.loginFailed'), { - name: 'Error', - message: decodeURIComponent(errorParam), - }), + new ForwardedError(t('signIn.loginFailed'), new Error(errorParam)), ); } }); diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts index e2155df444..edf816cbee 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.test.ts @@ -768,9 +768,7 @@ describe('createOAuthRouteHandlers', () => { // Verify that the 'error' search param is set with the encoded error message const errorMessage = redirectUrl.searchParams.get('error'); - expect(errorMessage).toBe( - encodeURIComponent('Auth response is missing cookie nonce'), - ); + expect(errorMessage).toBe('Auth response is missing cookie nonce'); }); }); }); diff --git a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts index 46f8fc3eca..53ae4101d3 100644 --- a/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts +++ b/plugins/auth-node/src/oauth/createOAuthRouteHandlers.ts @@ -252,7 +252,7 @@ export function createOAuthRouteHandlers( if (state?.flow === 'redirect' && state?.redirectUrl) { const redirectUrl = new URL(state.redirectUrl); - redirectUrl.searchParams.set('error', encodeURIComponent(message)); + redirectUrl.searchParams.set('error', message); // set the error in a cookie and redirect user back to sign in where the error can be rendered res.redirect(redirectUrl.toString()); From 67f98d051d9e02b4d59c672a7d8db880b4224c5f Mon Sep 17 00:00:00 2001 From: David Festal Date: Tue, 8 Oct 2024 14:47:11 +0200 Subject: [PATCH 054/268] Fix review comments Signed-off-by: David Festal --- package.json | 1 - .../backend-dynamic-feature-service/README.md | 2 +- .../report.api.md | 94 ++++++++++--------- .../src/features/features.test.ts | 4 +- .../src/manager/plugin-manager.test.ts | 12 +-- .../src/manager/plugin-manager.ts | 16 ++-- .../src/manager/types.ts | 8 +- .../src/scanner/plugin-scanner.ts | 8 +- yarn.lock | 1 - 9 files changed, 78 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index 4826bcd56b..425b1c1a38 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,6 @@ "jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch" }, "dependencies": { - "@backstage/cli-node": "workspace:^", "@backstage/errors": "workspace:^", "@manypkg/get-packages": "^1.1.3", "@types/global-agent": "^2.1.3", diff --git a/packages/backend-dynamic-feature-service/README.md b/packages/backend-dynamic-feature-service/README.md index f4ca11bb1f..6f5af13636 100644 --- a/packages/backend-dynamic-feature-service/README.md +++ b/packages/backend-dynamic-feature-service/README.md @@ -15,7 +15,7 @@ In the `backend` application, it can be enabled by adding the `backend-dynamic-f ```ts const backend = createBackend(); + -+ backend.add(dynamicPluginsFeatureLoader) which provides features loaded by dynamic plugins ++ backend.add(dynamicPluginsFeatureLoader) // provides features loaded by dynamic plugins + ``` diff --git a/packages/backend-dynamic-feature-service/report.api.md b/packages/backend-dynamic-feature-service/report.api.md index 615b053869..edbe48b263 100644 --- a/packages/backend-dynamic-feature-service/report.api.md +++ b/packages/backend-dynamic-feature-service/report.api.md @@ -51,7 +51,7 @@ export type BackendDynamicPluginInstaller = // @public (undocumented) export interface BackendPluginProvider { // (undocumented) - backendPlugins(includeFailed?: boolean): BackendDynamicPlugin[]; + backendPlugins(options?: { includeFailed?: boolean }): BackendDynamicPlugin[]; } // @public (undocumented) @@ -78,17 +78,19 @@ export class DynamicPluginManager implements DynamicPluginProvider { // (undocumented) get availablePackages(): ScannedPluginPackage[]; // (undocumented) - backendPlugins(includeFailed?: boolean): BackendDynamicPlugin[]; + backendPlugins(options?: { includeFailed?: boolean }): BackendDynamicPlugin[]; // (undocumented) static create( options: DynamicPluginManagerOptions, ): Promise; // (undocumented) - frontendPlugins(includeFailed?: boolean): FrontendDynamicPlugin[]; + frontendPlugins(options?: { + includeFailed?: boolean; + }): FrontendDynamicPlugin[]; // (undocumented) getScannedPackage(plugin: DynamicPlugin): ScannedPluginPackage; // (undocumented) - plugins(includeFailed?: boolean): DynamicPlugin[]; + plugins(options?: { includeFailed?: boolean }): DynamicPlugin[]; } // @public (undocumented) @@ -110,7 +112,7 @@ export interface DynamicPluginProvider // (undocumented) getScannedPackage(plugin: DynamicPlugin): ScannedPluginPackage; // (undocumented) - plugins(includeFailed?: boolean): DynamicPlugin[]; + plugins(options?: { includeFailed?: boolean }): DynamicPlugin[]; } // @public (undocumented) @@ -201,7 +203,9 @@ export interface FrontendDynamicPlugin extends BaseDynamicPlugin { // @public (undocumented) export interface FrontendPluginProvider { // (undocumented) - frontendPlugins(includeFailed?: boolean): FrontendDynamicPlugin[]; + frontendPlugins(options?: { + includeFailed?: boolean; + }): FrontendDynamicPlugin[]; } // @public (undocumented) @@ -305,49 +309,49 @@ export interface ScannedPluginPackage { // src/manager/plugin-manager.d.ts:27:5 - (ae-undocumented) Missing documentation for "availablePackages". // src/manager/plugin-manager.d.ts:28:5 - (ae-undocumented) Missing documentation for "addBackendPlugin". // src/manager/plugin-manager.d.ts:31:5 - (ae-undocumented) Missing documentation for "backendPlugins". -// src/manager/plugin-manager.d.ts:32:5 - (ae-undocumented) Missing documentation for "frontendPlugins". -// src/manager/plugin-manager.d.ts:33:5 - (ae-undocumented) Missing documentation for "plugins". -// src/manager/plugin-manager.d.ts:34:5 - (ae-undocumented) Missing documentation for "getScannedPackage". -// src/manager/plugin-manager.d.ts:39:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceRef". -// src/manager/plugin-manager.d.ts:43:1 - (ae-undocumented) Missing documentation for "DynamicPluginsFactoryOptions". -// src/manager/plugin-manager.d.ts:44:5 - (ae-undocumented) Missing documentation for "moduleLoader". -// src/manager/plugin-manager.d.ts:50:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceFactoryWithOptions". -// src/manager/plugin-manager.d.ts:55:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceFactory". -// src/manager/plugin-manager.d.ts:60:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFeatureDiscoveryServiceFactory". -// src/manager/plugin-manager.d.ts:65:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFeatureDiscoveryLoader". +// src/manager/plugin-manager.d.ts:34:5 - (ae-undocumented) Missing documentation for "frontendPlugins". +// src/manager/plugin-manager.d.ts:37:5 - (ae-undocumented) Missing documentation for "plugins". +// src/manager/plugin-manager.d.ts:40:5 - (ae-undocumented) Missing documentation for "getScannedPackage". +// src/manager/plugin-manager.d.ts:45:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceRef". +// src/manager/plugin-manager.d.ts:49:1 - (ae-undocumented) Missing documentation for "DynamicPluginsFactoryOptions". +// src/manager/plugin-manager.d.ts:50:5 - (ae-undocumented) Missing documentation for "moduleLoader". +// src/manager/plugin-manager.d.ts:56:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceFactoryWithOptions". +// src/manager/plugin-manager.d.ts:61:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceFactory". +// src/manager/plugin-manager.d.ts:66:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFeatureDiscoveryServiceFactory". +// src/manager/plugin-manager.d.ts:71:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFeatureDiscoveryLoader". // src/manager/types.d.ts:28:1 - (ae-undocumented) Missing documentation for "LegacyPluginEnvironment". // src/manager/types.d.ts:46:1 - (ae-undocumented) Missing documentation for "DynamicPluginProvider". // src/manager/types.d.ts:47:5 - (ae-undocumented) Missing documentation for "plugins". -// src/manager/types.d.ts:48:5 - (ae-undocumented) Missing documentation for "getScannedPackage". -// src/manager/types.d.ts:53:1 - (ae-undocumented) Missing documentation for "BackendPluginProvider". -// src/manager/types.d.ts:54:5 - (ae-undocumented) Missing documentation for "backendPlugins". -// src/manager/types.d.ts:59:1 - (ae-undocumented) Missing documentation for "FrontendPluginProvider". -// src/manager/types.d.ts:60:5 - (ae-undocumented) Missing documentation for "frontendPlugins". -// src/manager/types.d.ts:65:1 - (ae-undocumented) Missing documentation for "BaseDynamicPlugin". -// src/manager/types.d.ts:66:5 - (ae-undocumented) Missing documentation for "name". -// src/manager/types.d.ts:67:5 - (ae-undocumented) Missing documentation for "version". -// src/manager/types.d.ts:68:5 - (ae-undocumented) Missing documentation for "role". -// src/manager/types.d.ts:69:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:70:5 - (ae-undocumented) Missing documentation for "failure". -// src/manager/types.d.ts:75:1 - (ae-undocumented) Missing documentation for "DynamicPlugin". -// src/manager/types.d.ts:79:1 - (ae-undocumented) Missing documentation for "FrontendDynamicPlugin". -// src/manager/types.d.ts:80:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:85:1 - (ae-undocumented) Missing documentation for "BackendDynamicPlugin". +// src/manager/types.d.ts:50:5 - (ae-undocumented) Missing documentation for "getScannedPackage". +// src/manager/types.d.ts:55:1 - (ae-undocumented) Missing documentation for "BackendPluginProvider". +// src/manager/types.d.ts:56:5 - (ae-undocumented) Missing documentation for "backendPlugins". +// src/manager/types.d.ts:63:1 - (ae-undocumented) Missing documentation for "FrontendPluginProvider". +// src/manager/types.d.ts:64:5 - (ae-undocumented) Missing documentation for "frontendPlugins". +// src/manager/types.d.ts:71:1 - (ae-undocumented) Missing documentation for "BaseDynamicPlugin". +// src/manager/types.d.ts:72:5 - (ae-undocumented) Missing documentation for "name". +// src/manager/types.d.ts:73:5 - (ae-undocumented) Missing documentation for "version". +// src/manager/types.d.ts:74:5 - (ae-undocumented) Missing documentation for "role". +// src/manager/types.d.ts:75:5 - (ae-undocumented) Missing documentation for "platform". +// src/manager/types.d.ts:76:5 - (ae-undocumented) Missing documentation for "failure". +// src/manager/types.d.ts:81:1 - (ae-undocumented) Missing documentation for "DynamicPlugin". +// src/manager/types.d.ts:85:1 - (ae-undocumented) Missing documentation for "FrontendDynamicPlugin". // src/manager/types.d.ts:86:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:87:5 - (ae-undocumented) Missing documentation for "installer". -// src/manager/types.d.ts:92:1 - (ae-undocumented) Missing documentation for "BackendDynamicPluginInstaller". -// src/manager/types.d.ts:96:1 - (ae-undocumented) Missing documentation for "NewBackendPluginInstaller". -// src/manager/types.d.ts:97:5 - (ae-undocumented) Missing documentation for "kind". -// src/manager/types.d.ts:98:5 - (ae-undocumented) Missing documentation for "install". -// src/manager/types.d.ts:111:1 - (ae-undocumented) Missing documentation for "LegacyBackendPluginInstaller". -// src/manager/types.d.ts:112:5 - (ae-undocumented) Missing documentation for "kind". -// src/manager/types.d.ts:113:5 - (ae-undocumented) Missing documentation for "router". -// src/manager/types.d.ts:117:5 - (ae-undocumented) Missing documentation for "catalog". -// src/manager/types.d.ts:118:5 - (ae-undocumented) Missing documentation for "scaffolder". -// src/manager/types.d.ts:119:5 - (ae-undocumented) Missing documentation for "search". -// src/manager/types.d.ts:120:5 - (ae-undocumented) Missing documentation for "events". -// src/manager/types.d.ts:121:5 - (ae-undocumented) Missing documentation for "permissions". -// src/manager/types.d.ts:128:1 - (ae-undocumented) Missing documentation for "isBackendDynamicPluginInstaller". +// src/manager/types.d.ts:91:1 - (ae-undocumented) Missing documentation for "BackendDynamicPlugin". +// src/manager/types.d.ts:92:5 - (ae-undocumented) Missing documentation for "platform". +// src/manager/types.d.ts:93:5 - (ae-undocumented) Missing documentation for "installer". +// src/manager/types.d.ts:98:1 - (ae-undocumented) Missing documentation for "BackendDynamicPluginInstaller". +// src/manager/types.d.ts:102:1 - (ae-undocumented) Missing documentation for "NewBackendPluginInstaller". +// src/manager/types.d.ts:103:5 - (ae-undocumented) Missing documentation for "kind". +// src/manager/types.d.ts:104:5 - (ae-undocumented) Missing documentation for "install". +// src/manager/types.d.ts:117:1 - (ae-undocumented) Missing documentation for "LegacyBackendPluginInstaller". +// src/manager/types.d.ts:118:5 - (ae-undocumented) Missing documentation for "kind". +// src/manager/types.d.ts:119:5 - (ae-undocumented) Missing documentation for "router". +// src/manager/types.d.ts:123:5 - (ae-undocumented) Missing documentation for "catalog". +// src/manager/types.d.ts:124:5 - (ae-undocumented) Missing documentation for "scaffolder". +// src/manager/types.d.ts:125:5 - (ae-undocumented) Missing documentation for "search". +// src/manager/types.d.ts:126:5 - (ae-undocumented) Missing documentation for "events". +// src/manager/types.d.ts:127:5 - (ae-undocumented) Missing documentation for "permissions". +// src/manager/types.d.ts:134:1 - (ae-undocumented) Missing documentation for "isBackendDynamicPluginInstaller". // src/scanner/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "ScannedPluginPackage". // src/scanner/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "location". // src/scanner/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "manifest". diff --git a/packages/backend-dynamic-feature-service/src/features/features.test.ts b/packages/backend-dynamic-feature-service/src/features/features.test.ts index daee127edc..851e1d0578 100644 --- a/packages/backend-dynamic-feature-service/src/features/features.test.ts +++ b/packages/backend-dynamic-feature-service/src/features/features.test.ts @@ -75,7 +75,9 @@ class DynamicPluginLister { dynamicPlugins: dynamicPluginsServiceRef, }, async init({ dynamicPlugins }) { - that.loadedPlugins.push(...dynamicPlugins.plugins(true)); + that.loadedPlugins.push( + ...dynamicPlugins.plugins({ includeFailed: true }), + ); }, }); }, diff --git a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.test.ts b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.test.ts index 6c129c07e2..b6854e3263 100644 --- a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.test.ts +++ b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.test.ts @@ -682,7 +682,7 @@ describe('backend-dynamic-feature-service', () => { version: '0.0.0', }, ]); - expect(pluginManager.backendPlugins(false)).toEqual([ + expect(pluginManager.backendPlugins({ includeFailed: false })).toEqual([ { name: 'a-backend-plugin', platform: 'node', @@ -696,7 +696,7 @@ describe('backend-dynamic-feature-service', () => { version: '0.0.0', }, ]); - expect(pluginManager.backendPlugins(true)).toEqual([ + expect(pluginManager.backendPlugins({ includeFailed: true })).toEqual([ { name: 'a-backend-plugin', platform: 'node', @@ -740,7 +740,7 @@ describe('backend-dynamic-feature-service', () => { version: '0.0.0', }, ]); - expect(pluginManager.frontendPlugins(false)).toEqual([ + expect(pluginManager.frontendPlugins({ includeFailed: false })).toEqual([ { name: 'a-frontend-plugin', platform: 'web', @@ -754,7 +754,7 @@ describe('backend-dynamic-feature-service', () => { version: '0.0.0', }, ]); - expect(pluginManager.frontendPlugins(true)).toEqual([ + expect(pluginManager.frontendPlugins({ includeFailed: true })).toEqual([ { name: 'a-frontend-plugin', platform: 'web', @@ -810,7 +810,7 @@ describe('backend-dynamic-feature-service', () => { version: '0.0.0', }, ]); - expect(pluginManager.plugins(false)).toEqual([ + expect(pluginManager.plugins({ includeFailed: false })).toEqual([ { name: 'a-frontend-plugin', platform: 'web', @@ -836,7 +836,7 @@ describe('backend-dynamic-feature-service', () => { version: '0.0.0', }, ]); - expect(pluginManager.plugins(true)).toEqual([ + expect(pluginManager.plugins({ includeFailed: true })).toEqual([ { name: 'a-frontend-plugin', platform: 'web', diff --git a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts index a3b4bfbf98..a94a01f0f1 100644 --- a/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts +++ b/packages/backend-dynamic-feature-service/src/manager/plugin-manager.ts @@ -217,20 +217,24 @@ export class DynamicPluginManager implements DynamicPluginProvider { } } - backendPlugins(includeFailed?: boolean): BackendDynamicPlugin[] { - return this.plugins(includeFailed).filter( + backendPlugins(options?: { + includeFailed?: boolean; + }): BackendDynamicPlugin[] { + return this.plugins(options).filter( (p): p is BackendDynamicPlugin => p.platform === 'node', ); } - frontendPlugins(includeFailed?: boolean): FrontendDynamicPlugin[] { - return this.plugins(includeFailed).filter( + frontendPlugins(options?: { + includeFailed?: boolean; + }): FrontendDynamicPlugin[] { + return this.plugins(options).filter( (p): p is FrontendDynamicPlugin => p.platform === 'web', ); } - plugins(includeFailed?: boolean): DynamicPlugin[] { - return this._plugins.filter(p => includeFailed || !p.failure); + plugins(options?: { includeFailed?: boolean }): DynamicPlugin[] { + return this._plugins.filter(p => options?.includeFailed || !p.failure); } getScannedPackage(plugin: DynamicPlugin): ScannedPluginPackage { diff --git a/packages/backend-dynamic-feature-service/src/manager/types.ts b/packages/backend-dynamic-feature-service/src/manager/types.ts index d3989b5ff9..89ac140bc6 100644 --- a/packages/backend-dynamic-feature-service/src/manager/types.ts +++ b/packages/backend-dynamic-feature-service/src/manager/types.ts @@ -79,7 +79,7 @@ export type LegacyPluginEnvironment = { export interface DynamicPluginProvider extends FrontendPluginProvider, BackendPluginProvider { - plugins(includeFailed?: boolean): DynamicPlugin[]; + plugins(options?: { includeFailed?: boolean }): DynamicPlugin[]; getScannedPackage(plugin: DynamicPlugin): ScannedPluginPackage; } @@ -87,14 +87,16 @@ export interface DynamicPluginProvider * @public */ export interface BackendPluginProvider { - backendPlugins(includeFailed?: boolean): BackendDynamicPlugin[]; + backendPlugins(options?: { includeFailed?: boolean }): BackendDynamicPlugin[]; } /** * @public */ export interface FrontendPluginProvider { - frontendPlugins(includeFailed?: boolean): FrontendDynamicPlugin[]; + frontendPlugins(options?: { + includeFailed?: boolean; + }): FrontendDynamicPlugin[]; } /** diff --git a/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner.ts b/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner.ts index 80ae2ed876..7091999e7b 100644 --- a/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner.ts +++ b/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner.ts @@ -72,25 +72,25 @@ export class PluginScanner { private applyConfig(): void | never { const dynamicPlugins = this.config.getOptional(configKey); if (!dynamicPlugins) { - this.logger.info("'dynamicPlugins' config entry not found."); + this.logger.info(`'${configKey}' config entry not found.`); this._rootDirectory = undefined; return; } if (typeof dynamicPlugins !== 'object') { - this.logger.warn("'dynamicPlugins' config entry should be an object."); + this.logger.warn(`'${configKey}' config entry should be an object.`); this._rootDirectory = undefined; return; } if (!('rootDirectory' in dynamicPlugins)) { this.logger.warn( - "'dynamicPlugins' config entry does not contain the 'rootDirectory' field.", + `'${configKey}' config entry does not contain the 'rootDirectory' field.`, ); this._rootDirectory = undefined; return; } if (typeof dynamicPlugins.rootDirectory !== 'string') { this.logger.warn( - "'dynamicPlugins.rootDirectory' config entry should be a string.", + `'${configKey}.rootDirectory' config entry should be a string.`, ); this._rootDirectory = undefined; return; diff --git a/yarn.lock b/yarn.lock index c360f2247d..36f19e9093 100644 --- a/yarn.lock +++ b/yarn.lock @@ -40003,7 +40003,6 @@ __metadata: resolution: "root@workspace:." dependencies: "@backstage/cli": "workspace:*" - "@backstage/cli-node": "workspace:^" "@backstage/codemods": "workspace:*" "@backstage/create-app": "workspace:*" "@backstage/e2e-test-utils": "workspace:*" From 9cc7dd6cfd05549319b7fbce22684e766c3a0639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 8 Oct 2024 17:03:22 +0200 Subject: [PATCH 055/268] implement the beginnings of mockApis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/real-rockets-divide.md | 5 + .changeset/thin-chairs-ring.md | 8 + packages/backend-test-utils/report.api.md | 119 ++++++----- .../src/next/services/mockServices.ts | 39 ++++ .../auth/bitbucket/BitbucketAuth.test.ts | 4 +- .../BitbucketServerAuth.test.ts | 4 +- .../auth/github/GithubAuth.test.ts | 4 +- .../auth/gitlab/GitlabAuth.test.ts | 4 +- .../auth/google/GoogleAuth.test.ts | 4 +- .../auth/oauth2/OAuth2.test.ts | 4 +- .../auth/okta/OktaAuth.test.ts | 4 +- .../src/app/resolveRouteBindings.test.ts | 60 +++--- .../SupportButton/SupportButton.test.tsx | 26 +-- .../extractRouteInfoFromAppNode.test.ts | 4 +- .../src/wiring/createSpecializedApp.test.tsx | 4 +- .../frontend-defaults/src/createApp.test.tsx | 26 +-- .../src/createPublicSignInApp.test.tsx | 6 +- .../src/wiring/createFrontendPlugin.test.ts | 4 +- packages/frontend-test-utils/package.json | 1 - packages/frontend-test-utils/report.api.md | 15 +- .../frontend-test-utils/src/apis/index.ts | 3 +- packages/test-utils/package.json | 5 + packages/test-utils/report.api.md | 31 ++- .../src/testUtils}/apis/ApiMock.ts | 2 +- .../testUtils/apis/ConfigApi/MockConfigApi.ts | 1 + .../test-utils/src/testUtils/apis/index.ts | 2 + .../src/testUtils/apis/mockApis.test.tsx | 40 ++++ .../test-utils/src/testUtils/apis/mockApis.ts | 188 ++++++++++++++++++ .../PreviewCatalogInfoComponent.test.tsx | 14 +- .../StepPrepareCreatePullRequest.test.tsx | 4 +- plugins/home/src/api/config.test.ts | 62 +++--- .../VisitedByType/Content.test.tsx | 76 +++---- .../SearchFilter.Autocomplete.test.tsx | 12 +- .../SearchFilter/SearchFilter.test.tsx | 12 +- .../components/SearchFilter/hooks.test.tsx | 17 +- .../SearchPagination.test.tsx | 12 +- .../src/context/SearchContext.test.tsx | 8 +- .../SearchType/SearchType.Accordion.test.tsx | 12 +- .../SearchType/SearchType.Tabs.test.tsx | 12 +- .../components/SearchType/SearchType.test.tsx | 12 +- plugins/techdocs-react/src/context.test.tsx | 5 +- plugins/techdocs/src/client.test.ts | 4 +- .../TechDocsReaderPage.test.tsx | 9 +- .../useNavigateUrl.test.tsx | 36 +--- yarn.lock | 7 +- 45 files changed, 632 insertions(+), 299 deletions(-) create mode 100644 .changeset/real-rockets-divide.md create mode 100644 .changeset/thin-chairs-ring.md rename packages/{frontend-test-utils/src => test-utils/src/testUtils}/apis/ApiMock.ts (94%) create mode 100644 packages/test-utils/src/testUtils/apis/mockApis.test.tsx create mode 100644 packages/test-utils/src/testUtils/apis/mockApis.ts diff --git a/.changeset/real-rockets-divide.md b/.changeset/real-rockets-divide.md new file mode 100644 index 0000000000..2506a89f22 --- /dev/null +++ b/.changeset/real-rockets-divide.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-test-utils': patch +--- + +Minor doc string changes diff --git a/.changeset/thin-chairs-ring.md b/.changeset/thin-chairs-ring.md new file mode 100644 index 0000000000..ebcb3afa93 --- /dev/null +++ b/.changeset/thin-chairs-ring.md @@ -0,0 +1,8 @@ +--- +'@backstage/test-utils': minor +'@backstage/frontend-test-utils': patch +--- + +Added a `mockApis` export, which will replace the `MockX` API implementation classes and their related types. This is analogous with the backend's `mockServices`. + +Deprecated `MockConfigApi`, please use `mockApis.config` instead. diff --git a/packages/backend-test-utils/report.api.md b/packages/backend-test-utils/report.api.md index 1235cd7cb3..d9c1c4c721 100644 --- a/packages/backend-test-utils/report.api.md +++ b/packages/backend-test-utils/report.api.md @@ -150,7 +150,7 @@ export function mockErrorHandler(): ErrorRequestHandler< Record >; -// @public (undocumented) +// @public export namespace mockServices { // (undocumented) export function auth(options?: { @@ -491,65 +491,64 @@ export class TestDatabases { // src/next/services/mockCredentials.d.ts:116:9 - (ae-undocumented) Missing documentation for "invalidToken". // src/next/services/mockCredentials.d.ts:117:9 - (ae-undocumented) Missing documentation for "invalidHeader". // src/next/services/mockServices.d.ts:5:1 - (ae-undocumented) Missing documentation for "ServiceMock". -// src/next/services/mockServices.d.ts:13:1 - (ae-undocumented) Missing documentation for "mockServices". -// src/next/services/mockServices.d.ts:14:5 - (ae-undocumented) Missing documentation for "rootConfig". -// src/next/services/mockServices.d.ts:15:5 - (ae-undocumented) Missing documentation for "rootConfig". -// src/next/services/mockServices.d.ts:16:9 - (ae-undocumented) Missing documentation for "Options". -// src/next/services/mockServices.d.ts:19:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:20:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:22:5 - (ae-undocumented) Missing documentation for "rootLogger". -// src/next/services/mockServices.d.ts:23:5 - (ae-undocumented) Missing documentation for "rootLogger". -// src/next/services/mockServices.d.ts:24:9 - (ae-undocumented) Missing documentation for "Options". -// src/next/services/mockServices.d.ts:27:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:28:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:30:5 - (ae-undocumented) Missing documentation for "auth". -// src/next/services/mockServices.d.ts:34:5 - (ae-undocumented) Missing documentation for "auth". -// src/next/services/mockServices.d.ts:35:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:36:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:38:5 - (ae-undocumented) Missing documentation for "discovery". -// src/next/services/mockServices.d.ts:39:5 - (ae-undocumented) Missing documentation for "discovery". -// src/next/services/mockServices.d.ts:40:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:41:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:61:5 - (ae-undocumented) Missing documentation for "httpAuth". -// src/next/services/mockServices.d.ts:72:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:82:5 - (ae-undocumented) Missing documentation for "userInfo". -// src/next/services/mockServices.d.ts:90:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:92:5 - (ae-undocumented) Missing documentation for "cache". -// src/next/services/mockServices.d.ts:93:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:94:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:96:5 - (ae-undocumented) Missing documentation for "database". -// src/next/services/mockServices.d.ts:97:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:98:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:100:5 - (ae-undocumented) Missing documentation for "rootHealth". -// src/next/services/mockServices.d.ts:101:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:102:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:104:5 - (ae-undocumented) Missing documentation for "httpRouter". -// src/next/services/mockServices.d.ts:105:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:106:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:108:5 - (ae-undocumented) Missing documentation for "rootHttpRouter". -// src/next/services/mockServices.d.ts:109:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:110:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:112:5 - (ae-undocumented) Missing documentation for "lifecycle". -// src/next/services/mockServices.d.ts:113:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:114:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:116:5 - (ae-undocumented) Missing documentation for "logger". -// src/next/services/mockServices.d.ts:117:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:118:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:120:5 - (ae-undocumented) Missing documentation for "permissions". -// src/next/services/mockServices.d.ts:121:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:122:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:124:5 - (ae-undocumented) Missing documentation for "rootLifecycle". -// src/next/services/mockServices.d.ts:125:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:126:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:128:5 - (ae-undocumented) Missing documentation for "scheduler". -// src/next/services/mockServices.d.ts:129:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:130:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:132:5 - (ae-undocumented) Missing documentation for "urlReader". -// src/next/services/mockServices.d.ts:133:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:134:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:136:5 - (ae-undocumented) Missing documentation for "events". -// src/next/services/mockServices.d.ts:137:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:138:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:53:5 - (ae-undocumented) Missing documentation for "rootConfig". +// src/next/services/mockServices.d.ts:54:5 - (ae-undocumented) Missing documentation for "rootConfig". +// src/next/services/mockServices.d.ts:55:9 - (ae-undocumented) Missing documentation for "Options". +// src/next/services/mockServices.d.ts:58:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:59:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:61:5 - (ae-undocumented) Missing documentation for "rootLogger". +// src/next/services/mockServices.d.ts:62:5 - (ae-undocumented) Missing documentation for "rootLogger". +// src/next/services/mockServices.d.ts:63:9 - (ae-undocumented) Missing documentation for "Options". +// src/next/services/mockServices.d.ts:66:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:67:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:69:5 - (ae-undocumented) Missing documentation for "auth". +// src/next/services/mockServices.d.ts:73:5 - (ae-undocumented) Missing documentation for "auth". +// src/next/services/mockServices.d.ts:74:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:75:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:77:5 - (ae-undocumented) Missing documentation for "discovery". +// src/next/services/mockServices.d.ts:78:5 - (ae-undocumented) Missing documentation for "discovery". +// src/next/services/mockServices.d.ts:79:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:80:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:100:5 - (ae-undocumented) Missing documentation for "httpAuth". +// src/next/services/mockServices.d.ts:111:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:121:5 - (ae-undocumented) Missing documentation for "userInfo". +// src/next/services/mockServices.d.ts:129:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:131:5 - (ae-undocumented) Missing documentation for "cache". +// src/next/services/mockServices.d.ts:132:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:133:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:135:5 - (ae-undocumented) Missing documentation for "database". +// src/next/services/mockServices.d.ts:136:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:137:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:139:5 - (ae-undocumented) Missing documentation for "rootHealth". +// src/next/services/mockServices.d.ts:140:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:141:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:143:5 - (ae-undocumented) Missing documentation for "httpRouter". +// src/next/services/mockServices.d.ts:144:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:145:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:147:5 - (ae-undocumented) Missing documentation for "rootHttpRouter". +// src/next/services/mockServices.d.ts:148:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:149:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:151:5 - (ae-undocumented) Missing documentation for "lifecycle". +// src/next/services/mockServices.d.ts:152:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:153:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:155:5 - (ae-undocumented) Missing documentation for "logger". +// src/next/services/mockServices.d.ts:156:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:157:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:159:5 - (ae-undocumented) Missing documentation for "permissions". +// src/next/services/mockServices.d.ts:160:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:161:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:163:5 - (ae-undocumented) Missing documentation for "rootLifecycle". +// src/next/services/mockServices.d.ts:164:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:165:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:167:5 - (ae-undocumented) Missing documentation for "scheduler". +// src/next/services/mockServices.d.ts:168:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:169:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:171:5 - (ae-undocumented) Missing documentation for "urlReader". +// src/next/services/mockServices.d.ts:172:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:173:15 - (ae-undocumented) Missing documentation for "mock". +// src/next/services/mockServices.d.ts:175:5 - (ae-undocumented) Missing documentation for "events". +// src/next/services/mockServices.d.ts:176:15 - (ae-undocumented) Missing documentation for "factory". +// src/next/services/mockServices.d.ts:177:15 - (ae-undocumented) Missing documentation for "mock". // src/next/wiring/TestBackend.d.ts:5:1 - (ae-undocumented) Missing documentation for "TestBackendOptions". // src/next/wiring/TestBackend.d.ts:6:5 - (ae-undocumented) Missing documentation for "extensionPoints". // src/next/wiring/TestBackend.d.ts:14:5 - (ae-undocumented) Missing documentation for "features". diff --git a/packages/backend-test-utils/src/next/services/mockServices.ts b/packages/backend-test-utils/src/next/services/mockServices.ts index 8b0f196399..789b75de9d 100644 --- a/packages/backend-test-utils/src/next/services/mockServices.ts +++ b/packages/backend-test-utils/src/next/services/mockServices.ts @@ -128,7 +128,46 @@ function simpleMock( } /** + * Mock implementations of the core services, to be used in tests. + * * @public + * @remarks + * + * There are some variations among the services depending on what needs tests + * might have, but overall there are three main usage patterns: + * + * 1. Creating an actual fake service instance, often with a simplified version + * of functionality, by calling the mock service itself as a function. + * + * ```ts + * // The function often accepts parameters that control its behavior + * const foo = mockServices.foo(); + * ``` + * + * 2. Creating a mock service, where all methods are replaced with jest mocks, by + * calling the service's `mock` function. + * + * ```ts + * // You can optionally supply a subset of its methods to implement + * const foo = mockServices.foo.mock({ + * someMethod: () => 'mocked result', + * }); + * // After exercising your test, you can make assertions on the mock: + * expect(foo.someMethod).toHaveBeenCalledTimes(2); + * expect(foo.otherMethod).toHaveBeenCalledWith(testData); + * ``` + * + * 3. Creating a service factory that behaves similarly to the mock as per above. + * + * ```ts + * await startTestBackend({ + * features: [ + * mockServices.foo.factory({ + * someMethod: () => 'mocked result', + * }) + * ], + * }); + * ``` */ export namespace mockServices { export function rootConfig(options?: rootConfig.Options): RootConfigService { diff --git a/packages/core-app-api/src/apis/implementations/auth/bitbucket/BitbucketAuth.test.ts b/packages/core-app-api/src/apis/implementations/auth/bitbucket/BitbucketAuth.test.ts index 1335808280..c1359ee6b2 100644 --- a/packages/core-app-api/src/apis/implementations/auth/bitbucket/BitbucketAuth.test.ts +++ b/packages/core-app-api/src/apis/implementations/auth/bitbucket/BitbucketAuth.test.ts @@ -17,7 +17,7 @@ import MockOAuthApi from '../../OAuthRequestApi/MockOAuthApi'; import { UrlPatternDiscovery } from '../../DiscoveryApi'; import BitbucketAuth from './BitbucketAuth'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; const getSession = jest.fn(); @@ -33,7 +33,7 @@ describe('BitbucketAuth', () => { jest.resetAllMocks(); }); - const configApi = new MockConfigApi({}); + const configApi = mockApis.config(); it.each([ ['team api write_repository', ['team', 'api', 'write_repository']], diff --git a/packages/core-app-api/src/apis/implementations/auth/bitbucketServer/BitbucketServerAuth.test.ts b/packages/core-app-api/src/apis/implementations/auth/bitbucketServer/BitbucketServerAuth.test.ts index 5631a9a886..39f1d0dd68 100644 --- a/packages/core-app-api/src/apis/implementations/auth/bitbucketServer/BitbucketServerAuth.test.ts +++ b/packages/core-app-api/src/apis/implementations/auth/bitbucketServer/BitbucketServerAuth.test.ts @@ -17,7 +17,7 @@ import MockOAuthApi from '../../OAuthRequestApi/MockOAuthApi'; import { UrlPatternDiscovery } from '../../DiscoveryApi'; import BitbucketServerAuth from './BitbucketServerAuth'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; const getSession = jest.fn(); @@ -41,7 +41,7 @@ describe('BitbucketServerAuth', () => { ['PROJECT_ADMIN', 'REPO_READ', 'ACCOUNT_WRITE'], ], ])(`should normalize scopes correctly - %p`, (scope, scopes) => { - const configApi = new MockConfigApi({}); + const configApi = mockApis.config(); const bitbucketServerAuth = BitbucketServerAuth.create({ configApi: configApi, diff --git a/packages/core-app-api/src/apis/implementations/auth/github/GithubAuth.test.ts b/packages/core-app-api/src/apis/implementations/auth/github/GithubAuth.test.ts index fc77754f6f..8a7bb9e671 100644 --- a/packages/core-app-api/src/apis/implementations/auth/github/GithubAuth.test.ts +++ b/packages/core-app-api/src/apis/implementations/auth/github/GithubAuth.test.ts @@ -17,7 +17,7 @@ import { UrlPatternDiscovery } from '../../DiscoveryApi'; import MockOAuthApi from '../../OAuthRequestApi/MockOAuthApi'; import GithubAuth from './GithubAuth'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; const getSession = jest.fn(); @@ -33,7 +33,7 @@ describe('GithubAuth', () => { jest.resetAllMocks(); }); - const configApi = new MockConfigApi({}); + const configApi = mockApis.config(); it('should forward access token request to session manager', async () => { const githubAuth = GithubAuth.create({ diff --git a/packages/core-app-api/src/apis/implementations/auth/gitlab/GitlabAuth.test.ts b/packages/core-app-api/src/apis/implementations/auth/gitlab/GitlabAuth.test.ts index 6dde0c0334..0818bbb253 100644 --- a/packages/core-app-api/src/apis/implementations/auth/gitlab/GitlabAuth.test.ts +++ b/packages/core-app-api/src/apis/implementations/auth/gitlab/GitlabAuth.test.ts @@ -17,7 +17,7 @@ import MockOAuthApi from '../../OAuthRequestApi/MockOAuthApi'; import { UrlPatternDiscovery } from '../../DiscoveryApi'; import GitlabAuth from './GitlabAuth'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; const getSession = jest.fn(); @@ -40,7 +40,7 @@ describe('GitlabAuth', () => { ], ['read_repository sudo', ['read_repository', 'sudo']], ])(`should normalize scopes correctly - %p`, (scope, scopes) => { - const configApi = new MockConfigApi({}); + const configApi = mockApis.config(); const gitlabAuth = GitlabAuth.create({ configApi: configApi, diff --git a/packages/core-app-api/src/apis/implementations/auth/google/GoogleAuth.test.ts b/packages/core-app-api/src/apis/implementations/auth/google/GoogleAuth.test.ts index 7897eef42e..a740b3089b 100644 --- a/packages/core-app-api/src/apis/implementations/auth/google/GoogleAuth.test.ts +++ b/packages/core-app-api/src/apis/implementations/auth/google/GoogleAuth.test.ts @@ -17,7 +17,7 @@ import GoogleAuth from './GoogleAuth'; import MockOAuthApi from '../../OAuthRequestApi/MockOAuthApi'; import { UrlPatternDiscovery } from '../../DiscoveryApi'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; const PREFIX = 'https://www.googleapis.com/auth/'; @@ -59,7 +59,7 @@ describe('GoogleAuth', () => { [`${PREFIX}profile`, [`${PREFIX}profile`]], [`${PREFIX}openid`, [`${PREFIX}openid`]], ])(`should normalize scopes correctly - %p`, (scope, scopes) => { - const configApi = new MockConfigApi({}); + const configApi = mockApis.config(); const googleAuth = GoogleAuth.create({ configApi: configApi, diff --git a/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.test.ts b/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.test.ts index 8ca818ebd8..a34589d746 100644 --- a/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.test.ts +++ b/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.test.ts @@ -17,7 +17,7 @@ import OAuth2 from './OAuth2'; import MockOAuthApi from '../../OAuthRequestApi/MockOAuthApi'; import { UrlPatternDiscovery } from '../../DiscoveryApi'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; const theFuture = new Date(Date.now() + 3600000); const thePast = new Date(Date.now() - 10); @@ -35,7 +35,7 @@ jest.mock('../../../../lib/AuthSessionManager', () => ({ }, })); -const configApi = new MockConfigApi({}); +const configApi = mockApis.config(); describe('OAuth2', () => { it('should get refreshed access token', async () => { diff --git a/packages/core-app-api/src/apis/implementations/auth/okta/OktaAuth.test.ts b/packages/core-app-api/src/apis/implementations/auth/okta/OktaAuth.test.ts index 5e7370a947..621172f8cc 100644 --- a/packages/core-app-api/src/apis/implementations/auth/okta/OktaAuth.test.ts +++ b/packages/core-app-api/src/apis/implementations/auth/okta/OktaAuth.test.ts @@ -17,7 +17,7 @@ import OktaAuth from './OktaAuth'; import MockOAuthApi from '../../OAuthRequestApi/MockOAuthApi'; import { UrlPatternDiscovery } from '../../DiscoveryApi'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; const PREFIX = 'okta.'; @@ -51,7 +51,7 @@ describe('OktaAuth', () => { [`${PREFIX}profile`, [`${PREFIX}profile`]], [`${PREFIX}openid`, [`${PREFIX}openid`]], ])(`should normalize scopes correctly - %p`, (scope, scopes) => { - const configApi = new MockConfigApi({}); + const configApi = mockApis.config(); const auth = OktaAuth.create({ configApi: configApi, oauthRequestApi: new MockOAuthApi(), diff --git a/packages/core-app-api/src/app/resolveRouteBindings.test.ts b/packages/core-app-api/src/app/resolveRouteBindings.test.ts index fdc1a9e456..e3dbbba0af 100644 --- a/packages/core-app-api/src/app/resolveRouteBindings.test.ts +++ b/packages/core-app-api/src/app/resolveRouteBindings.test.ts @@ -20,7 +20,7 @@ import { createRouteRef, } from '@backstage/core-plugin-api'; import { collectRouteIds, resolveRouteBindings } from './resolveRouteBindings'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; describe('resolveRouteBindings', () => { it('runs happy path', () => { @@ -30,7 +30,7 @@ describe('resolveRouteBindings', () => { ({ bind }) => { bind(external, { myRoute: ref }); }, - new MockConfigApi({}), + mockApis.config(), [], ); @@ -45,7 +45,7 @@ describe('resolveRouteBindings', () => { ({ bind }) => { bind(external, { someOtherRoute: ref } as any); }, - new MockConfigApi({}), + mockApis.config(), [], ), ).toThrow('Key someOtherRoute is not an existing external route'); @@ -56,8 +56,10 @@ describe('resolveRouteBindings', () => { const myTarget = createRouteRef({ id: 'test' }); const result = resolveRouteBindings( () => {}, - new MockConfigApi({ - app: { routes: { bindings: { 'test.mySource': 'test.myTarget' } } }, + mockApis.config({ + data: { + app: { routes: { bindings: { 'test.mySource': 'test.myTarget' } } }, + }, }), [ createPlugin({ @@ -84,8 +86,10 @@ describe('resolveRouteBindings', () => { ({ bind }) => { bind({ mySource }, { mySource: false }); }, - new MockConfigApi({ - app: { routes: { bindings: { 'test.mySource': 'myTarget' } } }, + mockApis.config({ + data: { + app: { routes: { bindings: { 'test.mySource': 'myTarget' } } }, + }, }), [ createPlugin({ @@ -106,8 +110,8 @@ describe('resolveRouteBindings', () => { ({ bind }) => { bind({ mySource }, { mySource: myTarget }); }, - new MockConfigApi({ - app: { routes: { bindings: { 'test.mySource': false } } }, + mockApis.config({ + data: { app: { routes: { bindings: { 'test.mySource': false } } } }, }), [ createPlugin({ @@ -128,7 +132,7 @@ describe('resolveRouteBindings', () => { expect(() => resolveRouteBindings( () => {}, - new MockConfigApi({ app: { routes: { bindings: 'derp' } } }), + mockApis.config({ data: { app: { routes: { bindings: 'derp' } } } }), [], ), ).toThrow( @@ -138,8 +142,8 @@ describe('resolveRouteBindings', () => { expect(() => resolveRouteBindings( () => {}, - new MockConfigApi({ - app: { routes: { bindings: { 'test.mySource': true } } }, + mockApis.config({ + data: { app: { routes: { bindings: { 'test.mySource': true } } } }, }), [], ), @@ -150,8 +154,10 @@ describe('resolveRouteBindings', () => { expect(() => resolveRouteBindings( () => {}, - new MockConfigApi({ - app: { routes: { bindings: { 'test.mySource': 'test.myTarget' } } }, + mockApis.config({ + data: { + app: { routes: { bindings: { 'test.mySource': 'test.myTarget' } } }, + }, }), [], ), @@ -162,8 +168,10 @@ describe('resolveRouteBindings', () => { expect(() => resolveRouteBindings( () => {}, - new MockConfigApi({ - app: { routes: { bindings: { 'test.mySource': 'test.myTarget' } } }, + mockApis.config({ + data: { + app: { routes: { bindings: { 'test.mySource': 'test.myTarget' } } }, + }, }), [ createPlugin({ @@ -198,17 +206,17 @@ describe('resolveRouteBindings', () => { }); // defaultTarget wins only if no bind or config matches - let result = resolveRouteBindings(() => {}, new MockConfigApi({}), [ - plugin, - ]); + let result = resolveRouteBindings(() => {}, mockApis.config(), [plugin]); expect(result.get(source)).toBe(target1); // config wins over defaultTarget result = resolveRouteBindings( () => {}, - new MockConfigApi({ - app: { routes: { bindings: { 'test.source': 'test.target2' } } }, + mockApis.config({ + data: { + app: { routes: { bindings: { 'test.source': 'test.target2' } } }, + }, }), [plugin], ); @@ -220,7 +228,7 @@ describe('resolveRouteBindings', () => { ({ bind }) => { bind(plugin.externalRoutes, { source: plugin.routes.target2 }); }, - new MockConfigApi({}), + mockApis.config(), [plugin], ); @@ -257,17 +265,15 @@ describe('collectRouteIds', () => { }); // resolves normally with no config - let result = resolveRouteBindings(() => {}, new MockConfigApi({}), [ - plugin, - ]); + let result = resolveRouteBindings(() => {}, mockApis.config(), [plugin]); expect(result.get(source)).toBe(target1); // can be disabled result = resolveRouteBindings( () => {}, - new MockConfigApi({ - app: { routes: { bindings: { 'test.source': false } } }, + mockApis.config({ + data: { app: { routes: { bindings: { 'test.source': false } } } }, }), [plugin], ); diff --git a/packages/core-components/src/components/SupportButton/SupportButton.test.tsx b/packages/core-components/src/components/SupportButton/SupportButton.test.tsx index 6b0e239aa5..9ed8fb8401 100644 --- a/packages/core-components/src/components/SupportButton/SupportButton.test.tsx +++ b/packages/core-components/src/components/SupportButton/SupportButton.test.tsx @@ -16,7 +16,7 @@ import { configApiRef } from '@backstage/core-plugin-api'; import { - MockConfigApi, + mockApis, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -24,17 +24,19 @@ import { act, fireEvent, screen } from '@testing-library/react'; import React from 'react'; import { SupportButton } from './SupportButton'; -const configApi = new MockConfigApi({ - app: { - support: { - url: 'https://github.com', - items: [ - { - title: 'Github', - icon: 'github', - links: [{ title: 'Github Issues', url: '/issues' }], - }, - ], +const configApi = mockApis.config({ + data: { + app: { + support: { + url: 'https://github.com', + items: [ + { + title: 'Github', + icon: 'github', + links: [{ title: 'Github Issues', url: '/issues' }], + }, + ], + }, }, }, }); diff --git a/packages/frontend-app-api/src/routing/extractRouteInfoFromAppNode.test.ts b/packages/frontend-app-api/src/routing/extractRouteInfoFromAppNode.test.ts index 7ffe64d6d7..eac6e9d2aa 100644 --- a/packages/frontend-app-api/src/routing/extractRouteInfoFromAppNode.test.ts +++ b/packages/frontend-app-api/src/routing/extractRouteInfoFromAppNode.test.ts @@ -28,7 +28,7 @@ import { createFrontendPlugin, createRouteRef, } from '@backstage/frontend-plugin-api'; -import { MockConfigApi, TestApiRegistry } from '@backstage/test-utils'; +import { mockApis, TestApiRegistry } from '@backstage/test-utils'; import appPlugin from '@backstage/plugin-app'; import { readAppExtensionsConfig } from '../tree/readAppExtensionsConfig'; @@ -92,7 +92,7 @@ function routeInfoFromExtensions(extensions: ExtensionDefinition[]) { builtinExtensions: [ resolveExtensionDefinition(Root, { namespace: 'root' }), ], - parameters: readAppExtensionsConfig(new MockConfigApi({})), + parameters: readAppExtensionsConfig(mockApis.config()), forbidden: new Set(['root']), }), ); diff --git a/packages/frontend-app-api/src/wiring/createSpecializedApp.test.tsx b/packages/frontend-app-api/src/wiring/createSpecializedApp.test.tsx index 72594cefd1..6c5331a972 100644 --- a/packages/frontend-app-api/src/wiring/createSpecializedApp.test.tsx +++ b/packages/frontend-app-api/src/wiring/createSpecializedApp.test.tsx @@ -29,7 +29,7 @@ import { } from '@backstage/frontend-plugin-api'; import { screen, render } from '@testing-library/react'; import { createSpecializedApp } from './createSpecializedApp'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; import React from 'react'; import { configApiRef, @@ -98,7 +98,7 @@ describe('createSpecializedApp', () => { it('should forward config', () => { const app = createSpecializedApp({ - config: new MockConfigApi({ test: 'foo' }), + config: mockApis.config({ data: { test: 'foo' } }), features: [ createFrontendPlugin({ id: 'test', diff --git a/packages/frontend-defaults/src/createApp.test.tsx b/packages/frontend-defaults/src/createApp.test.tsx index 2890700653..06872a5691 100644 --- a/packages/frontend-defaults/src/createApp.test.tsx +++ b/packages/frontend-defaults/src/createApp.test.tsx @@ -26,7 +26,7 @@ import { } from '@backstage/frontend-plugin-api'; import { screen, waitFor } from '@testing-library/react'; import { CreateAppFeatureLoader, createApp } from './createApp'; -import { MockConfigApi, renderWithEffects } from '@backstage/test-utils'; +import { mockApis, renderWithEffects } from '@backstage/test-utils'; import React from 'react'; import { featureFlagsApiRef, useApi } from '@backstage/core-plugin-api'; import appPlugin from '@backstage/plugin-app'; @@ -35,12 +35,14 @@ describe('createApp', () => { it('should allow themes to be installed', async () => { const app = createApp({ configLoader: async () => ({ - config: new MockConfigApi({ - app: { - extensions: [ - { 'theme:app/light': false }, - { 'theme:app/dark': false }, - ], + config: mockApis.config({ + data: { + app: { + extensions: [ + { 'theme:app/light': false }, + { 'theme:app/dark': false }, + ], + }, }, }), }), @@ -72,7 +74,7 @@ describe('createApp', () => { it('should deduplicate features keeping the last received one', async () => { const duplicatedFeatureId = 'test'; const app = createApp({ - configLoader: async () => ({ config: new MockConfigApi({}) }), + configLoader: async () => ({ config: mockApis.config() }), features: [ createFrontendPlugin({ id: duplicatedFeatureId, @@ -135,7 +137,7 @@ describe('createApp', () => { const app = createApp({ configLoader: async () => ({ - config: new MockConfigApi({ key: 'config-value' }), + config: mockApis.config({ data: { key: 'config-value' } }), }), features: [appPlugin, loader], }); @@ -159,7 +161,7 @@ describe('createApp', () => { const app = createApp({ configLoader: async () => ({ - config: new MockConfigApi({}), + config: mockApis.config(), }), features: [loader], }); @@ -173,7 +175,7 @@ describe('createApp', () => { it('should register feature flags', async () => { const app = createApp({ - configLoader: async () => ({ config: new MockConfigApi({}) }), + configLoader: async () => ({ config: mockApis.config() }), features: [ appPlugin.withOverrides({ extensions: [ @@ -227,7 +229,7 @@ describe('createApp', () => { let appTreeApi: AppTreeApi | undefined = undefined; const app = createApp({ - configLoader: async () => ({ config: new MockConfigApi({}) }), + configLoader: async () => ({ config: mockApis.config() }), features: [ createFrontendPlugin({ id: 'my-plugin', diff --git a/packages/frontend-defaults/src/createPublicSignInApp.test.tsx b/packages/frontend-defaults/src/createPublicSignInApp.test.tsx index ac1adf9b0f..ce0f8c4b2a 100644 --- a/packages/frontend-defaults/src/createPublicSignInApp.test.tsx +++ b/packages/frontend-defaults/src/createPublicSignInApp.test.tsx @@ -22,7 +22,7 @@ import { import { render, screen, waitFor } from '@testing-library/react'; import React, { useEffect } from 'react'; import { createPublicSignInApp } from './createPublicSignInApp'; -import { MockConfigApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; describe('createPublicSignInApp', () => { beforeEach(() => { @@ -31,7 +31,7 @@ describe('createPublicSignInApp', () => { it('should render a sign-in page', async () => { const app = createPublicSignInApp({ - configLoader: async () => ({ config: new MockConfigApi({}) }), + configLoader: async () => ({ config: mockApis.config() }), features: [ createFrontendModule({ pluginId: 'app', @@ -59,7 +59,7 @@ describe('createPublicSignInApp', () => { .mockReturnValue(); const app = createPublicSignInApp({ - configLoader: async () => ({ config: new MockConfigApi({}) }), + configLoader: async () => ({ config: mockApis.config() }), features: [ createFrontendModule({ pluginId: 'app', diff --git a/packages/frontend-plugin-api/src/wiring/createFrontendPlugin.test.ts b/packages/frontend-plugin-api/src/wiring/createFrontendPlugin.test.ts index 65daad0586..678eff0b4c 100644 --- a/packages/frontend-plugin-api/src/wiring/createFrontendPlugin.test.ts +++ b/packages/frontend-plugin-api/src/wiring/createFrontendPlugin.test.ts @@ -23,7 +23,7 @@ import { JsonObject } from '@backstage/types'; import { createExtension } from './createExtension'; import { createExtensionDataRef } from './createExtensionDataRef'; import { coreExtensionData } from './coreExtensionData'; -import { MockConfigApi, renderWithEffects } from '@backstage/test-utils'; +import { mockApis, renderWithEffects } from '@backstage/test-utils'; import { createExtensionInput } from './createExtensionInput'; const nameExtensionDataRef = createExtensionDataRef().with({ @@ -128,7 +128,7 @@ function createTestAppRoot({ }) { return createApp({ features: [...features], - configLoader: async () => ({ config: new MockConfigApi(config) }), + configLoader: async () => ({ config: mockApis.config({ data: config }) }), }).createRoot(); } diff --git a/packages/frontend-test-utils/package.json b/packages/frontend-test-utils/package.json index 49869b7df9..27bb592879 100644 --- a/packages/frontend-test-utils/package.json +++ b/packages/frontend-test-utils/package.json @@ -50,7 +50,6 @@ }, "peerDependencies": { "@testing-library/react": "^16.0.0", - "@types/jest": "*", "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0", "react": "^16.13.1 || ^17.0.0 || ^18.0.0", "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0", diff --git a/packages/frontend-test-utils/report.api.md b/packages/frontend-test-utils/report.api.md index 3229da9898..dc37ec4fb4 100644 --- a/packages/frontend-test-utils/report.api.md +++ b/packages/frontend-test-utils/report.api.md @@ -3,13 +3,12 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -/// /// import { AnalyticsApi } from '@backstage/frontend-plugin-api'; import { AnalyticsEvent } from '@backstage/frontend-plugin-api'; import { AnyExtensionDataRef } from '@backstage/frontend-plugin-api'; -import { ApiFactory } from '@backstage/frontend-plugin-api'; +import { ApiMock } from '@backstage/test-utils'; import { AppNode } from '@backstage/frontend-plugin-api'; import { AppNodeInstance } from '@backstage/frontend-plugin-api'; import { ErrorWithContext } from '@backstage/test-utils'; @@ -18,6 +17,7 @@ import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { ExtensionDefinitionParameters } from '@backstage/frontend-plugin-api'; import { FrontendFeature } from '@backstage/frontend-app-api'; import { JsonObject } from '@backstage/types'; +import { mockApis } from '@backstage/test-utils'; import { MockConfigApi } from '@backstage/test-utils'; import { MockErrorApi } from '@backstage/test-utils'; import { MockErrorApiOptions } from '@backstage/test-utils'; @@ -34,14 +34,7 @@ import { TestApiProviderProps } from '@backstage/test-utils'; import { TestApiRegistry } from '@backstage/test-utils'; import { withLogCollector } from '@backstage/test-utils'; -// @public -export type ApiMock = { - factory: ApiFactory; -} & { - [Key in keyof TApi]: TApi[Key] extends (...args: infer Args) => infer Return - ? TApi[Key] & jest.MockInstance - : TApi[Key]; -}; +export { ApiMock }; // @public (undocumented) export function createExtensionTester( @@ -103,6 +96,8 @@ export class MockAnalyticsApi implements AnalyticsApi { getEvents(): AnalyticsEvent[]; } +export { mockApis }; + export { MockConfigApi }; export { MockErrorApi }; diff --git a/packages/frontend-test-utils/src/apis/index.ts b/packages/frontend-test-utils/src/apis/index.ts index 564c327aef..e5a0786cd0 100644 --- a/packages/frontend-test-utils/src/apis/index.ts +++ b/packages/frontend-test-utils/src/apis/index.ts @@ -24,7 +24,8 @@ export { MockPermissionApi, MockStorageApi, type MockStorageBucket, + mockApis, + type ApiMock, } from '@backstage/test-utils'; -export { type ApiMock } from './ApiMock'; export { MockAnalyticsApi } from './AnalyticsApi/MockAnalyticsApi'; diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 1c611fd584..47c61abae2 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -65,6 +65,7 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@testing-library/jest-dom": "^6.0.0", + "@types/jest": "*", "@types/react": "^18.0.0", "msw": "^1.0.0", "react": "^18.0.2", @@ -73,12 +74,16 @@ }, "peerDependencies": { "@testing-library/react": "^16.0.0", + "@types/jest": "*", "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0", "react": "^16.13.1 || ^17.0.0 || ^18.0.0", "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0", "react-router-dom": "6.0.0-beta.0 || ^6.3.0" }, "peerDependenciesMeta": { + "@types/jest": { + "optional": true + }, "@types/react": { "optional": true } diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index 4a1f297c4e..a551d54c62 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -3,8 +3,11 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +/// + import { AnalyticsApi } from '@backstage/core-plugin-api'; import { AnalyticsEvent } from '@backstage/core-plugin-api'; +import { ApiFactory } from '@backstage/core-plugin-api'; import { ApiHolder } from '@backstage/core-plugin-api'; import { ApiRef } from '@backstage/core-plugin-api'; import { AppComponents } from '@backstage/core-plugin-api'; @@ -39,6 +42,15 @@ import { RouteRef } from '@backstage/core-plugin-api'; import { StorageApi } from '@backstage/core-plugin-api'; import { StorageValueSnapshot } from '@backstage/core-plugin-api'; +// @public +export type ApiMock = { + factory: ApiFactory; +} & { + [Key in keyof TApi]: TApi[Key] extends (...args: infer Args) => infer Return + ? TApi[Key] & jest.MockInstance + : TApi[Key]; +}; + // @public export type AsyncLogCollector = () => Promise; @@ -77,10 +89,27 @@ export class MockAnalyticsApi implements AnalyticsApi { getEvents(): AnalyticsEvent[]; } +// @public +export namespace mockApis { + export function config(options?: { data?: JsonObject }): jest.Mocked; + export namespace config { + const factory: ( + options?: + | { + data?: JsonObject | undefined; + } + | undefined, + ) => ApiFactory; + const mock: (partialImpl?: Partial | undefined) => ApiMock; + } +} + // @public @deprecated export function mockBreakpoint(options: { matches: boolean }): void; -// @public +// Warning: (ae-unresolved-link) The @link reference could not be resolved: The reference is ambiguous because "config" has more than one declaration; you need to add a TSDoc member reference selector +// +// @public @deprecated export class MockConfigApi implements ConfigApi { constructor(data: JsonObject); get(key?: string): T; diff --git a/packages/frontend-test-utils/src/apis/ApiMock.ts b/packages/test-utils/src/testUtils/apis/ApiMock.ts similarity index 94% rename from packages/frontend-test-utils/src/apis/ApiMock.ts rename to packages/test-utils/src/testUtils/apis/ApiMock.ts index d11689f98a..fe66f35458 100644 --- a/packages/frontend-test-utils/src/apis/ApiMock.ts +++ b/packages/test-utils/src/testUtils/apis/ApiMock.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { ApiFactory } from '@backstage/frontend-plugin-api'; +import { ApiFactory } from '@backstage/core-plugin-api'; /** * Represents a mocked version of an API, where you automatically have access to diff --git a/packages/test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts b/packages/test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts index 372c295c02..9d7462889c 100644 --- a/packages/test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts +++ b/packages/test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts @@ -23,6 +23,7 @@ import { ConfigApi } from '@backstage/core-plugin-api'; * that can be used to mock configuration using a plain object. * * @public + * @deprecated Use {@link mockApis.config} instead * @example * ```tsx * const mockConfig = new MockConfigApi({ diff --git a/packages/test-utils/src/testUtils/apis/index.ts b/packages/test-utils/src/testUtils/apis/index.ts index e122a4b432..94738a598e 100644 --- a/packages/test-utils/src/testUtils/apis/index.ts +++ b/packages/test-utils/src/testUtils/apis/index.ts @@ -20,3 +20,5 @@ export * from './ErrorApi'; export * from './FetchApi'; export * from './PermissionApi'; export * from './StorageApi'; +export { type ApiMock } from './ApiMock'; +export { mockApis } from './mockApis'; diff --git a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx new file mode 100644 index 0000000000..b7a78867f8 --- /dev/null +++ b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx @@ -0,0 +1,40 @@ +/* + * Copyright 2024 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 { mockApis } from './mockApis'; + +describe('mockApis', () => { + describe('config', () => { + const data = { backend: { baseUrl: 'http://test.com' } }; + + it('can create an instance and make assertions on it', () => { + const empty = mockApis.config(); + const notEmpty = mockApis.config({ data }); + expect(empty.getOptional('backend.baseUrl')).toBeUndefined(); + expect(empty.getOptional).toHaveBeenCalledTimes(1); + expect(notEmpty.getOptional('backend.baseUrl')).toEqual( + 'http://test.com', + ); + expect(notEmpty.getOptional).toHaveBeenCalledTimes(1); + }); + + it('can create a mock and make assertions on it', async () => { + const mock = mockApis.config.mock({ getString: () => 'replaced' }); + expect(mock.getString('a')).toEqual('replaced'); + expect(mock.getString).toHaveBeenCalledTimes(1); + }); + }); +}); diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts new file mode 100644 index 0000000000..d084fae332 --- /dev/null +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -0,0 +1,188 @@ +/* + * Copyright 2024 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 { ConfigReader } from '@backstage/config'; +import { + ApiFactory, + ApiRef, + configApiRef, + createApiFactory, +} from '@backstage/core-plugin-api'; +import { JsonObject } from '@backstage/types'; +import { ApiMock } from './ApiMock'; + +/** @internal */ +function simpleInstance( + _ref: ApiRef, + instance: TApi, + mockSkeleton: () => jest.Mocked, +): jest.Mocked { + const mock = mockSkeleton(); + const result = Object.create(instance) as any; + for (const [key, impl] of Object.entries(mock)) { + result[key] = (impl as any).mockImplementation((instance as any)[key]); + } + return result; +} + +/** @internal */ +function simpleFactory( + ref: ApiRef, + factory: (...args: TArgs) => TApi, +): (...args: TArgs) => ApiFactory { + return (...args) => + createApiFactory({ + api: ref, + deps: {}, + factory: () => factory(...args), + }); +} + +/** @internal */ +function simpleMock( + ref: ApiRef, + mockFactory: () => jest.Mocked, +): (partialImpl?: Partial) => ApiMock { + return partialImpl => { + const mock = mockFactory(); + if (partialImpl) { + for (const [key, impl] of Object.entries(partialImpl)) { + if (typeof impl === 'function') { + (mock as any)[key].mockImplementation(impl); + } else { + (mock as any)[key] = impl; + } + } + } + return Object.assign(mock, { + factory: createApiFactory({ + api: ref, + deps: {}, + factory: () => mock, + }), + }) as ApiMock; + }; +} + +/** + * Mock implementations of the core utility APIs, to be used in tests. + * + * @public + * @remarks + * + * There are some variations among the APIs depending on what needs tests + * might have, but overall there are three main usage patterns: + * + * 1: Creating an actual fake API instance, often with a simplified version + * of functionality, by calling the mock API itself as a function. + * + * ```ts + * // The function often accepts parameters that control its behavior + * const foo = mockApis.foo(); + * ``` + * + * 2: Creating a mock API, where all methods are replaced with jest mocks, by + * calling the API's `mock` function. + * + * ```ts + * // You can optionally supply a subset of its methods to implement + * const foo = mockApis.foo.mock({ + * someMethod: () => 'mocked result', + * }); + * // After exercising your test, you can make assertions on the mock: + * expect(foo.someMethod).toHaveBeenCalledTimes(2); + * expect(foo.otherMethod).toHaveBeenCalledWith(testData); + * ``` + * + * 3: Creating an API factory that behaves similarly to the mock as per above. + * + * ```ts + * const factory = mockApis.foo.factory({ + * someMethod: () => 'mocked result', + * }); + * ``` + */ +export namespace mockApis { + const configMockSkeleton = () => ({ + has: jest.fn(), + keys: jest.fn(), + get: jest.fn(), + getOptional: jest.fn(), + getConfig: jest.fn(), + getOptionalConfig: jest.fn(), + getConfigArray: jest.fn(), + getOptionalConfigArray: jest.fn(), + getNumber: jest.fn(), + getOptionalNumber: jest.fn(), + getBoolean: jest.fn(), + getOptionalBoolean: jest.fn(), + getString: jest.fn(), + getOptionalString: jest.fn(), + getStringArray: jest.fn(), + getOptionalStringArray: jest.fn(), + }); + /** + * Fake implementation of {@link @backstage/frontend-plugin-api#ConfigApi} + * with optional data supplied. + * + * @public + * @example + * + * ```tsx + * const config = mockApis.config({ + * data: { app: { baseUrl: 'https://example.com' } }, + * }); + * + * const rendered = await renderInTestApp( + * + * + * , + * ); + * ``` + */ + export function config(options?: { data?: JsonObject }) { + return simpleInstance( + configApiRef, + new ConfigReader(options?.data, 'mock-config'), + configMockSkeleton, + ); + } + /** + * Mock helpers for {@link @backstage/frontend-plugin-api#ConfigApi}. + * + * @see {@link @backstage/frontend-plugin-api#mockApis.config} + * @public + */ + export namespace config { + /** + * Creates a factory for a fake implementation of + * {@link @backstage/frontend-plugin-api#ConfigApi} with optional + * configuration data supplied. + * + * @public + */ + export const factory = simpleFactory(configApiRef, config); + /** + * Creates a mock implementation of + * {@link @backstage/frontend-plugin-api#ConfigApi}. All methods are + * replaced with jest mock functions, and you can optionally pass in a + * subset of methods with an explicit implementation. + * + * @public + */ + export const mock = simpleMock(configApiRef, configMockSkeleton); + } +} diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx index 1ed8026a2b..f832c842a5 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx @@ -16,7 +16,7 @@ import { Entity } from '@backstage/catalog-model'; import { configApiRef } from '@backstage/core-plugin-api'; -import { MockConfigApi, TestApiProvider } from '@backstage/test-utils'; +import { mockApis, TestApiProvider } from '@backstage/test-utils'; import { makeStyles } from '@material-ui/core/styles'; import { render, screen } from '@testing-library/react'; import { renderHook } from '@testing-library/react'; @@ -46,7 +46,7 @@ const entities: Entity[] = [ }, ]; -const mockConfigApi = new MockConfigApi({}); +const mockConfigApi = mockApis.config(); const apis = [[configApiRef, mockConfigApi]] as const; describe('', () => { @@ -122,10 +122,12 @@ describe('', () => { apis={[ [ configApiRef, - new MockConfigApi({ - catalog: { - import: { - entityFilename: 'anvil.yaml', + mockApis.config({ + data: { + catalog: { + import: { + entityFilename: 'anvil.yaml', + }, }, }, }), diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx index 6e81b27c55..acc2715fec 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx @@ -16,7 +16,7 @@ import { configApiRef, errorApiRef } from '@backstage/core-plugin-api'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; -import { TestApiProvider, MockConfigApi } from '@backstage/test-utils'; +import { TestApiProvider, mockApis } from '@backstage/test-utils'; import TextField from '@material-ui/core/TextField'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; @@ -43,7 +43,7 @@ describe('', () => { post: jest.fn(), }; - const configApi = new MockConfigApi({}); + const configApi = mockApis.config(); const Wrapper = ({ children }: { children?: React.ReactNode }) => ( { describe('readFilterConfig', () => { it('returns filter data', async () => { - const mockConfig = new MockConfigApi({ - field: 'pathname', - operator: '==', - value: '/home', + const mockConfig = mockApis.config({ + data: { + field: 'pathname', + operator: '==', + value: '/home', + }, }); const res = readFilterConfig(mockConfig); expect(res).toEqual({ @@ -34,10 +36,12 @@ describe('config', () => { }); it('returns undefined for invalid filter', async () => { - const mockInvalidConfig = new MockConfigApi({ - myField: 'pathname', - operator: '==', - value: '3', + const mockInvalidConfig = mockApis.config({ + data: { + myField: 'pathname', + operator: '==', + value: '3', + }, }); const res = readFilterConfig(mockInvalidConfig); expect(res).toEqual(undefined); @@ -46,15 +50,19 @@ describe('config', () => { describe('createFilterByQueryParamFromConfig', () => { it('returns filter data', async () => { - const mockConfig1 = new MockConfigApi({ - field: 'id', - operator: '==', - value: '3', + const mockConfig1 = mockApis.config({ + data: { + field: 'id', + operator: '==', + value: '3', + }, }); - const mockConfig2 = new MockConfigApi({ - field: 'pathname', - operator: '==', - value: 'path', + const mockConfig2 = mockApis.config({ + data: { + field: 'pathname', + operator: '==', + value: 'path', + }, }); const res = createFilterByQueryParamFromConfig([ mockConfig1, @@ -67,15 +75,19 @@ describe('config', () => { }); it('returns only valid filters', async () => { - const mockValidConfig = new MockConfigApi({ - field: 'id', - operator: '==', - value: 3, + const mockValidConfig = mockApis.config({ + data: { + field: 'id', + operator: '==', + value: 3, + }, }); - const mockInvalidConfig = new MockConfigApi({ - myField: 'pathname', - operator: '==', - value: 'path', + const mockInvalidConfig = mockApis.config({ + data: { + myField: 'pathname', + operator: '==', + value: 'path', + }, }); const res = createFilterByQueryParamFromConfig([ mockValidConfig, diff --git a/plugins/home/src/homePageComponents/VisitedByType/Content.test.tsx b/plugins/home/src/homePageComponents/VisitedByType/Content.test.tsx index 055ebf998b..ec2d9eb068 100644 --- a/plugins/home/src/homePageComponents/VisitedByType/Content.test.tsx +++ b/plugins/home/src/homePageComponents/VisitedByType/Content.test.tsx @@ -19,7 +19,7 @@ import { Content } from './Content'; import { TestApiProvider, renderInTestApp, - MockConfigApi, + mockApis, } from '@backstage/test-utils'; import { visitsApiRef } from '../../api'; import { ContextProvider } from './Context'; @@ -138,16 +138,18 @@ describe('', () => { }); it('allows recent items to be filtered using config', async () => { - const configApiMock = new MockConfigApi({ - home: { - recentVisits: { - filterBy: [ - { - field: 'pathname', - operator: '==', - value: '/tech-radar', - }, - ], + const configApiMock = mockApis.config({ + data: { + home: { + recentVisits: { + filterBy: [ + { + field: 'pathname', + operator: '==', + value: '/tech-radar', + }, + ], + }, }, }, }); @@ -206,20 +208,22 @@ describe('', () => { }); it('allows recent items to have no filter if the filter config is not valid', async () => { - const configApiMock = new MockConfigApi({ - home: { - recentVisits: { - filterBy: [ - { - operator: '==', - value: '/tech-radar', - }, - { - field: 'pathname', - operator: '==', - value: '/explore', - }, - ], + const configApiMock = mockApis.config({ + data: { + home: { + recentVisits: { + filterBy: [ + { + operator: '==', + value: '/tech-radar', + }, + { + field: 'pathname', + operator: '==', + value: '/explore', + }, + ], + }, }, }, }); @@ -283,16 +287,18 @@ describe('', () => { }); it('allows top items to be filtered using config', async () => { - const configApiMock = new MockConfigApi({ - home: { - topVisits: { - filterBy: [ - { - field: 'pathname', - operator: '==', - value: '/explore', - }, - ], + const configApiMock = mockApis.config({ + data: { + home: { + topVisits: { + filterBy: [ + { + field: 'pathname', + operator: '==', + value: '/explore', + }, + ], + }, }, }, }); diff --git a/plugins/search-react/src/components/SearchFilter/SearchFilter.Autocomplete.test.tsx b/plugins/search-react/src/components/SearchFilter/SearchFilter.Autocomplete.test.tsx index abf5e828f6..bbc6454613 100644 --- a/plugins/search-react/src/components/SearchFilter/SearchFilter.Autocomplete.test.tsx +++ b/plugins/search-react/src/components/SearchFilter/SearchFilter.Autocomplete.test.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { MockConfigApi, TestApiProvider } from '@backstage/test-utils'; +import { mockApis, TestApiProvider } from '@backstage/test-utils'; import { screen, render, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; @@ -35,10 +35,12 @@ const SearchContextFilterSpy = ({ name }: { name: string }) => { }; describe('SearchFilter.Autocomplete', () => { - const configApiMock = new MockConfigApi({ - search: { - query: { - pageLimit: 100, + const configApiMock = mockApis.config({ + data: { + search: { + query: { + pageLimit: 100, + }, }, }, }); diff --git a/plugins/search-react/src/components/SearchFilter/SearchFilter.test.tsx b/plugins/search-react/src/components/SearchFilter/SearchFilter.test.tsx index c51a4832e3..e155a093d5 100644 --- a/plugins/search-react/src/components/SearchFilter/SearchFilter.test.tsx +++ b/plugins/search-react/src/components/SearchFilter/SearchFilter.test.tsx @@ -22,7 +22,7 @@ import { configApiRef } from '@backstage/core-plugin-api'; import { SearchContextProvider } from '../../context'; import { SearchFilter } from './SearchFilter'; -import { MockConfigApi, TestApiProvider } from '@backstage/test-utils'; +import { mockApis, TestApiProvider } from '@backstage/test-utils'; import { searchApiRef } from '../../api'; describe('SearchFilter', () => { @@ -37,10 +37,12 @@ describe('SearchFilter', () => { const values = ['value1', 'value2']; const filters = { unrelated: 'unrelated' }; - const configApiMock = new MockConfigApi({ - search: { - query: { - pagelimit: 10, + const configApiMock = mockApis.config({ + data: { + search: { + query: { + pagelimit: 10, + }, }, }, }); diff --git a/plugins/search-react/src/components/SearchFilter/hooks.test.tsx b/plugins/search-react/src/components/SearchFilter/hooks.test.tsx index 884512963f..28a6fbfd60 100644 --- a/plugins/search-react/src/components/SearchFilter/hooks.test.tsx +++ b/plugins/search-react/src/components/SearchFilter/hooks.test.tsx @@ -13,9 +13,10 @@ * 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 { MockConfigApi, TestApiRegistry } from '@backstage/test-utils'; +import { mockApis, TestApiRegistry } from '@backstage/test-utils'; import { act, renderHook, waitFor } from '@testing-library/react'; import { searchApiRef } from '../../api'; @@ -27,17 +28,19 @@ jest.useFakeTimers(); describe('SearchFilter.hooks', () => { describe('useDefaultFilterValue', () => { - const configApiMock = new MockConfigApi({ - search: { - query: { - pageLimit: 100, + const configApiMock = mockApis.config({ + data: { + search: { + query: { + pageLimit: 100, + }, }, }, }); const searchApiMock = { query: jest.fn().mockResolvedValue({ results: [] }), }; - const mockApis = TestApiRegistry.from( + const apis = TestApiRegistry.from( [searchApiRef, searchApiMock], [configApiRef, configApiMock], ); @@ -54,7 +57,7 @@ describe('SearchFilter.hooks', () => { filters: {}, }; return ( - + diff --git a/plugins/search-react/src/components/SearchPagination/SearchPagination.test.tsx b/plugins/search-react/src/components/SearchPagination/SearchPagination.test.tsx index 7c86e16e95..b0a64f0061 100644 --- a/plugins/search-react/src/components/SearchPagination/SearchPagination.test.tsx +++ b/plugins/search-react/src/components/SearchPagination/SearchPagination.test.tsx @@ -19,7 +19,7 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { - MockConfigApi, + mockApis, renderWithEffects, TestApiProvider, } from '@backstage/test-utils'; @@ -31,10 +31,12 @@ import { SearchPagination } from './SearchPagination'; import { configApiRef } from '@backstage/core-plugin-api'; describe('SearchPagination', () => { - const configApiMock = new MockConfigApi({ - search: { - query: { - pagelimit: 10, + const configApiMock = mockApis.config({ + data: { + search: { + query: { + pagelimit: 10, + }, }, }, }); diff --git a/plugins/search-react/src/context/SearchContext.test.tsx b/plugins/search-react/src/context/SearchContext.test.tsx index 58fde35667..2cb83e5ab6 100644 --- a/plugins/search-react/src/context/SearchContext.test.tsx +++ b/plugins/search-react/src/context/SearchContext.test.tsx @@ -22,7 +22,7 @@ import { act, renderHook, } from '@testing-library/react'; -import { MockConfigApi, TestApiProvider } from '@backstage/test-utils'; +import { mockApis, TestApiProvider } from '@backstage/test-utils'; import React from 'react'; import { SearchContextProvider, @@ -37,7 +37,7 @@ describe('SearchContext', () => { } satisfies typeof searchApiRef.T; const wrapper = ({ children, initialState, config = {} }: any) => { - const configApiMock = new MockConfigApi(config); + const configApiMock = mockApis.config({ data: config }); return ( { const { result } = renderHook(() => useSearch(), { wrapper: ({ children }) => { - const configApiMock = new MockConfigApi({}); + const configApiMock = mockApis.config(); return ( { const { result } = renderHook(() => useSearch(), { wrapper: ({ children }) => { - const configApiMock = new MockConfigApi({}); + const configApiMock = mockApis.config(); return ( ({ })); describe('SearchType.Accordion', () => { - const configApiMock = new MockConfigApi({ - search: { - query: { - pagelimit: 10, + const configApiMock = mockApis.config({ + data: { + search: { + query: { + pagelimit: 10, + }, }, }, }); diff --git a/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx b/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx index c0d8549253..d06106e1ae 100644 --- a/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx +++ b/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { MockConfigApi, TestApiProvider } from '@backstage/test-utils'; +import { mockApis, TestApiProvider } from '@backstage/test-utils'; import { act, render } from '@testing-library/react'; import user from '@testing-library/user-event'; import { @@ -40,10 +40,12 @@ jest.mock('@backstage/plugin-search-react', () => ({ describe('SearchType.Tabs', () => { const searchApiMock = { query: jest.fn().mockResolvedValue({ results: [] }) }; - const configApiMock = new MockConfigApi({ - search: { - query: { - pageLimit: 100, + const configApiMock = mockApis.config({ + data: { + search: { + query: { + pageLimit: 100, + }, }, }, }); diff --git a/plugins/search/src/components/SearchType/SearchType.test.tsx b/plugins/search/src/components/SearchType/SearchType.test.tsx index 353b45c0fb..6a393798de 100644 --- a/plugins/search/src/components/SearchType/SearchType.test.tsx +++ b/plugins/search/src/components/SearchType/SearchType.test.tsx @@ -23,7 +23,7 @@ import { searchApiRef, } from '@backstage/plugin-search-react'; import { SearchType } from './SearchType'; -import { MockConfigApi, TestApiProvider } from '@backstage/test-utils'; +import { mockApis, TestApiProvider } from '@backstage/test-utils'; describe('SearchType', () => { const initialState = { @@ -36,10 +36,12 @@ describe('SearchType', () => { const values = ['value1', 'value2']; const typeValues = ['preselected']; - const configApiMock = new MockConfigApi({ - search: { - query: { - pagelimit: 10, + const configApiMock = mockApis.config({ + data: { + search: { + query: { + pagelimit: 10, + }, }, }, }); diff --git a/plugins/techdocs-react/src/context.test.tsx b/plugins/techdocs-react/src/context.test.tsx index a923b3c528..6c947b6858 100644 --- a/plugins/techdocs-react/src/context.test.tsx +++ b/plugins/techdocs-react/src/context.test.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React from 'react'; import { renderHook, act, waitFor } from '@testing-library/react'; @@ -21,7 +22,7 @@ import { ThemeProvider } from '@material-ui/core/styles'; import { lightTheme } from '@backstage/theme'; import { MockAnalyticsApi, - MockConfigApi, + mockApis, TestApiProvider, } from '@backstage/test-utils'; import { Entity, CompoundEntityRef } from '@backstage/catalog-model'; @@ -84,7 +85,7 @@ const wrapper = ({ diff --git a/plugins/techdocs/src/client.test.ts b/plugins/techdocs/src/client.test.ts index 62d497d790..e2c68a7d73 100644 --- a/plugins/techdocs/src/client.test.ts +++ b/plugins/techdocs/src/client.test.ts @@ -18,7 +18,7 @@ import { UrlPatternDiscovery } from '@backstage/core-app-api'; import { IdentityApi } from '@backstage/core-plugin-api'; import { NotFoundError } from '@backstage/errors'; import { fetchEventSource } from '@microsoft/fetch-event-source'; -import { MockConfigApi, MockFetchApi } from '@backstage/test-utils'; +import { mockApis, MockFetchApi } from '@backstage/test-utils'; import { TechDocsStorageClient } from './client'; jest.mock('@microsoft/fetch-event-source'); @@ -34,7 +34,7 @@ const mockEntity = { describe('TechDocsStorageClient', () => { const mockBaseUrl = 'http://backstage:9191/api/techdocs'; - const configApi = new MockConfigApi({}); + const configApi = mockApis.config(); const discoveryApi = UrlPatternDiscovery.compile(mockBaseUrl); const identityApi: jest.Mocked = { getCredentials: jest.fn(), diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.test.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.test.tsx index 5e8cd7af27..5d08355ae4 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.test.tsx @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React from 'react'; import { scmIntegrationsApiRef } from '@backstage/integration-react'; import { entityRouteRef } from '@backstage/plugin-catalog-react'; import { - MockConfigApi, + mockApis, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -106,10 +107,8 @@ jest.mock('@backstage/core-components', () => ({ Page: jest.fn(), })); -const configApi = new MockConfigApi({ - app: { - baseUrl: 'http://localhost:3000', - }, +const configApi = mockApis.config({ + data: { app: { baseUrl: 'http://localhost:3000' } }, }); const Wrapper = ({ children }: { children: React.ReactNode }) => { diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/useNavigateUrl.test.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/useNavigateUrl.test.tsx index b7d4c55ed7..f2894e4d21 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/useNavigateUrl.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/useNavigateUrl.test.tsx @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React from 'react'; import { - MockConfigApi, + mockApis, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -55,16 +56,7 @@ describe('useNavigateUrl', () => { const baseUrl = 'http://localhost:3000'; await renderInTestApp( , @@ -75,16 +67,7 @@ describe('useNavigateUrl', () => { const baseUrl = 'http://localhost:3000/instance'; await renderInTestApp( , @@ -95,16 +78,7 @@ describe('useNavigateUrl', () => { const baseUrl = 'http://localhost:3000'; await renderInTestApp( , diff --git a/yarn.lock b/yarn.lock index f998b87e11..5c29a9dbec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4683,7 +4683,6 @@ __metadata: zod: ^3.22.4 peerDependencies: "@testing-library/react": ^16.0.0 - "@types/jest": "*" "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 react: ^16.13.1 || ^17.0.0 || ^18.0.0 react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 @@ -8564,6 +8563,7 @@ __metadata: "@material-ui/core": ^4.12.2 "@material-ui/icons": ^4.9.1 "@testing-library/jest-dom": ^6.0.0 + "@types/jest": "*" "@types/react": ^18.0.0 cross-fetch: ^4.0.0 i18next: ^22.4.15 @@ -8574,11 +8574,14 @@ __metadata: zen-observable: ^0.10.0 peerDependencies: "@testing-library/react": ^16.0.0 + "@types/jest": "*" "@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0 react: ^16.13.1 || ^17.0.0 || ^18.0.0 react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 react-router-dom: 6.0.0-beta.0 || ^6.3.0 peerDependenciesMeta: + "@types/jest": + optional: true "@types/react": optional: true languageName: unknown @@ -17912,7 +17915,7 @@ __metadata: languageName: node linkType: hard -"@types/jest@npm:^29.5.11": +"@types/jest@npm:*, @types/jest@npm:^29.5.11": version: 29.5.13 resolution: "@types/jest@npm:29.5.13" dependencies: From f2bb5e0d11cf104018c6255293e6fdd24de74857 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:33:27 +0000 Subject: [PATCH 056/268] chore(deps): pin actions/cache action to 3624ceb Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/deploy_packages.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81d1d109b1..3e23a79553 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,7 +235,7 @@ jobs: # Use the lower-level cache actions for the success cache, so that we can store the cache even on failed builds - name: restore backstage-cli cache - uses: actions/cache/restore@v4 + uses: actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4 with: path: .cache/backstage-cli key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli @@ -254,7 +254,7 @@ jobs: # Always save success cache even if there were failures, that way it can be used in re-triggered builds - name: save backstage-cli cache - uses: actions/cache/save@v4 + uses: actions/cache/save@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4 if: always() with: path: .cache/backstage-cli diff --git a/.github/workflows/deploy_packages.yml b/.github/workflows/deploy_packages.yml index 2a185b577c..c3c38aac73 100644 --- a/.github/workflows/deploy_packages.yml +++ b/.github/workflows/deploy_packages.yml @@ -94,7 +94,7 @@ jobs: run: yarn backstage-cli config:check --lax - name: backstage-cli cache - uses: actions/cache@v4 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4 with: path: .cache/backstage-cli key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli From a3e6af59d686292473de23ef694e1c6460b3e599 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 07:15:06 +0000 Subject: [PATCH 057/268] fix(deps): update dependency express-openapi-validator to v5.3.7 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5801758fa2..ab5f7114d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18190,7 +18190,7 @@ __metadata: languageName: node linkType: hard -"@types/multer@npm:^1.4.11": +"@types/multer@npm:^1.4.12": version: 1.4.12 resolution: "@types/multer@npm:1.4.12" dependencies: @@ -27112,11 +27112,11 @@ __metadata: linkType: hard "express-openapi-validator@npm:^5.0.4": - version: 5.3.6 - resolution: "express-openapi-validator@npm:5.3.6" + version: 5.3.7 + resolution: "express-openapi-validator@npm:5.3.7" dependencies: "@apidevtools/json-schema-ref-parser": ^11.7.0 - "@types/multer": ^1.4.11 + "@types/multer": ^1.4.12 ajv: ^8.17.1 ajv-draft-04: ^1.0.0 ajv-formats: ^2.1.1 @@ -27127,10 +27127,10 @@ __metadata: media-typer: ^1.1.0 multer: ^1.4.5-lts.1 ono: ^7.1.3 - path-to-regexp: ^6.3.0 + path-to-regexp: ^8.1.0 peerDependencies: express: "*" - checksum: 3833bc2351fe099aed5777c1254514316425d9188ad5002e6604259b36953d8304b8804b835cddc518e8a63f1d1c2288e7a83006400c2dc7e644f2e3cadfb755 + checksum: 28be61484f68bbad3f2ec8304bf310e1c962ceefd21b9feea5e52187670715257a30e1d87173c773e36b1a182a10760ca16987f16649bf0b91f4bcca0b58cfbd languageName: node linkType: hard @@ -36703,10 +36703,10 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:^8.0.0": - version: 8.1.0 - resolution: "path-to-regexp@npm:8.1.0" - checksum: 982b784f8dff704c04c79dc3e26d51d2dba340e6bd513a8bdc48559a8543d730547d9d2355122166171eb509236e7524802ed643f8a77d527e12c69ffc74f97f +"path-to-regexp@npm:^8.0.0, path-to-regexp@npm:^8.1.0": + version: 8.2.0 + resolution: "path-to-regexp@npm:8.2.0" + checksum: 56e13e45962e776e9e7cd72e87a441cfe41f33fd539d097237ceb16adc922281136ca12f5a742962e33d8dda9569f630ba594de56d8b7b6e49adf31803c5e771 languageName: node linkType: hard From c1f9764004456234c984dfc4a5f9fe73ecf949ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jerna=C5=9B?= Date: Wed, 9 Oct 2024 14:36:24 +0200 Subject: [PATCH 058/268] feat(catalog-backend): Add configuration parameters for deferred stitcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows for settings the stitch timeout and polling interval. Signed-off-by: Łukasz Jernaś --- .changeset/quiet-islands-learn.md | 5 +++++ plugins/catalog-backend/config.d.ts | 4 ++++ plugins/catalog-backend/src/stitching/types.ts | 10 +++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .changeset/quiet-islands-learn.md diff --git a/.changeset/quiet-islands-learn.md b/.changeset/quiet-islands-learn.md new file mode 100644 index 0000000000..7e2ad6bdf1 --- /dev/null +++ b/.changeset/quiet-islands-learn.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Add configuration parameters for deferred stitcher diff --git a/plugins/catalog-backend/config.d.ts b/plugins/catalog-backend/config.d.ts index 265d78b496..183607341c 100644 --- a/plugins/catalog-backend/config.d.ts +++ b/plugins/catalog-backend/config.d.ts @@ -156,6 +156,10 @@ export interface Config { | { /** Defer stitching to be performed asynchronously */ mode: 'deferred'; + /** Polling interval for tasks in seconds */ + pollingInterval?: number; + /** How long to wait for a stitch to complete before giving up in seconds */ + stitchTimeout?: number; }; /** diff --git a/plugins/catalog-backend/src/stitching/types.ts b/plugins/catalog-backend/src/stitching/types.ts index 9f7a5652dd..afeeff7335 100644 --- a/plugins/catalog-backend/src/stitching/types.ts +++ b/plugins/catalog-backend/src/stitching/types.ts @@ -66,11 +66,15 @@ export function stitchingStrategyFromConfig(config: Config): StitchingStrategy { mode: 'immediate', }; } else if (strategyMode === 'deferred') { - // TODO(freben): Make parameters configurable + const pollingInterval = + config.getOptionalNumber('catalog.stitchingStrategy.pollingInterval') ?? + 1; + const stitchTimeout = + config.getOptionalNumber('catalog.stitchingStrategy.stitchTimeout') ?? 60; return { mode: 'deferred', - pollingInterval: { seconds: 1 }, - stitchTimeout: { seconds: 60 }, + pollingInterval: { seconds: pollingInterval }, + stitchTimeout: { seconds: stitchTimeout }, }; } From 0fa49b9a5c509d15f3789f091be244e8fbbe068f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:20:05 +0000 Subject: [PATCH 059/268] chore(deps): update actions/checkout action to v4.2.1 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/api-breaking-changes.yml | 2 +- .github/workflows/automate_changeset_feedback.yml | 2 +- .github/workflows/automate_merge_message.yml | 2 +- .github/workflows/ci.yml | 6 +++--- .github/workflows/deploy_docker-image.yml | 2 +- .github/workflows/deploy_microsite.yml | 8 ++++---- .github/workflows/deploy_packages.yml | 2 +- .github/workflows/scorecard.yml | 2 +- .github/workflows/sync_code-formatting.yml | 2 +- .github/workflows/sync_dependabot-changesets.yml | 2 +- .github/workflows/sync_release-manifest.yml | 4 ++-- .github/workflows/sync_renovate-changesets.yml | 2 +- .github/workflows/sync_snyk-github-issues.yml | 2 +- .github/workflows/sync_snyk-monitor.yml | 2 +- .github/workflows/sync_version-packages.yml | 2 +- .github/workflows/verify_accessibility.yml | 2 +- .github/workflows/verify_codeql.yml | 2 +- .github/workflows/verify_docs-quality.yml | 2 +- .github/workflows/verify_e2e-linux.yml | 2 +- .github/workflows/verify_e2e-techdocs.yml | 2 +- .github/workflows/verify_e2e-windows.yml | 2 +- .github/workflows/verify_fossa.yml | 2 +- .github/workflows/verify_microsite.yml | 2 +- .github/workflows/verify_microsite_accessibility.yml | 2 +- .github/workflows/verify_storybook.yml | 2 +- .github/workflows/verify_windows.yml | 2 +- 26 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/api-breaking-changes.yml b/.github/workflows/api-breaking-changes.yml index 1c2596bad6..58d8020672 100644 --- a/.github/workflows/api-breaking-changes.yml +++ b/.github/workflows/api-breaking-changes.yml @@ -18,7 +18,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: # Fetch the commit that's merged into the base rather than the target ref # This will let us diff only the contents of the PR, without fetching more history diff --git a/.github/workflows/automate_changeset_feedback.yml b/.github/workflows/automate_changeset_feedback.yml index 1f07a848fb..a0c0e44902 100644 --- a/.github/workflows/automate_changeset_feedback.yml +++ b/.github/workflows/automate_changeset_feedback.yml @@ -27,7 +27,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: # Fetch the commit that's merged into the base rather than the target ref # This will let us diff only the contents of the PR, without fetching more history diff --git a/.github/workflows/automate_merge_message.yml b/.github/workflows/automate_merge_message.yml index 4ab75b816f..4b388d7850 100644 --- a/.github/workflows/automate_merge_message.yml +++ b/.github/workflows/automate_merge_message.yml @@ -28,7 +28,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: '${{ github.event.pull_request.merge_commit_sha }}' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81d1d109b1..a488773779 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -68,7 +68,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -209,7 +209,7 @@ jobs: INTEGRATION_TEST_AZURE_TOKEN: ${{ secrets.INTEGRATION_TEST_AZURE_TOKEN }} steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: fetch master branch run: git fetch origin master diff --git a/.github/workflows/deploy_docker-image.yml b/.github/workflows/deploy_docker-image.yml index a45c9c35bd..d5934e8ad8 100644 --- a/.github/workflows/deploy_docker-image.yml +++ b/.github/workflows/deploy_docker-image.yml @@ -25,7 +25,7 @@ jobs: egress-policy: audit - name: checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: path: backstage ref: ${{ github.event.client_payload.version && env.RELEASE_VERSION || github.ref }} diff --git a/.github/workflows/deploy_microsite.yml b/.github/workflows/deploy_microsite.yml index 7dad0d3b20..f7d709ce77 100644 --- a/.github/workflows/deploy_microsite.yml +++ b/.github/workflows/deploy_microsite.yml @@ -54,7 +54,7 @@ jobs: result-encoding: string - name: checkout latest release - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: refs/tags/${{ steps.find-release.outputs.result }} @@ -96,7 +96,7 @@ jobs: egress-policy: audit - name: checkout master - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: use node.js 18.x uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 @@ -170,7 +170,7 @@ jobs: # Stable docs - name: checkout latest release - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: refs/tags/${{ needs.stable.outputs.release }} @@ -198,7 +198,7 @@ jobs: # Next docs - name: checkout master - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: clean: false diff --git a/.github/workflows/deploy_packages.yml b/.github/workflows/deploy_packages.yml index eda5e7e0c6..51b5f42831 100644 --- a/.github/workflows/deploy_packages.yml +++ b/.github/workflows/deploy_packages.yml @@ -68,7 +68,7 @@ jobs: INTEGRATION_TEST_AZURE_TOKEN: ${{ secrets.INTEGRATION_TEST_AZURE_TOKEN }} steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 53489d8c0e..e54a32b46d 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -34,7 +34,7 @@ jobs: egress-policy: audit - name: 'Checkout code' - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: persist-credentials: false diff --git a/.github/workflows/sync_code-formatting.yml b/.github/workflows/sync_code-formatting.yml index f59eb048e0..2aa84bb208 100644 --- a/.github/workflows/sync_code-formatting.yml +++ b/.github/workflows/sync_code-formatting.yml @@ -14,7 +14,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: # Fetch changes to previous commit - required for 'only_changed' in Prettier action fetch-depth: 0 diff --git a/.github/workflows/sync_dependabot-changesets.yml b/.github/workflows/sync_dependabot-changesets.yml index adf39be8df..a89ab7629a 100644 --- a/.github/workflows/sync_dependabot-changesets.yml +++ b/.github/workflows/sync_dependabot-changesets.yml @@ -16,7 +16,7 @@ jobs: egress-policy: audit - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 2 ref: ${{ github.head_ref }} diff --git a/.github/workflows/sync_release-manifest.yml b/.github/workflows/sync_release-manifest.yml index 87a8837c48..4b209739c7 100644 --- a/.github/workflows/sync_release-manifest.yml +++ b/.github/workflows/sync_release-manifest.yml @@ -13,7 +13,7 @@ jobs: egress-policy: audit - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: # 'v' prefix is added here for the tag, we keep it out of the manifest logic ref: v${{ github.event.client_payload.version }} @@ -35,7 +35,7 @@ jobs: # Checkout backstage/versions into /backstage/versions, which is where store the output - name: Checkout versions - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: repository: backstage/versions path: versions diff --git a/.github/workflows/sync_renovate-changesets.yml b/.github/workflows/sync_renovate-changesets.yml index 200bc6eaaa..1c9b4a6186 100644 --- a/.github/workflows/sync_renovate-changesets.yml +++ b/.github/workflows/sync_renovate-changesets.yml @@ -16,7 +16,7 @@ jobs: egress-policy: audit - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 2 ref: ${{ github.head_ref }} diff --git a/.github/workflows/sync_snyk-github-issues.yml b/.github/workflows/sync_snyk-github-issues.yml index 9c709508b3..1390b4ec61 100644 --- a/.github/workflows/sync_snyk-github-issues.yml +++ b/.github/workflows/sync_snyk-github-issues.yml @@ -16,7 +16,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: use node.js 18.x uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 diff --git a/.github/workflows/sync_snyk-monitor.yml b/.github/workflows/sync_snyk-monitor.yml index 1b48930410..f746a8c339 100644 --- a/.github/workflows/sync_snyk-monitor.yml +++ b/.github/workflows/sync_snyk-monitor.yml @@ -29,7 +29,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Monitor and Synchronize Snyk Policies uses: snyk/actions/node@cdb760004ba9ea4d525f2e043745dfe85bb9077e # master with: diff --git a/.github/workflows/sync_version-packages.yml b/.github/workflows/sync_version-packages.yml index aac606ae90..77fb5f951e 100644 --- a/.github/workflows/sync_version-packages.yml +++ b/.github/workflows/sync_version-packages.yml @@ -18,7 +18,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 20000 fetch-tags: true diff --git a/.github/workflows/verify_accessibility.yml b/.github/workflows/verify_accessibility.yml index cfeb8ba51f..29ff740f68 100644 --- a/.github/workflows/verify_accessibility.yml +++ b/.github/workflows/verify_accessibility.yml @@ -24,7 +24,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Use Node.js 18.x uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: diff --git a/.github/workflows/verify_codeql.yml b/.github/workflows/verify_codeql.yml index 63ba85906e..c77b65929b 100644 --- a/.github/workflows/verify_codeql.yml +++ b/.github/workflows/verify_codeql.yml @@ -47,7 +47,7 @@ jobs: egress-policy: audit - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. diff --git a/.github/workflows/verify_docs-quality.yml b/.github/workflows/verify_docs-quality.yml index 8e2ae20596..176136f821 100644 --- a/.github/workflows/verify_docs-quality.yml +++ b/.github/workflows/verify_docs-quality.yml @@ -16,7 +16,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 # Vale does not support file excludes, so we use the script to generate a list of files instead # The action also does not allow args or a local config file to be passed in, so the files array diff --git a/.github/workflows/verify_e2e-linux.yml b/.github/workflows/verify_e2e-linux.yml index 69a92abb9a..0c487429e9 100644 --- a/.github/workflows/verify_e2e-linux.yml +++ b/.github/workflows/verify_e2e-linux.yml @@ -45,7 +45,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Configure Git run: | diff --git a/.github/workflows/verify_e2e-techdocs.yml b/.github/workflows/verify_e2e-techdocs.yml index 15bb9b3479..f6b300af7e 100644 --- a/.github/workflows/verify_e2e-techdocs.yml +++ b/.github/workflows/verify_e2e-techdocs.yml @@ -34,7 +34,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: '3.9' diff --git a/.github/workflows/verify_e2e-windows.yml b/.github/workflows/verify_e2e-windows.yml index 911698867c..b6bfef51e5 100644 --- a/.github/workflows/verify_e2e-windows.yml +++ b/.github/workflows/verify_e2e-windows.yml @@ -42,7 +42,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Configure Git run: | diff --git a/.github/workflows/verify_fossa.yml b/.github/workflows/verify_fossa.yml index 8b3bfc9b13..5deaeafeaf 100644 --- a/.github/workflows/verify_fossa.yml +++ b/.github/workflows/verify_fossa.yml @@ -19,7 +19,7 @@ jobs: egress-policy: audit - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install Fossa run: "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash" diff --git a/.github/workflows/verify_microsite.yml b/.github/workflows/verify_microsite.yml index 5527953767..1d6aac21ca 100644 --- a/.github/workflows/verify_microsite.yml +++ b/.github/workflows/verify_microsite.yml @@ -28,7 +28,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: use node.js 18.x uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 diff --git a/.github/workflows/verify_microsite_accessibility.yml b/.github/workflows/verify_microsite_accessibility.yml index 350c46309e..6626f4def9 100644 --- a/.github/workflows/verify_microsite_accessibility.yml +++ b/.github/workflows/verify_microsite_accessibility.yml @@ -19,7 +19,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Use Node.js 18.x uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 diff --git a/.github/workflows/verify_storybook.yml b/.github/workflows/verify_storybook.yml index 77a01f9ffd..ae3470b079 100644 --- a/.github/workflows/verify_storybook.yml +++ b/.github/workflows/verify_storybook.yml @@ -32,7 +32,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 # Required to retrieve git history diff --git a/.github/workflows/verify_windows.yml b/.github/workflows/verify_windows.yml index 4cb2cab220..d184bdca08 100644 --- a/.github/workflows/verify_windows.yml +++ b/.github/workflows/verify_windows.yml @@ -33,7 +33,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 From e698470f2d702c0cf179564921a452e2af3c4865 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:19:55 +0000 Subject: [PATCH 060/268] fix(deps): update rjsf monorepo to v5.21.2 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .changeset/renovate-6eaf36e.md | 11 +++++ plugins/home-react/package.json | 2 +- plugins/home/package.json | 8 ++-- plugins/scaffolder-react/package.json | 8 ++-- plugins/scaffolder/package.json | 8 ++-- yarn.lock | 58 +++++++++++++-------------- 6 files changed, 53 insertions(+), 42 deletions(-) create mode 100644 .changeset/renovate-6eaf36e.md diff --git a/.changeset/renovate-6eaf36e.md b/.changeset/renovate-6eaf36e.md new file mode 100644 index 0000000000..e4533da674 --- /dev/null +++ b/.changeset/renovate-6eaf36e.md @@ -0,0 +1,11 @@ +--- +'@backstage/plugin-home-react': patch +'@backstage/plugin-home': patch +'@backstage/plugin-scaffolder-react': patch +'@backstage/plugin-scaffolder': patch +--- + +Updated dependency `@rjsf/utils` to `5.21.2`. +Updated dependency `@rjsf/core` to `5.21.2`. +Updated dependency `@rjsf/material-ui` to `5.21.2`. +Updated dependency `@rjsf/validator-ajv8` to `5.21.2`. diff --git a/plugins/home-react/package.json b/plugins/home-react/package.json index d339049478..c6ea008ebb 100644 --- a/plugins/home-react/package.json +++ b/plugins/home-react/package.json @@ -46,7 +46,7 @@ "@backstage/core-plugin-api": "workspace:^", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", - "@rjsf/utils": "5.21.1" + "@rjsf/utils": "5.21.2" }, "devDependencies": { "@backstage/cli": "workspace:^", diff --git a/plugins/home/package.json b/plugins/home/package.json index 91f7fd49d8..d97c0648d8 100644 --- a/plugins/home/package.json +++ b/plugins/home/package.json @@ -70,10 +70,10 @@ "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.61", - "@rjsf/core": "5.21.1", - "@rjsf/material-ui": "5.21.1", - "@rjsf/utils": "5.21.1", - "@rjsf/validator-ajv8": "5.21.1", + "@rjsf/core": "5.21.2", + "@rjsf/material-ui": "5.21.2", + "@rjsf/utils": "5.21.2", + "@rjsf/validator-ajv8": "5.21.2", "lodash": "^4.17.21", "luxon": "^3.4.3", "react-grid-layout": "1.3.4", diff --git a/plugins/scaffolder-react/package.json b/plugins/scaffolder-react/package.json index 4450e3130b..319f13d59c 100644 --- a/plugins/scaffolder-react/package.json +++ b/plugins/scaffolder-react/package.json @@ -73,10 +73,10 @@ "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.61", "@react-hookz/web": "^24.0.0", - "@rjsf/core": "5.21.1", - "@rjsf/material-ui": "5.21.1", - "@rjsf/utils": "5.21.1", - "@rjsf/validator-ajv8": "5.21.1", + "@rjsf/core": "5.21.2", + "@rjsf/material-ui": "5.21.2", + "@rjsf/utils": "5.21.2", + "@rjsf/validator-ajv8": "5.21.2", "@types/json-schema": "^7.0.9", "ajv-errors": "^3.0.0", "classnames": "^2.2.6", diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index 55b688cf9b..4d0e52066e 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -81,10 +81,10 @@ "@material-ui/lab": "4.0.0-alpha.61", "@microsoft/fetch-event-source": "^2.0.1", "@react-hookz/web": "^24.0.0", - "@rjsf/core": "5.21.1", - "@rjsf/material-ui": "5.21.1", - "@rjsf/utils": "5.21.1", - "@rjsf/validator-ajv8": "5.21.1", + "@rjsf/core": "5.21.2", + "@rjsf/material-ui": "5.21.2", + "@rjsf/utils": "5.21.2", + "@rjsf/validator-ajv8": "5.21.2", "@uiw/react-codemirror": "^4.9.3", "classnames": "^2.2.6", "git-url-parse": "^15.0.0", diff --git a/yarn.lock b/yarn.lock index 1fff220196..0389c62cb6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6546,7 +6546,7 @@ __metadata: "@backstage/core-plugin-api": "workspace:^" "@material-ui/core": ^4.12.2 "@material-ui/icons": ^4.9.1 - "@rjsf/utils": 5.21.1 + "@rjsf/utils": 5.21.2 "@types/react": ^18.0.0 "@types/react-grid-layout": ^1.3.2 react: ^18.0.2 @@ -6584,10 +6584,10 @@ __metadata: "@material-ui/core": ^4.12.2 "@material-ui/icons": ^4.9.1 "@material-ui/lab": 4.0.0-alpha.61 - "@rjsf/core": 5.21.1 - "@rjsf/material-ui": 5.21.1 - "@rjsf/utils": 5.21.1 - "@rjsf/validator-ajv8": 5.21.1 + "@rjsf/core": 5.21.2 + "@rjsf/material-ui": 5.21.2 + "@rjsf/utils": 5.21.2 + "@rjsf/validator-ajv8": 5.21.2 "@testing-library/dom": ^10.0.0 "@testing-library/jest-dom": ^6.0.0 "@testing-library/react": ^16.0.0 @@ -7668,10 +7668,10 @@ __metadata: "@material-ui/icons": ^4.9.1 "@material-ui/lab": 4.0.0-alpha.61 "@react-hookz/web": ^24.0.0 - "@rjsf/core": 5.21.1 - "@rjsf/material-ui": 5.21.1 - "@rjsf/utils": 5.21.1 - "@rjsf/validator-ajv8": 5.21.1 + "@rjsf/core": 5.21.2 + "@rjsf/material-ui": 5.21.2 + "@rjsf/utils": 5.21.2 + "@rjsf/validator-ajv8": 5.21.2 "@testing-library/dom": ^10.0.0 "@testing-library/jest-dom": ^6.0.0 "@testing-library/react": ^16.0.0 @@ -7742,10 +7742,10 @@ __metadata: "@material-ui/lab": 4.0.0-alpha.61 "@microsoft/fetch-event-source": ^2.0.1 "@react-hookz/web": ^24.0.0 - "@rjsf/core": 5.21.1 - "@rjsf/material-ui": 5.21.1 - "@rjsf/utils": 5.21.1 - "@rjsf/validator-ajv8": 5.21.1 + "@rjsf/core": 5.21.2 + "@rjsf/material-ui": 5.21.2 + "@rjsf/utils": 5.21.2 + "@rjsf/validator-ajv8": 5.21.2 "@testing-library/dom": ^10.0.0 "@testing-library/jest-dom": ^6.0.0 "@testing-library/react": ^16.0.0 @@ -14766,9 +14766,9 @@ __metadata: languageName: node linkType: hard -"@rjsf/core@npm:5.21.1": - version: 5.21.1 - resolution: "@rjsf/core@npm:5.21.1" +"@rjsf/core@npm:5.21.2": + version: 5.21.2 + resolution: "@rjsf/core@npm:5.21.2" dependencies: lodash: ^4.17.21 lodash-es: ^4.17.21 @@ -14778,26 +14778,26 @@ __metadata: peerDependencies: "@rjsf/utils": ^5.20.x react: ^16.14.0 || >=17 - checksum: a2372faeaeba53e83d9301b7b2fa300a37477bad18fcd55400b3aca270e8be5746590c398212ba6d53bc7f0092dc3bf28a46f17a7e8ddb0864c6590efd75f1f2 + checksum: ac5c4ff0e0cf74ba8cf6d58df314f8f17de6be5b00bb0ca14f79861347bbaa59f37b8f572d80f30388c5007de1d2dedfc3ff70e419eb874331d58f0ba9eeeb42 languageName: node linkType: hard -"@rjsf/material-ui@npm:5.21.1": - version: 5.21.1 - resolution: "@rjsf/material-ui@npm:5.21.1" +"@rjsf/material-ui@npm:5.21.2": + version: 5.21.2 + resolution: "@rjsf/material-ui@npm:5.21.2" peerDependencies: "@material-ui/core": ^4.12.3 "@material-ui/icons": ^4.11.2 "@rjsf/core": ^5.20.x "@rjsf/utils": ^5.20.x react: ^16.14.0 || >=17 - checksum: 3ff88b9f33deb767abd640f301857f12edfe436a1252f52b70d6f60b02f1975d2becc79f2a940bb8de2fd1732481d2101104b07c09c80b61ed4c393f9df8718e + checksum: 868d86f0a9786b0404734628d5fd158ab1bed4bb6eed8b23cdcdb3e68c398993b6ea8edb5ff4cc68006b081bfeaecb2e5ee6252872604d2124e9dc3078732676 languageName: node linkType: hard -"@rjsf/utils@npm:5.21.1": - version: 5.21.1 - resolution: "@rjsf/utils@npm:5.21.1" +"@rjsf/utils@npm:5.21.2": + version: 5.21.2 + resolution: "@rjsf/utils@npm:5.21.2" dependencies: json-schema-merge-allof: ^0.8.1 jsonpointer: ^5.0.1 @@ -14806,13 +14806,13 @@ __metadata: react-is: ^18.2.0 peerDependencies: react: ^16.14.0 || >=17 - checksum: bc0ac70a1a50f83d2425a782f6878537071922e0187026578005ca578700f8b0dc214cf72366668c7bb80374bb9409cc5233f1b1437aeadbd842f86e77e80067 + checksum: 05460f3c95e1a407001accaf2e9b90c0731433936cfea6a129ac01b49575f56ba336f1ae46e3930f0226580d06c6300c8622d1c3a56354c3e723caf3654f02e1 languageName: node linkType: hard -"@rjsf/validator-ajv8@npm:5.21.1": - version: 5.21.1 - resolution: "@rjsf/validator-ajv8@npm:5.21.1" +"@rjsf/validator-ajv8@npm:5.21.2": + version: 5.21.2 + resolution: "@rjsf/validator-ajv8@npm:5.21.2" dependencies: ajv: ^8.12.0 ajv-formats: ^2.1.1 @@ -14820,7 +14820,7 @@ __metadata: lodash-es: ^4.17.21 peerDependencies: "@rjsf/utils": ^5.20.x - checksum: d987a368092e561ff49ee2ab7f2b17d68d17bbedfb02356e453987cd2032fe476b1c35f0934fd5e0149ff478c7c87dfef43ff6f459fd15679a4c478cc32bd1be + checksum: 06d34e70e6595c5a0e999a3a2a651fccc7a36dbb2395f5805ce1ac6b47201111e6d84c9e122f3d336bbdbaca61875a90efd65e1839d9da3c9aafe282dcc03086 languageName: node linkType: hard From 718ce10f57360db609a6456f7762920caa8d7ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jerna=C5=9B?= Date: Wed, 9 Oct 2024 17:52:36 +0200 Subject: [PATCH 061/268] feat(catalog-backend): Added doc and review fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Łukasz Jernaś --- .../software-catalog/configuration.md | 36 +++++++++++++++++-- plugins/catalog-backend/config.d.ts | 4 +-- .../catalog-backend/src/stitching/types.ts | 24 ++++++++----- 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/docs/features/software-catalog/configuration.md b/docs/features/software-catalog/configuration.md index dff09a9397..82cf80596f 100644 --- a/docs/features/software-catalog/configuration.md +++ b/docs/features/software-catalog/configuration.md @@ -165,7 +165,7 @@ catalog: ## Processing Interval -The [processing loop](https://backstage.io/docs/features/software-catalog/life-of-an-entity) is +The [processing loop](./life-of-an-entity.md#processing) is responsible for running your registered processors on all entities, on a certain interval. That interval can be configured with the `processingInterval` app-config parameter. @@ -192,13 +192,43 @@ Setting this value too low risks exhausting rate limits on external systems that are queried by processors, such as version control systems housing catalog-info files. +## Stitching strategy + +[Stitching](./life-of-an-entity.md#stitching) finalizes the entity. It can be run in +two modes: + +- `immediate` - performs stitching in-band immediately when needed +- `deferred` - performs the stitching asynchronously + +It can be configured with the `stitchingStrategy` app-config parameter. + +```yaml title="app-config.yaml" +catalog: + stitchingStrategy: immediate +``` + +For the `deferred` mode you can set up additional parameters to further tune the process, +by setting the following parameters: + +- `pollingInterval` - the interval between polling for entities that need stitching +- `stitchTimeout` - the maximum time to wait for an entity to be stitched + +These parameters accept a duration object, similar to the `processingInterval` parameter. + +```yaml title="app-config.yaml" +catalog: + stitchingStrategy: deferred + pollingInterval: { seconds: 1 } + stitchTimeout: { minutes: 1 }; +``` + ## Subscribing to Catalog Errors Catalog errors are published to the [events plugin](https://github.com/backstage/backstage/tree/master/plugins/events-node): `@backstage/plugin-events-node`. You can subscribe to events and respond to errors, for example you may wish to log them. The first step is to add the events backend plugin to your Backstage application. Navigate to your Backstage application directory and add the plugin package. -```ts title="From your Backstage root directory" +```bash title="From your Backstage root directory" yarn --cwd packages/backend add @backstage/plugin-events-backend ``` @@ -214,7 +244,7 @@ If you want to log catalog errors you can install the `@backstage/plugin-catalog Install the catalog logs module. -```ts title="From your Backstage root directory" +```bash title="From your Backstage root directory" yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-logs ``` diff --git a/plugins/catalog-backend/config.d.ts b/plugins/catalog-backend/config.d.ts index 183607341c..8bab83d4b4 100644 --- a/plugins/catalog-backend/config.d.ts +++ b/plugins/catalog-backend/config.d.ts @@ -157,9 +157,9 @@ export interface Config { /** Defer stitching to be performed asynchronously */ mode: 'deferred'; /** Polling interval for tasks in seconds */ - pollingInterval?: number; + pollingInterval?: HumanDuration; /** How long to wait for a stitch to complete before giving up in seconds */ - stitchTimeout?: number; + stitchTimeout?: HumanDuration; }; /** diff --git a/plugins/catalog-backend/src/stitching/types.ts b/plugins/catalog-backend/src/stitching/types.ts index afeeff7335..7064dd1a1c 100644 --- a/plugins/catalog-backend/src/stitching/types.ts +++ b/plugins/catalog-backend/src/stitching/types.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Config } from '@backstage/config'; +import { Config, readDurationFromConfig } from '@backstage/config'; import { HumanDuration } from '@backstage/types'; /** @@ -66,15 +66,23 @@ export function stitchingStrategyFromConfig(config: Config): StitchingStrategy { mode: 'immediate', }; } else if (strategyMode === 'deferred') { - const pollingInterval = - config.getOptionalNumber('catalog.stitchingStrategy.pollingInterval') ?? - 1; - const stitchTimeout = - config.getOptionalNumber('catalog.stitchingStrategy.stitchTimeout') ?? 60; + const pollingIntervalKey = 'catalog.stitchingStrategy.pollingInterval'; + const stitchTimeoutKey = 'catalog.stitchingStrategy.stitchTimeout'; + + const pollingInterval = config.has(pollingIntervalKey) + ? readDurationFromConfig(config, { + key: pollingIntervalKey, + }) + : { seconds: 1 }; + const stitchTimeout = config.has(stitchTimeoutKey) + ? readDurationFromConfig(config, { + key: stitchTimeoutKey, + }) + : { seconds: 60 }; return { mode: 'deferred', - pollingInterval: { seconds: pollingInterval }, - stitchTimeout: { seconds: stitchTimeout }, + pollingInterval: pollingInterval, + stitchTimeout: stitchTimeout, }; } From a3075272b908ba23daf7dbec3f3f2a7a841ec79a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:55:24 +0000 Subject: [PATCH 062/268] chore(deps): update chromaui/action digest to bbbf288 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/verify_storybook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify_storybook.yml b/.github/workflows/verify_storybook.yml index 77a01f9ffd..108b7946ab 100644 --- a/.github/workflows/verify_storybook.yml +++ b/.github/workflows/verify_storybook.yml @@ -51,7 +51,7 @@ jobs: - run: yarn build-storybook - - uses: chromaui/action@30b6228aa809059d46219e0f556752e8672a7e26 # v11 + - uses: chromaui/action@bbbf288765438d5fd2be13e1d80d542a39e74108 # v11 with: token: ${{ secrets.GITHUB_TOKEN }} # projectToken intentionally shared to allow collaborators to run Chromatic on forks From 9900a174d0c787fa0800704f696a1d82b7732899 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:39:19 +0000 Subject: [PATCH 063/268] chore(deps): update actions/upload-artifact action to v4.4.3 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/pr-review-comment-trigger.yaml | 2 +- .github/workflows/scorecard.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-review-comment-trigger.yaml b/.github/workflows/pr-review-comment-trigger.yaml index 7e3faaebc5..9ebfbee3b0 100644 --- a/.github/workflows/pr-review-comment-trigger.yaml +++ b/.github/workflows/pr-review-comment-trigger.yaml @@ -30,7 +30,7 @@ jobs: run: | mkdir -p ./pr echo $PR_NUMBER > ./pr/pr_number - - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: pr_number-${{ github.event.pull_request.number }} path: pr/ diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 53489d8c0e..b6f72a66a6 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -58,7 +58,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: 'Upload artifact' - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: SARIF file path: results.sarif From dae59c15f82518f69d8cd64ca726dd4943b0e22b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:48:57 +0000 Subject: [PATCH 064/268] chore(deps): update dependency @short.io/opensearch-mock to ^0.4.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .changeset/renovate-3d822ce.md | 5 +++ .../package.json | 2 +- yarn.lock | 41 +++++++++++++++---- 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 .changeset/renovate-3d822ce.md diff --git a/.changeset/renovate-3d822ce.md b/.changeset/renovate-3d822ce.md new file mode 100644 index 0000000000..805b924b3b --- /dev/null +++ b/.changeset/renovate-3d822ce.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-backend-module-elasticsearch': patch +--- + +Updated dependency `@short.io/opensearch-mock` to `^0.4.0`. diff --git a/plugins/search-backend-module-elasticsearch/package.json b/plugins/search-backend-module-elasticsearch/package.json index 61dc522801..45e9475386 100644 --- a/plugins/search-backend-module-elasticsearch/package.json +++ b/plugins/search-backend-module-elasticsearch/package.json @@ -64,7 +64,7 @@ "@backstage/backend-test-utils": "workspace:^", "@backstage/cli": "workspace:^", "@elastic/elasticsearch-mock": "^1.0.0", - "@short.io/opensearch-mock": "^0.3.1" + "@short.io/opensearch-mock": "^0.4.0" }, "configSchema": "config.d.ts" } diff --git a/yarn.lock b/yarn.lock index ee5e70cfe8..7dd7add262 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7824,7 +7824,7 @@ __metadata: "@elastic/elasticsearch": ^7.13.0 "@elastic/elasticsearch-mock": ^1.0.0 "@opensearch-project/opensearch": ^2.2.1 - "@short.io/opensearch-mock": ^0.3.1 + "@short.io/opensearch-mock": ^0.4.0 aws4: ^1.12.0 elastic-builder: ^2.16.0 lodash: ^4.17.21 @@ -15194,14 +15194,14 @@ __metadata: languageName: node linkType: hard -"@short.io/opensearch-mock@npm:^0.3.1": - version: 0.3.1 - resolution: "@short.io/opensearch-mock@npm:0.3.1" +"@short.io/opensearch-mock@npm:^0.4.0": + version: 0.4.0 + resolution: "@short.io/opensearch-mock@npm:0.4.0" dependencies: fast-deep-equal: ^3.1.3 - find-my-way: ^4.3.3 + find-my-way: ^9.0.1 into-stream: ^6.0.0 - checksum: 5d703e0311954d82ce9dc0367ad257f88d728d93f8de70d2ae53f4ceaa98ff0c31f453cef85e75ec716218fed2bfcf9207a1c3dd71fa5db6874391658e02abdb + checksum: aceb256b9129c2d73eb0fb39d36db29f2e5051cfeeab2626f6579ca951ca394b93cd2301237ece5e544e36e333ca0483518a49ad7a832b61fded79a68a304d37 languageName: node linkType: hard @@ -27341,7 +27341,7 @@ __metadata: languageName: node linkType: hard -"fast-querystring@npm:^1.1.1": +"fast-querystring@npm:^1.0.0, fast-querystring@npm:^1.1.1": version: 1.1.2 resolution: "fast-querystring@npm:1.1.2" dependencies: @@ -27623,6 +27623,17 @@ __metadata: languageName: node linkType: hard +"find-my-way@npm:^9.0.1": + version: 9.1.0 + resolution: "find-my-way@npm:9.1.0" + dependencies: + fast-deep-equal: ^3.1.3 + fast-querystring: ^1.0.0 + safe-regex2: ^4.0.0 + checksum: 1d4554fcc5681e995feab84f4f7c8d28e09463a5cd64ffbf26f7d1635ce6885101648cc510befb9ff529a92370ccb216e1e4fe96b9cc163da61985cd90542294 + languageName: node + linkType: hard + "find-pkg@npm:2.0.0": version: 2.0.0 resolution: "find-pkg@npm:2.0.0" @@ -39757,6 +39768,13 @@ __metadata: languageName: node linkType: hard +"ret@npm:~0.5.0": + version: 0.5.0 + resolution: "ret@npm:0.5.0" + checksum: 3763aff074a56baa072afcfb5c19b09fb7c05045a27715bf4f28395cd11ab98cc2d0698bf4a3cd3f1c5e650ed167362d354c0e545ab134a6b7ec83df5e9d7d42 + languageName: node + linkType: hard + "retry-request@npm:^7.0.0": version: 7.0.1 resolution: "retry-request@npm:7.0.1" @@ -40198,6 +40216,15 @@ __metadata: languageName: node linkType: hard +"safe-regex2@npm:^4.0.0": + version: 4.0.0 + resolution: "safe-regex2@npm:4.0.0" + dependencies: + ret: ~0.5.0 + checksum: 5607d4c20a92d66905d33556807da759ef0615d3b508ae7d6e7558e763bd59042bd30afb32d5f2456eb3f69a9d86fadbdf5e3e292494dae89fdae3087532602e + languageName: node + linkType: hard + "safe-stable-stringify@npm:^1.1": version: 1.1.1 resolution: "safe-stable-stringify@npm:1.1.1" From 68359cd5b6fab77387fb342b0be1e2f6305e6787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 9 Oct 2024 20:20:03 +0200 Subject: [PATCH 065/268] Update docs/features/software-templates/writing-templates.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- docs/features/software-templates/writing-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 7349ff94e0..c1c8250be9 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -916,7 +916,7 @@ export default async function createPlugin({ } ``` -Note, that addtional template global functions are currently not supported in `fetch:template` (see #25445). +Note that additional template global functions are currently not supported in `fetch:template` (see #25445). ## Template Editor From b99294d86aabceebc14020ae036f80c168c5ba20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 9 Oct 2024 20:20:11 +0200 Subject: [PATCH 066/268] Update docs/features/software-templates/writing-templates.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- docs/features/software-templates/writing-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index c1c8250be9..686ed1de32 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -878,7 +878,7 @@ const scaffolderModuleCustomFilters = createBackendModule({ myGlobal: () => 'myGlobal', myFunctionGlobal: (...args: JsonValue[]) => args[0] + args[1], }); - scaffolder.additionalTemplateFilters({ + scaffolder.addTemplateFilters({ myFilter: () => 'the value is this now', myOtherFilter: (...args: JsonValue[]) => args.join(''), }); From c06b7f136aca5998773ee28427b91458e1c844c1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:25:22 +0000 Subject: [PATCH 067/268] chore(deps): update dependency @types/jscodeshift to ^0.12.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .changeset/renovate-cc4bfa7.md | 5 +++++ packages/codemods/package.json | 2 +- yarn.lock | 10 +++++----- 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/renovate-cc4bfa7.md diff --git a/.changeset/renovate-cc4bfa7.md b/.changeset/renovate-cc4bfa7.md new file mode 100644 index 0000000000..b3434c8127 --- /dev/null +++ b/.changeset/renovate-cc4bfa7.md @@ -0,0 +1,5 @@ +--- +'@backstage/codemods': patch +--- + +Updated dependency `@types/jscodeshift` to `^0.12.0`. diff --git a/packages/codemods/package.json b/packages/codemods/package.json index 746fb92022..a3c4cf6cb2 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -51,7 +51,7 @@ }, "devDependencies": { "@backstage/cli": "workspace:^", - "@types/jscodeshift": "^0.11.0", + "@types/jscodeshift": "^0.12.0", "@types/node": "^18.17.8" } } diff --git a/yarn.lock b/yarn.lock index b87bb1331d..0508b26039 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4081,7 +4081,7 @@ __metadata: dependencies: "@backstage/cli": "workspace:^" "@backstage/cli-common": "workspace:^" - "@types/jscodeshift": ^0.11.0 + "@types/jscodeshift": ^0.12.0 "@types/node": ^18.17.8 chalk: ^4.0.0 commander: ^12.0.0 @@ -18016,13 +18016,13 @@ __metadata: languageName: node linkType: hard -"@types/jscodeshift@npm:^0.11.0": - version: 0.11.11 - resolution: "@types/jscodeshift@npm:0.11.11" +"@types/jscodeshift@npm:^0.12.0": + version: 0.12.0 + resolution: "@types/jscodeshift@npm:0.12.0" dependencies: ast-types: ^0.14.1 recast: ^0.20.3 - checksum: 6224b781cbbc8e095cae3cb8f9dd1ca102d6c42d9c882b76ea84dfd0cd43870ce317369480ed6b593352efe9fe7199bd6c40ec2cb37646c474ba15f5b43d2109 + checksum: 66c2025ee500b30c29af4674033711bd5d7c5fcdc37d62c2d5633d39fc5dbdc571abd497aed96bd2313080a3d131ef4d8da5c593f220ec2ff1302e5ce27ebf46 languageName: node linkType: hard From 6ce5f898332483e77b0298035db0a79f6f81e7a3 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 11:40:02 +0200 Subject: [PATCH 068/268] cli: add support form yaml in vite config Signed-off-by: Patrik Oldsberg --- packages/app/package.json | 1 + packages/cli/package.json | 4 +++ packages/cli/src/lib/bundler/server.ts | 2 ++ yarn.lock | 43 ++++++++++++++++++-------- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 71ee806121..36eecdfebd 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -73,6 +73,7 @@ "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.61", + "@modyfi/vite-plugin-yaml": "^1.1.0", "@octokit/rest": "^19.0.3", "@vitejs/plugin-react": "^4.3.1", "history": "^5.0.0", diff --git a/packages/cli/package.json b/packages/cli/package.json index 4c30853803..6fa3103b48 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -193,12 +193,16 @@ "vite-plugin-node-polyfills": "^0.22.0" }, "peerDependencies": { + "@modyfi/vite-plugin-yaml": "^1.1.0", "@vitejs/plugin-react": "^4.3.1", "vite": "^5.0.0", "vite-plugin-html": "^3.2.2", "vite-plugin-node-polyfills": "^0.22.0" }, "peerDependenciesMeta": { + "@modyfi/vite-plugin-yaml": { + "optional": true + }, "@vitejs/plugin-react": { "optional": true }, diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index d73bcc662e..34510f997f 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -127,6 +127,7 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be if (process.env.EXPERIMENTAL_VITE) { const vite = require('vite'); const { default: viteReact } = require('@vitejs/plugin-react'); + const { default: viteYaml } = require('@modyfi/vite-plugin-yaml'); const { nodePolyfills: viteNodePolyfills, } = require('vite-plugin-node-polyfills'); @@ -143,6 +144,7 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be plugins: [ viteReact(), viteNodePolyfills(), + viteYaml(), viteHtml({ entry: paths.targetEntry, // todo(blam): we should look at contributing to thPe plugin here diff --git a/yarn.lock b/yarn.lock index 6862360cca..c48f2b447d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4057,11 +4057,14 @@ __metadata: yn: ^4.0.0 zod: ^3.22.4 peerDependencies: + "@modyfi/vite-plugin-yaml": ^1.1.0 "@vitejs/plugin-react": ^4.3.1 vite: ^5.0.0 vite-plugin-html: ^3.2.2 vite-plugin-node-polyfills: ^0.22.0 peerDependenciesMeta: + "@modyfi/vite-plugin-yaml": + optional: true "@vitejs/plugin-react": optional: true vite: @@ -11578,6 +11581,19 @@ __metadata: languageName: node linkType: hard +"@modyfi/vite-plugin-yaml@npm:^1.1.0": + version: 1.1.0 + resolution: "@modyfi/vite-plugin-yaml@npm:1.1.0" + dependencies: + "@rollup/pluginutils": 5.1.0 + js-yaml: 4.1.0 + tosource: 2.0.0-alpha.3 + peerDependencies: + vite: ^3.2.7 || ^4.0.5 || ^5.0.5 + checksum: 6989cde89323321b714b69d11b9125c8d3483a8c6ace536df313edd653180e85e6013effbc6cb8b89e6f9d6e107a10f7a82fadf6a44e81255b437702d5dd1db0 + languageName: node + linkType: hard + "@motionone/animation@npm:^10.12.0": version: 10.16.3 resolution: "@motionone/animation@npm:10.16.3" @@ -14908,17 +14924,7 @@ __metadata: languageName: node linkType: hard -"@rollup/pluginutils@npm:^4.2.0, @rollup/pluginutils@npm:^4.2.1": - version: 4.2.1 - resolution: "@rollup/pluginutils@npm:4.2.1" - dependencies: - estree-walker: ^2.0.1 - picomatch: ^2.2.2 - checksum: 6bc41f22b1a0f1efec3043899e4d3b6b1497b3dea4d94292d8f83b4cf07a1073ecbaedd562a22d11913ff7659f459677b01b09e9598a98936e746780ecc93a12 - languageName: node - linkType: hard - -"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.0.5, @rollup/pluginutils@npm:^5.1.0": +"@rollup/pluginutils@npm:5.1.0, @rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.0.5, @rollup/pluginutils@npm:^5.1.0": version: 5.1.0 resolution: "@rollup/pluginutils@npm:5.1.0" dependencies: @@ -14934,6 +14940,16 @@ __metadata: languageName: node linkType: hard +"@rollup/pluginutils@npm:^4.2.0, @rollup/pluginutils@npm:^4.2.1": + version: 4.2.1 + resolution: "@rollup/pluginutils@npm:4.2.1" + dependencies: + estree-walker: ^2.0.1 + picomatch: ^2.2.2 + checksum: 6bc41f22b1a0f1efec3043899e4d3b6b1497b3dea4d94292d8f83b4cf07a1073ecbaedd562a22d11913ff7659f459677b01b09e9598a98936e746780ecc93a12 + languageName: node + linkType: hard + "@rollup/rollup-android-arm-eabi@npm:4.22.5": version: 4.22.5 resolution: "@rollup/rollup-android-arm-eabi@npm:4.22.5" @@ -26860,6 +26876,7 @@ __metadata: "@material-ui/core": ^4.12.2 "@material-ui/icons": ^4.9.1 "@material-ui/lab": 4.0.0-alpha.61 + "@modyfi/vite-plugin-yaml": ^1.1.0 "@octokit/rest": ^19.0.3 "@playwright/test": ^1.32.3 "@testing-library/dom": ^10.0.0 @@ -31601,7 +31618,7 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:=4.1.0, js-yaml@npm:^4.0.0, js-yaml@npm:^4.1.0": +"js-yaml@npm:4.1.0, js-yaml@npm:=4.1.0, js-yaml@npm:^4.0.0, js-yaml@npm:^4.1.0": version: 4.1.0 resolution: "js-yaml@npm:4.1.0" dependencies: @@ -42600,7 +42617,7 @@ __metadata: languageName: node linkType: hard -"tosource@npm:^2.0.0-alpha.3": +"tosource@npm:2.0.0-alpha.3, tosource@npm:^2.0.0-alpha.3": version: 2.0.0-alpha.3 resolution: "tosource@npm:2.0.0-alpha.3" checksum: bc03a7571de8ed4306e6721283fa891f2adcab9dd80c46f6f177d4259b34bb192fe3a2cb3e1e2ce16f9db0bc7e534acfcb5478ab094b0ba255f98abfce6dab46 From 54c8aa3c43dbb4f4a38ca1827e53bbc7a2b86b5a Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 11:41:23 +0200 Subject: [PATCH 069/268] cli: fix react-dom/client check always running from CLI dir Signed-off-by: Patrik Oldsberg --- .changeset/good-trainers-appear.md | 5 +++++ packages/cli/src/lib/bundler/hasReactDomClient.ts | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/good-trainers-appear.md diff --git a/.changeset/good-trainers-appear.md b/.changeset/good-trainers-appear.md new file mode 100644 index 0000000000..3bce8c86bd --- /dev/null +++ b/.changeset/good-trainers-appear.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +The check for `react-dom/client` will now properly always run from the target directory. diff --git a/packages/cli/src/lib/bundler/hasReactDomClient.ts b/packages/cli/src/lib/bundler/hasReactDomClient.ts index e7ef7bbac9..67e6a3f42e 100644 --- a/packages/cli/src/lib/bundler/hasReactDomClient.ts +++ b/packages/cli/src/lib/bundler/hasReactDomClient.ts @@ -13,9 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +import { paths } from '../paths'; + export function hasReactDomClient() { try { - require.resolve('react-dom/client'); + require.resolve('react-dom/client', { + paths: [paths.targetDir], + }); return true; } catch { return false; From 1939595a2db779be62869387ac15d27227229f86 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 11:42:03 +0200 Subject: [PATCH 070/268] cli: refine vite Node.js polyfills Signed-off-by: Patrik Oldsberg --- packages/cli/src/lib/bundler/server.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index 34510f997f..bf67db5364 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -134,7 +134,6 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be const { createHtmlPlugin: viteHtml } = require('vite-plugin-html'); viteServer = await vite.createServer({ define: { - global: 'window', 'process.argv': JSON.stringify(process.argv), 'process.env.APP_CONFIG': JSON.stringify(cliConfig.frontendAppConfigs), // This allows for conditional imports of react-dom/client, since there's no way @@ -143,7 +142,23 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be }, plugins: [ viteReact(), - viteNodePolyfills(), + viteNodePolyfills({ + include: [ + 'buffer', + 'events', + 'os', + 'process', + 'querystring', + 'stream', + 'url', + 'util', + ], + globals: { + global: true, + Buffer: true, + process: true, + }, + }), viteYaml(), viteHtml({ entry: paths.targetEntry, From 7c05626d8c73fdca854e09b0c3da15a81dcdc256 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 11:44:03 +0200 Subject: [PATCH 071/268] cli: env var definitions for deps optimization in vite Signed-off-by: Patrik Oldsberg --- packages/cli/src/lib/bundler/server.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index bf67db5364..6256b168bd 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -132,6 +132,7 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be nodePolyfills: viteNodePolyfills, } = require('vite-plugin-node-polyfills'); const { createHtmlPlugin: viteHtml } = require('vite-plugin-html'); + viteServer = await vite.createServer({ define: { 'process.argv': JSON.stringify(process.argv), @@ -140,6 +141,24 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be // to check for presence of it in source code without module resolution errors. 'process.env.HAS_REACT_DOM_CLIENT': JSON.stringify(hasReactDomClient()), }, + optimizeDeps: { + esbuildOptions: { + plugins: [ + { + name: 'custom-define', + setup(build: { + initialOptions: { define: Record }; + }) { + const define = (build.initialOptions.define ||= {}); + define['process.env.HAS_REACT_DOM_CLIENT'] = JSON.stringify( + hasReactDomClient(), + ); + define['process.env.NODE_ENV'] = JSON.stringify('development'); + }, + }, + ], + }, + }, plugins: [ viteReact(), viteNodePolyfills({ From 4bfc2ce705ef4b038262d9403fb38e9d7f1ca558 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 11:45:08 +0200 Subject: [PATCH 072/268] changesets: changeset for vite updates Signed-off-by: Patrik Oldsberg --- .changeset/real-tigers-punch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/real-tigers-punch.md diff --git a/.changeset/real-tigers-punch.md b/.changeset/real-tigers-punch.md new file mode 100644 index 0000000000..c5597e50da --- /dev/null +++ b/.changeset/real-tigers-punch.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Updated the Vite implementation behind the `EXPERIMENTAL_VITE` flag to work with more recent versions of Backstage. From 16c6025f2175e0f9ba50abbd1bad768937376535 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 11:51:01 +0200 Subject: [PATCH 073/268] cli: use types for vite implementaiton Signed-off-by: Patrik Oldsberg --- packages/cli/src/lib/bundler/server.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index 6256b168bd..0dc4ce7b0f 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -125,13 +125,15 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be }); if (process.env.EXPERIMENTAL_VITE) { - const vite = require('vite'); - const { default: viteReact } = require('@vitejs/plugin-react'); - const { default: viteYaml } = require('@modyfi/vite-plugin-yaml'); - const { - nodePolyfills: viteNodePolyfills, - } = require('vite-plugin-node-polyfills'); - const { createHtmlPlugin: viteHtml } = require('vite-plugin-html'); + const vite = require('vite') as typeof import('vite'); + const { default: viteReact } = + require('@vitejs/plugin-react') as typeof import('@vitejs/plugin-react'); + const { default: viteYaml } = + require('@modyfi/vite-plugin-yaml') as typeof import('@modyfi/vite-plugin-yaml'); + const { nodePolyfills: viteNodePolyfills } = + require('vite-plugin-node-polyfills') as typeof import('vite-plugin-node-polyfills'); + const { createHtmlPlugin: viteHtml } = + require('vite-plugin-html') as typeof import('vite-plugin-html'); viteServer = await vite.createServer({ define: { @@ -146,9 +148,7 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be plugins: [ { name: 'custom-define', - setup(build: { - initialOptions: { define: Record }; - }) { + setup(build) { const define = (build.initialOptions.define ||= {}); define['process.env.HAS_REACT_DOM_CLIENT'] = JSON.stringify( hasReactDomClient(), From ff9c2f749c7603e325fefdbe68c64d0295eded12 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 11:56:31 +0200 Subject: [PATCH 074/268] cli: add back a few more node polyfills for vite config Signed-off-by: Patrik Oldsberg --- packages/cli/src/lib/bundler/server.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index 0dc4ce7b0f..6542e0a393 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -165,12 +165,17 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be include: [ 'buffer', 'events', + 'fs', + 'http', + 'https', 'os', + 'path', 'process', 'querystring', 'stream', 'url', 'util', + 'zlib', ], globals: { global: true, From d7b44f0b3c095d47e3f8d26c98113d8a6308cb2f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 12:20:25 +0200 Subject: [PATCH 075/268] backend-defaults: fix SQLite shutdown hanging Signed-off-by: Patrik Oldsberg --- .changeset/silver-comics-attend.md | 5 +++ .../database/DatabaseManager.test.ts | 44 ++++++++++++++++++- .../entrypoints/database/DatabaseManager.ts | 3 ++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .changeset/silver-comics-attend.md diff --git a/.changeset/silver-comics-attend.md b/.changeset/silver-comics-attend.md new file mode 100644 index 0000000000..f13553b53f --- /dev/null +++ b/.changeset/silver-comics-attend.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Fix for backend shutdown hanging during local development due to SQLite connection shutdown never resolving. diff --git a/packages/backend-defaults/src/entrypoints/database/DatabaseManager.test.ts b/packages/backend-defaults/src/entrypoints/database/DatabaseManager.test.ts index c7e739c7c7..27cb511477 100644 --- a/packages/backend-defaults/src/entrypoints/database/DatabaseManager.test.ts +++ b/packages/backend-defaults/src/entrypoints/database/DatabaseManager.test.ts @@ -182,7 +182,9 @@ describe('DatabaseManagerImpl', () => { const rootLifecycle = { addShutdownHook: jest.fn() } as unknown as any; const destroy = jest.fn(); const connector1 = { - getClient: jest.fn().mockResolvedValue({ destroy }), + getClient: jest + .fn() + .mockResolvedValue({ destroy, client: { config: 'pg' } }), } satisfies Connector; const impl = new DatabaseManagerImpl( new ConfigReader({ @@ -207,4 +209,44 @@ describe('DatabaseManagerImpl', () => { // Then the destroy method should have been called on the resolved client expect(destroy).toHaveBeenCalled(); }); + + it('does not attempt to destroy connection when using SQLite', async () => { + // Same us the previous test, but with SQLite + const rootLifecycle = { addShutdownHook: jest.fn() } as unknown as any; + + // Make sure we're actually checking the client, since we're ignoring errors + const getConfig = jest.fn().mockReturnValue('sqlite3'); + + const destroy = jest.fn(); + const connector1 = { + getClient: jest.fn().mockResolvedValue({ + destroy, + client: { + get config() { + return getConfig(); + }, + }, + }), + } satisfies Connector; + const impl = new DatabaseManagerImpl( + new ConfigReader({ + client: 'pg', + }), + { + pg: connector1, + }, + { rootLifecycle }, + ); + + expect(rootLifecycle.addShutdownHook).toHaveBeenCalled(); + const shutdownHook = rootLifecycle.addShutdownHook.mock.calls[0][0]; + + await impl.forPlugin('plugin1', deps).getClient(); + + await shutdownHook(); + + // Destroy should not have been called, but we should have read the config + expect(destroy).not.toHaveBeenCalled(); + expect(getConfig).toHaveBeenCalled(); + }); }); diff --git a/packages/backend-defaults/src/entrypoints/database/DatabaseManager.ts b/packages/backend-defaults/src/entrypoints/database/DatabaseManager.ts index 0f6207ef07..7fddb17987 100644 --- a/packages/backend-defaults/src/entrypoints/database/DatabaseManager.ts +++ b/packages/backend-defaults/src/entrypoints/database/DatabaseManager.ts @@ -117,6 +117,9 @@ export class DatabaseManagerImpl { const connection = await this.databaseCache.get(pluginId); if (connection) { + if (connection.client.config.includes('sqlite3')) { + return; // sqlite3 does not support destroy, it hangs + } await connection.destroy().catch((error: unknown) => { deps?.logger?.error( `Problem closing database connection for ${pluginId}: ${stringifyError( From a64f4856952e646acf4a87cef31085869601ed0c Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 10 Oct 2024 13:52:32 +0200 Subject: [PATCH 076/268] .github/workflows: update backstage-cli cache to use unique keys Signed-off-by: Patrik Oldsberg --- .github/workflows/ci.yml | 6 ++++-- .github/workflows/deploy_packages.yml | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81d1d109b1..af727736f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -238,7 +238,9 @@ jobs: uses: actions/cache/restore@v4 with: path: .cache/backstage-cli - key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli + key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli- - name: lint changed packages run: yarn backstage-cli repo lint --since origin/master --successCache --successCacheDir .cache/backstage-cli @@ -258,7 +260,7 @@ jobs: if: always() with: path: .cache/backstage-cli - key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli + key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli-${{ github.run_id }} # We run the test cases before verifying the specs to prevent any failing tests from causing errors. - name: verify openapi specs against test cases diff --git a/.github/workflows/deploy_packages.yml b/.github/workflows/deploy_packages.yml index eda5e7e0c6..8bafa2fe43 100644 --- a/.github/workflows/deploy_packages.yml +++ b/.github/workflows/deploy_packages.yml @@ -97,7 +97,9 @@ jobs: uses: actions/cache@v4 with: path: .cache/backstage-cli - key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli + key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli- - name: lint run: yarn backstage-cli repo lint --successCache --successCacheDir .cache/backstage-cli From 7f7892bc0b281e900b5ea71f6f888810b5ce3a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 10 Oct 2024 14:46:06 +0200 Subject: [PATCH 077/268] back out of the automocking of instances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- packages/test-utils/report.api.md | 2 +- .../src/testUtils/apis/mockApis.test.tsx | 4 +- .../test-utils/src/testUtils/apis/mockApis.ts | 60 +++++++------------ 3 files changed, 23 insertions(+), 43 deletions(-) diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index a551d54c62..15625adb21 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -91,7 +91,7 @@ export class MockAnalyticsApi implements AnalyticsApi { // @public export namespace mockApis { - export function config(options?: { data?: JsonObject }): jest.Mocked; + export function config(options?: { data?: JsonObject }): ConfigApi; export namespace config { const factory: ( options?: diff --git a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx index b7a78867f8..ebbdb41884 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx +++ b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx @@ -20,15 +20,13 @@ describe('mockApis', () => { describe('config', () => { const data = { backend: { baseUrl: 'http://test.com' } }; - it('can create an instance and make assertions on it', () => { + it('can create an instance', () => { const empty = mockApis.config(); const notEmpty = mockApis.config({ data }); expect(empty.getOptional('backend.baseUrl')).toBeUndefined(); - expect(empty.getOptional).toHaveBeenCalledTimes(1); expect(notEmpty.getOptional('backend.baseUrl')).toEqual( 'http://test.com', ); - expect(notEmpty.getOptional).toHaveBeenCalledTimes(1); }); it('can create a mock and make assertions on it', async () => { diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index d084fae332..eed5a88012 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -18,26 +18,13 @@ import { ConfigReader } from '@backstage/config'; import { ApiFactory, ApiRef, + ConfigApi, configApiRef, createApiFactory, } from '@backstage/core-plugin-api'; import { JsonObject } from '@backstage/types'; import { ApiMock } from './ApiMock'; -/** @internal */ -function simpleInstance( - _ref: ApiRef, - instance: TApi, - mockSkeleton: () => jest.Mocked, -): jest.Mocked { - const mock = mockSkeleton(); - const result = Object.create(instance) as any; - for (const [key, impl] of Object.entries(mock)) { - result[key] = (impl as any).mockImplementation((instance as any)[key]); - } - return result; -} - /** @internal */ function simpleFactory( ref: ApiRef, @@ -116,24 +103,6 @@ function simpleMock( * ``` */ export namespace mockApis { - const configMockSkeleton = () => ({ - has: jest.fn(), - keys: jest.fn(), - get: jest.fn(), - getOptional: jest.fn(), - getConfig: jest.fn(), - getOptionalConfig: jest.fn(), - getConfigArray: jest.fn(), - getOptionalConfigArray: jest.fn(), - getNumber: jest.fn(), - getOptionalNumber: jest.fn(), - getBoolean: jest.fn(), - getOptionalBoolean: jest.fn(), - getString: jest.fn(), - getOptionalString: jest.fn(), - getStringArray: jest.fn(), - getOptionalStringArray: jest.fn(), - }); /** * Fake implementation of {@link @backstage/frontend-plugin-api#ConfigApi} * with optional data supplied. @@ -153,12 +122,8 @@ export namespace mockApis { * ); * ``` */ - export function config(options?: { data?: JsonObject }) { - return simpleInstance( - configApiRef, - new ConfigReader(options?.data, 'mock-config'), - configMockSkeleton, - ); + export function config(options?: { data?: JsonObject }): ConfigApi { + return new ConfigReader(options?.data, 'mock-config'); } /** * Mock helpers for {@link @backstage/frontend-plugin-api#ConfigApi}. @@ -183,6 +148,23 @@ export namespace mockApis { * * @public */ - export const mock = simpleMock(configApiRef, configMockSkeleton); + export const mock = simpleMock(configApiRef, () => ({ + has: jest.fn(), + keys: jest.fn(), + get: jest.fn(), + getOptional: jest.fn(), + getConfig: jest.fn(), + getOptionalConfig: jest.fn(), + getConfigArray: jest.fn(), + getOptionalConfigArray: jest.fn(), + getNumber: jest.fn(), + getOptionalNumber: jest.fn(), + getBoolean: jest.fn(), + getOptionalBoolean: jest.fn(), + getString: jest.fn(), + getOptionalString: jest.fn(), + getStringArray: jest.fn(), + getOptionalStringArray: jest.fn(), + })); } } From b4a33e9434cb776ec3946c2d0a28847f2de5ae45 Mon Sep 17 00:00:00 2001 From: nikolar Date: Thu, 10 Oct 2024 09:39:04 -0700 Subject: [PATCH 078/268] fix api-report complaints Signed-off-by: nikolar --- plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx index 41e1fd7967..ba81ee4bd5 100644 --- a/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx +++ b/plugins/scaffolder-react/src/next/components/Stepper/Stepper.tsx @@ -56,6 +56,7 @@ import { merge } from 'lodash'; const validator = customizeValidator(); ajvErrors(validator.ajv); +/** @alpha */ export type BackstageTemplateStepperClassKey = | 'backButton' | 'footer' From 7357f79670fac65aecfb9bbc9db703adcd7092ec Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 00:36:51 +0200 Subject: [PATCH 079/268] cli: revert rspack additions to backend bundling Signed-off-by: Patrik Oldsberg --- packages/cli/src/lib/bundler/backend.ts | 9 +-------- packages/cli/src/lib/bundler/config.ts | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/packages/cli/src/lib/bundler/backend.ts b/packages/cli/src/lib/bundler/backend.ts index e089a9fd72..598b77bc51 100644 --- a/packages/cli/src/lib/bundler/backend.ts +++ b/packages/cli/src/lib/bundler/backend.ts @@ -20,24 +20,17 @@ import { resolveBundlingPaths } from './paths'; import { BackendServeOptions } from './types'; export async function serveBackend(options: BackendServeOptions) { - const useRspack = !!process.env.EXPERIMENTAL_RSPACK; - const paths = resolveBundlingPaths(options); const config = await createBackendConfig(paths, { ...options, isDev: true, - useRspack, }); // Webpack only replaces occurrences of this in code it touches, which does // not include dependencies in node_modules. So we set it here at runtime as well. (process.env as { NODE_ENV: string }).NODE_ENV = 'development'; - const bundler: typeof webpack = useRspack - ? require('@rspack/core').rspack - : webpack; - - const compiler = bundler(config, (err: Error | null) => { + const compiler = webpack(config, (err: Error | null) => { if (err) { console.error(err); } else console.log('Build succeeded'); diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index 59ef2655cc..958104a68f 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -447,7 +447,7 @@ export async function createBackendConfig( paths: BundlingPaths, options: BackendBundlingOptions, ): Promise { - const { checksEnabled, isDev, useRspack } = options; + const { checksEnabled, isDev } = options; // Find all local monorepo packages and their node_modules, and mark them as external. const { packages } = await getPackages(cliPaths.targetDir); @@ -518,16 +518,13 @@ export async function createBackendConfig( extensions: ['.ts', '.mjs', '.js', '.json'], mainFields: ['main'], modules: [paths.rootNodeModules, ...moduleDirs], - // FIXME: see also https://github.com/web-infra-dev/rspack/issues/3408 - ...(!useRspack && { - plugins: [ - new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), - new ModuleScopePlugin( - [paths.targetSrc, paths.targetDev], - [paths.targetPackageJson], - ), - ], - }), + plugins: [ + new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), + new ModuleScopePlugin( + [paths.targetSrc, paths.targetDev], + [paths.targetPackageJson], + ), + ], }, module: { rules: loaders, @@ -554,9 +551,7 @@ export async function createBackendConfig( nodeArgs: runScriptNodeArgs.length > 0 ? runScriptNodeArgs : undefined, args: process.argv.slice(3), // drop `node backstage-cli backend:dev` }), - new (useRspack - ? require('@rspack/core').rspack.HotModuleReplacementPlugin - : webpack.HotModuleReplacementPlugin)(), + new webpack.HotModuleReplacementPlugin(), ...(checksEnabled ? [ new ForkTsCheckerWebpackPlugin({ From e4125fb698cd361086918a5acd4f21727126c001 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 01:11:08 +0200 Subject: [PATCH 080/268] cli: refactor rspack conditionals Signed-off-by: Patrik Oldsberg --- .../cli/src/commands/build/buildFrontend.ts | 6 ++--- packages/cli/src/commands/build/command.ts | 8 +++--- packages/cli/src/lib/bundler/bundle.ts | 8 +++--- packages/cli/src/lib/bundler/config.ts | 26 ++++++++----------- packages/cli/src/lib/bundler/optimization.ts | 14 ++++------ packages/cli/src/lib/bundler/server.ts | 10 ++++--- packages/cli/src/lib/bundler/transforms.ts | 20 +++++--------- packages/cli/src/lib/bundler/types.ts | 6 ++--- 8 files changed, 44 insertions(+), 54 deletions(-) diff --git a/packages/cli/src/commands/build/buildFrontend.ts b/packages/cli/src/commands/build/buildFrontend.ts index 5cb6d3b526..59f3225738 100644 --- a/packages/cli/src/commands/build/buildFrontend.ts +++ b/packages/cli/src/commands/build/buildFrontend.ts @@ -25,11 +25,11 @@ interface BuildAppOptions { writeStats: boolean; configPaths: string[]; isModuleFederationRemote?: true; - useRspack?: boolean; + rspack?: typeof import('@rspack/core').rspack; } export async function buildFrontend(options: BuildAppOptions) { - const { targetDir, writeStats, configPaths, useRspack } = options; + const { targetDir, writeStats, configPaths, rspack } = options; const { name } = await fs.readJson(resolvePath(targetDir, 'package.json')); await buildBundle({ @@ -45,6 +45,6 @@ export async function buildFrontend(options: BuildAppOptions) { args: configPaths, fromPackage: name, })), - useRspack, + rspack, }); } diff --git a/packages/cli/src/commands/build/command.ts b/packages/cli/src/commands/build/command.ts index 4f99ec6a00..dd3e422d2b 100644 --- a/packages/cli/src/commands/build/command.ts +++ b/packages/cli/src/commands/build/command.ts @@ -25,7 +25,9 @@ import { isValidUrl } from '../../lib/urls'; import chalk from 'chalk'; export async function command(opts: OptionValues): Promise { - const useRspack = !!process.env.EXPERIMENTAL_RSPACK; + const rspack = process.env.EXPERIMENTAL_RSPACK + ? (require('@rspack/core') as typeof import('@rspack/core').rspack) + : undefined; const role = await findRoleFromCommand(opts); @@ -42,7 +44,7 @@ export async function command(opts: OptionValues): Promise { targetDir: paths.targetDir, configPaths, writeStats: Boolean(opts.stats), - useRspack, + rspack, }); } return buildBackend({ @@ -65,7 +67,7 @@ export async function command(opts: OptionValues): Promise { configPaths: [], writeStats: Boolean(opts.stats), isModuleFederationRemote: true, - useRspack, + rspack, }); } diff --git a/packages/cli/src/lib/bundler/bundle.ts b/packages/cli/src/lib/bundler/bundle.ts index 0a36f54053..cb0322eb2c 100644 --- a/packages/cli/src/lib/bundler/bundle.ts +++ b/packages/cli/src/lib/bundler/bundle.ts @@ -38,7 +38,7 @@ function applyContextToError(error: string, moduleName: string): string { } export async function buildBundle(options: BuildOptions) { - const { statsJsonEnabled, schema: configSchema, useRspack } = options; + const { statsJsonEnabled, schema: configSchema, rspack } = options; const paths = resolveBundlingPaths(options); const publicPaths = await resolveOptionalBundlingPaths({ @@ -119,7 +119,7 @@ export async function buildBundle(options: BuildOptions) { ); } - const { stats } = await build(configs, isCi, useRspack); + const { stats } = await build(configs, isCi, rspack); if (!stats) { throw new Error('No stats returned'); @@ -155,9 +155,9 @@ export async function buildBundle(options: BuildOptions) { async function build( configs: webpack.Configuration[], isCi: boolean, - useRspack?: boolean, + rspack?: typeof import('@rspack/core').rspack, ) { - const bundler: typeof webpack = useRspack ? require('@rspack/core') : webpack; + const bundler = (rspack ?? webpack) as typeof webpack; const stats = await new Promise( (resolve, reject) => { diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index 958104a68f..9714ca683e 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -132,7 +132,7 @@ export async function createConfig( frontendConfig, moduleFederation, publicSubPath = '', - useRspack, + rspack, } = options; const { plugins, loaders } = transforms(options); @@ -153,7 +153,7 @@ export async function createConfig( options.moduleFederation, ); - if (useRspack) { + if (rspack) { const RspackReactRefreshPlugin = require('@rspack/plugin-react-refresh'); plugins.push(new RspackReactRefreshPlugin()); } else { @@ -181,10 +181,7 @@ export async function createConfig( ); } - const rspack = useRspack - ? (require('@rspack/core') as typeof import('@rspack/core').rspack) - : undefined; - const bundler = useRspack ? (rspack as unknown as typeof webpack) : webpack; + const bundler = rspack ? (rspack as unknown as typeof webpack) : webpack; // TODO(blam): process is no longer auto polyfilled by webpack in v5. // we use the provide plugin to provide this polyfill, but lets look @@ -215,8 +212,8 @@ export async function createConfig( if (options.moduleFederation) { const isRemote = options.moduleFederation?.mode === 'remote'; - const AdaptedModuleFederationPlugin = useRspack - ? (rspack!.container + const AdaptedModuleFederationPlugin = rspack + ? (rspack.container .ModuleFederationPlugin as unknown as typeof ModuleFederationPlugin) : ModuleFederationPlugin; @@ -285,7 +282,7 @@ export async function createConfig( plugins.push( new bundler.DefinePlugin({ 'process.env.BUILD_INFO': JSON.stringify(buildInfo), - 'process.env.APP_CONFIG': useRspack + 'process.env.APP_CONFIG': rspack ? // FIXME: see also https://github.com/web-infra-dev/rspack/issues/5606 JSON.stringify(options.getFrontendAppConfigs()) : bundler.DefinePlugin.runtimeValue( @@ -301,7 +298,7 @@ export async function createConfig( // These files are required by the transpiled code when using React Refresh. // They need to be excluded to the module scope plugin which ensures that files // that exist in the package are required. - const reactRefreshFiles = useRspack + const reactRefreshFiles = rspack ? [] : [ require.resolve( @@ -341,7 +338,7 @@ export async function createConfig( // the module is part of `react` or `react-dom`, and `config.mode` otherwise. plugins.push( new bundler.DefinePlugin({ - 'process.env.NODE_ENV': useRspack + 'process.env.NODE_ENV': rspack ? // FIXME: see also https://github.com/web-infra-dev/rspack/issues/5606 JSON.stringify(mode) : webpack.DefinePlugin.runtimeValue(({ module }) => { @@ -391,7 +388,7 @@ export async function createConfig( util: require.resolve('util/'), }, // FIXME: see also https://github.com/web-infra-dev/rspack/issues/3408 - ...(!useRspack && { + ...(!rspack && { plugins: [ new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), new ModuleScopePlugin( @@ -424,9 +421,8 @@ export async function createConfig( : {}), }, experiments: { - lazyCompilation: - !useRspack && yn(process.env.EXPERIMENTAL_LAZY_COMPILATION), - ...(useRspack && { + lazyCompilation: !rspack && yn(process.env.EXPERIMENTAL_LAZY_COMPILATION), + ...(rspack && { // We're still using `style-loader` for custom `insert` option css: false, }), diff --git a/packages/cli/src/lib/bundler/optimization.ts b/packages/cli/src/lib/bundler/optimization.ts index 4c569e5ccf..9f61043910 100644 --- a/packages/cli/src/lib/bundler/optimization.ts +++ b/packages/cli/src/lib/bundler/optimization.ts @@ -22,14 +22,10 @@ const { EsbuildPlugin } = require('esbuild-loader'); export const optimization = ( options: BundlingOptions, ): WebpackOptionsNormalized['optimization'] => { - const { isDev, useRspack } = options; + const { isDev, rspack } = options; - const rspack = useRspack - ? (require('@rspack/core') as typeof import('@rspack/core').rspack) - : undefined; - - const MinifyPlugin = useRspack - ? rspack!.SwcJsMinimizerRspackPlugin + const MinifyPlugin = rspack + ? rspack.SwcJsMinimizerRspackPlugin : EsbuildPlugin; return { @@ -46,7 +42,7 @@ export const optimization = ( format: undefined, include: 'remoteEntry.js', }), - useRspack && new rspack!.LightningCssMinimizerRspackPlugin(), + rspack && new rspack.LightningCssMinimizerRspackPlugin(), ], runtimeChunk: 'single', splitChunks: { @@ -78,7 +74,7 @@ export const optimization = ( priority: 10, minSize: 100000, minChunks: 1, - ...(!useRspack && { + ...(!rspack && { maxAsyncRequests: Infinity, maxInitialRequests: Infinity, }), diff --git a/packages/cli/src/lib/bundler/server.ts b/packages/cli/src/lib/bundler/server.ts index 25d3cbe321..ebde70ce66 100644 --- a/packages/cli/src/lib/bundler/server.ts +++ b/packages/cli/src/lib/bundler/server.ts @@ -106,7 +106,9 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be }, }); - const useRspack = !!process.env.EXPERIMENTAL_RSPACK; + const rspack = process.env.EXPERIMENTAL_RSPACK + ? (require('@rspack/core') as typeof import('@rspack/core').rspack) + : undefined; const commonConfigOptions = { ...options, @@ -114,7 +116,7 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be isDev: true, baseUrl: url, frontendConfig, - useRspack, + rspack, getFrontendAppConfigs: () => { return latestFrontendAppConfigs; }, @@ -166,8 +168,8 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be root: paths.targetPath, }); } else { - const bundler = useRspack ? require('@rspack/core') : webpack; - const DevServer: typeof WebpackDevServer = useRspack + const bundler = (rspack ?? webpack) as typeof webpack; + const DevServer: typeof WebpackDevServer = rspack ? require('@rspack/dev-server').RspackDevServer : WebpackDevServer; diff --git a/packages/cli/src/lib/bundler/transforms.ts b/packages/cli/src/lib/bundler/transforms.ts index a6a49895ef..8e2e1e1f66 100644 --- a/packages/cli/src/lib/bundler/transforms.ts +++ b/packages/cli/src/lib/bundler/transforms.ts @@ -26,14 +26,14 @@ type Transforms = { type TransformOptions = { isDev: boolean; isBackend?: boolean; - useRspack?: boolean; + rspack?: typeof import('@rspack/core').rspack; }; export const transforms = (options: TransformOptions): Transforms => { - const { isDev, isBackend, useRspack } = options; + const { isDev, isBackend, rspack } = options; - const CssExtractRspackPlugin: typeof MiniCssExtractPlugin = useRspack - ? require('@rspack/core').CssExtractRspackPlugin + const CssExtractRspackPlugin: typeof MiniCssExtractPlugin = rspack + ? (rspack.CssExtractRspackPlugin as unknown as typeof MiniCssExtractPlugin) : MiniCssExtractPlugin; // This ensures that styles inserted from the style-loader and any @@ -59,9 +59,7 @@ export const transforms = (options: TransformOptions): Transforms => { exclude: /node_modules/, use: [ { - loader: useRspack - ? 'builtin:swc-loader' - : require.resolve('swc-loader'), + loader: rspack ? 'builtin:swc-loader' : require.resolve('swc-loader'), options: { jsc: { target: 'es2022', @@ -89,9 +87,7 @@ export const transforms = (options: TransformOptions): Transforms => { exclude: /node_modules/, use: [ { - loader: useRspack - ? 'builtin:swc-loader' - : require.resolve('swc-loader'), + loader: rspack ? 'builtin:swc-loader' : require.resolve('swc-loader'), options: { jsc: { target: 'es2022', @@ -124,9 +120,7 @@ export const transforms = (options: TransformOptions): Transforms => { test: [/\.icon\.svg$/], use: [ { - loader: useRspack - ? 'builtin:swc-loader' - : require.resolve('swc-loader'), + loader: rspack ? 'builtin:swc-loader' : require.resolve('swc-loader'), options: { jsc: { target: 'es2022', diff --git a/packages/cli/src/lib/bundler/types.ts b/packages/cli/src/lib/bundler/types.ts index 8b48976f9b..d7ea69a1d4 100644 --- a/packages/cli/src/lib/bundler/types.ts +++ b/packages/cli/src/lib/bundler/types.ts @@ -37,7 +37,7 @@ export type BundlingOptions = { // Mode that the app is running in, 'protected' or 'public', default is 'public' appMode?: string; moduleFederation?: ModuleFederationOptions; - useRspack?: boolean; + rspack?: typeof import('@rspack/core').rspack; }; export type ServeOptions = BundlingPathsOptions & { @@ -58,7 +58,7 @@ export type BuildOptions = BundlingPathsOptions & { frontendAppConfigs: AppConfig[]; fullConfig: Config; moduleFederation?: ModuleFederationOptions; - useRspack?: boolean; + rspack?: typeof import('@rspack/core').rspack; }; export type BackendBundlingOptions = { @@ -68,7 +68,7 @@ export type BackendBundlingOptions = { inspectEnabled: boolean; inspectBrkEnabled: boolean; require?: string; - useRspack?: boolean; + rspack?: typeof import('@rspack/core').rspack; }; export type BackendServeOptions = BundlingPathsOptions & { From 1876909bca3d95125864b64ff9f383fe8cd7395a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 03:14:13 +0000 Subject: [PATCH 081/268] fix(deps): update dependency sass to v1.79.5 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- microsite/yarn.lock | 159 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 156 insertions(+), 3 deletions(-) diff --git a/microsite/yarn.lock b/microsite/yarn.lock index 13c7575934..36bc51b130 100644 --- a/microsite/yarn.lock +++ b/microsite/yarn.lock @@ -2461,6 +2461,140 @@ __metadata: languageName: node linkType: hard +"@parcel/watcher-android-arm64@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-android-arm64@npm:2.4.1" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@parcel/watcher-darwin-arm64@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-darwin-arm64@npm:2.4.1" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@parcel/watcher-darwin-x64@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-darwin-x64@npm:2.4.1" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@parcel/watcher-freebsd-x64@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-freebsd-x64@npm:2.4.1" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@parcel/watcher-linux-arm-glibc@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-linux-arm-glibc@npm:2.4.1" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@parcel/watcher-linux-arm64-glibc@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-linux-arm64-glibc@npm:2.4.1" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@parcel/watcher-linux-arm64-musl@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-linux-arm64-musl@npm:2.4.1" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@parcel/watcher-linux-x64-glibc@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-linux-x64-glibc@npm:2.4.1" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@parcel/watcher-linux-x64-musl@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-linux-x64-musl@npm:2.4.1" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@parcel/watcher-win32-arm64@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-win32-arm64@npm:2.4.1" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@parcel/watcher-win32-ia32@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-win32-ia32@npm:2.4.1" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@parcel/watcher-win32-x64@npm:2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher-win32-x64@npm:2.4.1" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@parcel/watcher@npm:^2.4.1": + version: 2.4.1 + resolution: "@parcel/watcher@npm:2.4.1" + dependencies: + "@parcel/watcher-android-arm64": 2.4.1 + "@parcel/watcher-darwin-arm64": 2.4.1 + "@parcel/watcher-darwin-x64": 2.4.1 + "@parcel/watcher-freebsd-x64": 2.4.1 + "@parcel/watcher-linux-arm-glibc": 2.4.1 + "@parcel/watcher-linux-arm64-glibc": 2.4.1 + "@parcel/watcher-linux-arm64-musl": 2.4.1 + "@parcel/watcher-linux-x64-glibc": 2.4.1 + "@parcel/watcher-linux-x64-musl": 2.4.1 + "@parcel/watcher-win32-arm64": 2.4.1 + "@parcel/watcher-win32-ia32": 2.4.1 + "@parcel/watcher-win32-x64": 2.4.1 + detect-libc: ^1.0.3 + is-glob: ^4.0.3 + micromatch: ^4.0.5 + node-addon-api: ^7.0.0 + node-gyp: latest + dependenciesMeta: + "@parcel/watcher-android-arm64": + optional: true + "@parcel/watcher-darwin-arm64": + optional: true + "@parcel/watcher-darwin-x64": + optional: true + "@parcel/watcher-freebsd-x64": + optional: true + "@parcel/watcher-linux-arm-glibc": + optional: true + "@parcel/watcher-linux-arm64-glibc": + optional: true + "@parcel/watcher-linux-arm64-musl": + optional: true + "@parcel/watcher-linux-x64-glibc": + optional: true + "@parcel/watcher-linux-x64-musl": + optional: true + "@parcel/watcher-win32-arm64": + optional: true + "@parcel/watcher-win32-ia32": + optional: true + "@parcel/watcher-win32-x64": + optional: true + checksum: 4da70551da27e565c726b0bbd5ba5afcb2bca36dfd8619a649f0eaa41f693ddd1d630c36e53bc083895d71a3e28bc4199013e557cd13c7af6ccccab28ceecbff + languageName: node + linkType: hard + "@pnpm/config.env-replace@npm:^1.1.0": version: 1.1.0 resolution: "@pnpm/config.env-replace@npm:1.1.0" @@ -5096,6 +5230,15 @@ __metadata: languageName: node linkType: hard +"detect-libc@npm:^1.0.3": + version: 1.0.3 + resolution: "detect-libc@npm:1.0.3" + bin: + detect-libc: ./bin/detect-libc.js + checksum: daaaed925ffa7889bd91d56e9624e6c8033911bb60f3a50a74a87500680652969dbaab9526d1e200a4c94acf80fc862a22131841145a0a8482d60a99c24f4a3e + languageName: node + linkType: hard + "detect-node@npm:^2.0.4": version: 2.1.0 resolution: "detect-node@npm:2.1.0" @@ -8716,6 +8859,15 @@ __metadata: languageName: node linkType: hard +"node-addon-api@npm:^7.0.0": + version: 7.1.1 + resolution: "node-addon-api@npm:7.1.1" + dependencies: + node-gyp: latest + checksum: 46051999e3289f205799dfaf6bcb017055d7569090f0004811110312e2db94cb4f8654602c7eb77a60a1a05142cc2b96e1b5c56ca4622c41a5c6370787faaf30 + languageName: node + linkType: hard + "node-emoji@npm:^2.1.0": version: 2.1.3 resolution: "node-emoji@npm:2.1.3" @@ -10524,15 +10676,16 @@ __metadata: linkType: hard "sass@npm:^1.57.1": - version: 1.79.1 - resolution: "sass@npm:1.79.1" + version: 1.79.5 + resolution: "sass@npm:1.79.5" dependencies: + "@parcel/watcher": ^2.4.1 chokidar: ^4.0.0 immutable: ^4.0.0 source-map-js: ">=0.6.2 <2.0.0" bin: sass: sass.js - checksum: df014f287055c750349b7461ed8477662c7f9c8999cc1b10eb9096ccd4a67f850511e8828ba8780515513741a932d01b1948bd33d40cdac1403a13b6718fa14c + checksum: 1c7fb299b58d9602732a122180a7fb4cedba5404b9c94f271e4b0338def56f475d30cd9588285afcf887d4f746d0da3217d51130dfa597ed66bf2fb5a8db41c1 languageName: node linkType: hard From b5b19eee634d8073d0c30517b17c156adf8db543 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 03:54:35 +0000 Subject: [PATCH 082/268] chore(deps): update actions/upload-artifact digest to b4b15b8 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/api-breaking-changes.yml | 2 +- .github/workflows/deploy_microsite.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/api-breaking-changes.yml b/.github/workflows/api-breaking-changes.yml index 1c2596bad6..7b98c9e5e0 100644 --- a/.github/workflows/api-breaking-changes.yml +++ b/.github/workflows/api-breaking-changes.yml @@ -46,7 +46,7 @@ jobs: cat ${{ github.event_path }} > event.json - name: Upload Artifacts - uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 with: name: preview-spec path: | diff --git a/.github/workflows/deploy_microsite.yml b/.github/workflows/deploy_microsite.yml index 7dad0d3b20..c3c0ad7286 100644 --- a/.github/workflows/deploy_microsite.yml +++ b/.github/workflows/deploy_microsite.yml @@ -73,7 +73,7 @@ jobs: run: yarn build:api-docs - name: upload API reference - uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 with: name: stable-reference path: docs/reference/ @@ -113,7 +113,7 @@ jobs: run: yarn build:api-docs - name: upload API reference - uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 with: name: next-reference path: docs/reference/ @@ -130,7 +130,7 @@ jobs: working-directory: storybook - name: storybook upload - uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 with: name: storybook path: storybook/dist/ From 40bfc240c706e53bdd7c68ae4453196c9d2b58e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 11 Oct 2024 09:48:21 +0200 Subject: [PATCH 083/268] fix report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- packages/test-utils/report.api.md | 2 -- .../test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index 15625adb21..38f4b5f69c 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -107,8 +107,6 @@ export namespace mockApis { // @public @deprecated export function mockBreakpoint(options: { matches: boolean }): void; -// Warning: (ae-unresolved-link) The @link reference could not be resolved: The reference is ambiguous because "config" has more than one declaration; you need to add a TSDoc member reference selector -// // @public @deprecated export class MockConfigApi implements ConfigApi { constructor(data: JsonObject); diff --git a/packages/test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts b/packages/test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts index 9d7462889c..3c5329962a 100644 --- a/packages/test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts +++ b/packages/test-utils/src/testUtils/apis/ConfigApi/MockConfigApi.ts @@ -23,7 +23,7 @@ import { ConfigApi } from '@backstage/core-plugin-api'; * that can be used to mock configuration using a plain object. * * @public - * @deprecated Use {@link mockApis.config} instead + * @deprecated Use {@link mockApis.(config:namespace)} instead * @example * ```tsx * const mockConfig = new MockConfigApi({ From 811ff0cddc2d5ad29051a8d3ca60cecbc6ad7874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 8 Oct 2024 17:51:14 +0200 Subject: [PATCH 084/268] implement analytics too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/thin-chairs-ring.md | 3 +- .../core-app-api/src/app/AppManager.test.tsx | 17 ++++---- .../src/routing/RouteTracker.test.tsx | 8 ++-- .../src/components/Link/Link.test.tsx | 24 ++++++------ .../src/layout/Sidebar/Items.test.tsx | 16 +++----- .../src/routing/RouteTracker.test.tsx | 1 + .../src/components/ExtensionBoundary.test.tsx | 32 +++++++-------- packages/test-utils/report.api.md | 21 ++++++++-- .../apis/AnalyticsApi/MockAnalyticsApi.ts | 1 + .../test-utils/src/testUtils/apis/mockApis.ts | 13 +++++++ .../CatalogGraphCard.test.tsx | 22 ++++++----- .../CatalogGraphPage.test.tsx | 36 +++++++++-------- .../src/hooks/useEntity.test.tsx | 28 +++++++------ .../components/Workflow/Workflow.test.tsx | 4 +- .../TemplateWizardPage.test.tsx | 39 ++++++++++++------- .../components/SearchBar/SearchBar.test.tsx | 6 +-- .../SearchResultGroup.test.tsx | 4 +- .../SearchResultList.test.tsx | 4 +- .../src/context/SearchContext.test.tsx | 8 +--- plugins/search-react/src/extensions.test.tsx | 8 ++-- .../src/ReportIssue/IssueLink.test.tsx | 20 +++++----- plugins/techdocs-react/src/context.test.tsx | 14 +++---- .../components/TechDocsNotFound.test.tsx | 20 +++++----- 23 files changed, 196 insertions(+), 153 deletions(-) diff --git a/.changeset/thin-chairs-ring.md b/.changeset/thin-chairs-ring.md index ebcb3afa93..df388a7365 100644 --- a/.changeset/thin-chairs-ring.md +++ b/.changeset/thin-chairs-ring.md @@ -5,4 +5,5 @@ Added a `mockApis` export, which will replace the `MockX` API implementation classes and their related types. This is analogous with the backend's `mockServices`. -Deprecated `MockConfigApi`, please use `mockApis.config` instead. +- Deprecated `MockAnalyticsApi`, please use `mockApis.analytics` instead. +- Deprecated `MockConfigApi`, please use `mockApis.config` instead. diff --git a/packages/core-app-api/src/app/AppManager.test.tsx b/packages/core-app-api/src/app/AppManager.test.tsx index 01277a09c7..1b7d2d28cb 100644 --- a/packages/core-app-api/src/app/AppManager.test.tsx +++ b/packages/core-app-api/src/app/AppManager.test.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import { LocalStorageFeatureFlags, NoOpAnalyticsApi } from '../apis'; +import { LocalStorageFeatureFlags } from '../apis'; import { - MockAnalyticsApi, + mockApis, renderWithEffects, withLogCollector, registerMswTestHooks, @@ -59,7 +59,7 @@ describe('Integration Test', () => { const noOpAnalyticsApi = createApiFactory( analyticsApiRef, - new NoOpAnalyticsApi(), + mockApis.analytics(), ); const noopErrorApi = createApiFactory(errorApiRef, { error$() { @@ -575,7 +575,7 @@ describe('Integration Test', () => { }); it('should track route changes via analytics api', async () => { - const mockAnalyticsApi = new MockAnalyticsApi(); + const mockAnalyticsApi = mockApis.analytics(); const apis = [createApiFactory(analyticsApiRef, mockAnalyticsApi)]; const app = new AppManager({ apis, @@ -608,26 +608,27 @@ describe('Integration Test', () => { ); // Capture initial and subsequent navigation events with expected context. - const capturedEvents = mockAnalyticsApi.getEvents(); - expect(capturedEvents[0]).toMatchObject({ + expect(mockAnalyticsApi.captureEvent).toHaveBeenCalledTimes(2); + expect(mockAnalyticsApi.captureEvent).toHaveBeenNthCalledWith(1, { action: 'navigate', subject: '/', + attributes: {}, context: { extension: 'App', pluginId: 'blob', routeRef: 'ref-1-2', }, }); - expect(capturedEvents[1]).toMatchObject({ + expect(mockAnalyticsApi.captureEvent).toHaveBeenNthCalledWith(2, { action: 'navigate', subject: '/foo', + attributes: {}, context: { extension: 'App', pluginId: 'plugin2', routeRef: 'ref-2', }, }); - expect(capturedEvents).toHaveLength(2); }); it('should throw some error when the route has duplicate params', async () => { diff --git a/packages/core-app-api/src/routing/RouteTracker.test.tsx b/packages/core-app-api/src/routing/RouteTracker.test.tsx index 25d5cfbcfb..ecbd44315d 100644 --- a/packages/core-app-api/src/routing/RouteTracker.test.tsx +++ b/packages/core-app-api/src/routing/RouteTracker.test.tsx @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { TestApiProvider } from '@backstage/test-utils'; + +import { TestApiProvider, mockApis } from '@backstage/test-utils'; import React from 'react'; import { BackstageRouteObject } from './types'; import { fireEvent, render } from '@testing-library/react'; import { RouteTracker } from './RouteTracker'; import { Link, MemoryRouter, Route, Routes } from 'react-router-dom'; import { - AnalyticsApi, analyticsApiRef, createPlugin, createRouteRef, @@ -68,9 +68,7 @@ describe('RouteTracker', () => { }, ]; - const mockedAnalytics: jest.Mocked = { - captureEvent: jest.fn(), - }; + const mockedAnalytics = mockApis.analytics(); beforeEach(() => { jest.clearAllMocks(); diff --git a/packages/core-components/src/components/Link/Link.test.tsx b/packages/core-components/src/components/Link/Link.test.tsx index fe616299c3..0a86c06d43 100644 --- a/packages/core-components/src/components/Link/Link.test.tsx +++ b/packages/core-components/src/components/Link/Link.test.tsx @@ -17,7 +17,7 @@ import React, { ComponentType } from 'react'; import { fireEvent, waitFor, screen, renderHook } from '@testing-library/react'; import { - MockAnalyticsApi, + mockApis, TestApiProvider, renderInTestApp, } from '@backstage/test-utils'; @@ -71,7 +71,7 @@ describe('', () => { it('captures click using analytics api', async () => { const linkText = 'Navigate!'; - const analyticsApi = new MockAnalyticsApi(); + const analyticsApi = mockApis.analytics(); const customOnClick = jest.fn(); await renderInTestApp( @@ -86,13 +86,15 @@ describe('', () => { // Analytics event should have been fired. await waitFor(() => { - expect(analyticsApi.getEvents()[0]).toMatchObject({ - action: 'click', - subject: linkText, - attributes: { - to: '/test', - }, - }); + expect(analyticsApi.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + action: 'click', + subject: linkText, + attributes: { + to: '/test', + }, + }), + ); // Custom onClick handler should have still been fired too. expect(customOnClick).toHaveBeenCalled(); @@ -101,7 +103,7 @@ describe('', () => { it('does not capture click when noTrack is set', async () => { const linkText = 'Navigate!'; - const analyticsApi = new MockAnalyticsApi(); + const analyticsApi = mockApis.analytics(); const customOnClick = jest.fn(); await renderInTestApp( @@ -120,7 +122,7 @@ describe('', () => { expect(customOnClick).toHaveBeenCalled(); // But there should be no analytics event. - expect(analyticsApi.getEvents()).toHaveLength(0); + expect(analyticsApi.captureEvent).not.toHaveBeenCalled(); }); }); diff --git a/packages/core-components/src/layout/Sidebar/Items.test.tsx b/packages/core-components/src/layout/Sidebar/Items.test.tsx index 6c959bfd0d..ee0f0ea401 100644 --- a/packages/core-components/src/layout/Sidebar/Items.test.tsx +++ b/packages/core-components/src/layout/Sidebar/Items.test.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { - MockAnalyticsApi, + mockApis, TestApiProvider, renderInTestApp, } from '@backstage/test-utils'; @@ -36,9 +36,8 @@ const useStyles = makeStyles({ }, }); -let analyticsApiMock: MockAnalyticsApi; - const handleSidebarItemClick = jest.fn(); +const analyticsApiMock = mockApis.analytics(); async function renderSidebar() { const { result } = renderHook(() => useStyles()); @@ -79,7 +78,6 @@ async function renderSidebar() { describe('Items', () => { beforeEach(async () => { jest.clearAllMocks(); - analyticsApiMock = new MockAnalyticsApi(); await renderSidebar(); }); @@ -107,8 +105,7 @@ describe('Items', () => { await screen.findByRole('button', { name: /create/i }), ); expect(handleSidebarItemClick).toHaveBeenCalledTimes(1); - expect(analyticsApiMock.getEvents()).toHaveLength(1); - expect(analyticsApiMock.getEvents()[0]).toMatchObject({ + expect(analyticsApiMock.captureEvent).toHaveBeenCalledWith({ action: 'click', subject: 'Create...', context: { routeRef: 'unknown', pluginId: 'root', extension: 'App' }, @@ -119,8 +116,7 @@ describe('Items', () => { it('should send link clicks to analytics', async () => { await userEvent.click(await screen.findByRole('link', { name: /docs/i })); expect(handleSidebarItemClick).toHaveBeenCalledTimes(1); - expect(analyticsApiMock.getEvents()).toHaveLength(1); - expect(analyticsApiMock.getEvents()[0]).toMatchObject({ + expect(analyticsApiMock.captureEvent).toHaveBeenCalledWith({ action: 'click', subject: 'Docs', context: { routeRef: 'unknown', pluginId: 'root', extension: 'App' }, @@ -132,10 +128,10 @@ describe('Items', () => { await userEvent.click( await screen.findByRole('link', { name: /explore/i }), ); - expect(handleSidebarItemClick).toHaveBeenCalledTimes(1); - expect(analyticsApiMock.getEvents()).toHaveLength(0); + expect(analyticsApiMock.captureEvent).not.toHaveBeenCalled(); }); }); + describe('SidebarSearchField', () => { it('should be defaultPrevented when enter is pressed', async () => { const searchEvent = createEvent.keyDown( diff --git a/packages/frontend-app-api/src/routing/RouteTracker.test.tsx b/packages/frontend-app-api/src/routing/RouteTracker.test.tsx index aeec03992f..372afea4c3 100644 --- a/packages/frontend-app-api/src/routing/RouteTracker.test.tsx +++ b/packages/frontend-app-api/src/routing/RouteTracker.test.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { TestApiProvider } from '@backstage/test-utils'; import React, { useEffect } from 'react'; import { BackstageRouteObject } from './types'; diff --git a/packages/frontend-plugin-api/src/components/ExtensionBoundary.test.tsx b/packages/frontend-plugin-api/src/components/ExtensionBoundary.test.tsx index 3e260f0c9b..14aaebb778 100644 --- a/packages/frontend-plugin-api/src/components/ExtensionBoundary.test.tsx +++ b/packages/frontend-plugin-api/src/components/ExtensionBoundary.test.tsx @@ -17,7 +17,7 @@ import React, { useEffect } from 'react'; import { act, screen, waitFor } from '@testing-library/react'; import { - MockAnalyticsApi, + mockApis, TestApiProvider, withLogCollector, } from '@backstage/test-utils'; @@ -93,7 +93,7 @@ describe('ExtensionBoundary', () => { it('should wrap children with analytics context', async () => { const action = 'render'; const subject = 'analytics'; - const analyticsApiMock = new MockAnalyticsApi(); + const analyticsApiMock = mockApis.analytics(); const AnalyticsComponent = () => { const analytics = useAnalytics(); @@ -112,17 +112,15 @@ describe('ExtensionBoundary', () => { ); await waitFor(() => { - const event = analyticsApiMock - .getEvents() - .find(e => e.subject === subject); - - expect(event).toMatchObject({ - action, - subject, - context: { - extensionId: 'test', - }, - }); + expect(analyticsApiMock.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + action, + subject, + context: expect.objectContaining({ + extensionId: 'test', + }), + }), + ); }); }); @@ -136,7 +134,7 @@ describe('ExtensionBoundary', () => { }); return null; }; - const analyticsApiMock = new MockAnalyticsApi(); + const analyticsApiMock = mockApis.analytics(); await act(async () => { renderInTestApp( @@ -147,7 +145,7 @@ describe('ExtensionBoundary', () => { ); }); - expect(analyticsApiMock.getEvents()).toEqual([ + expect(analyticsApiMock.captureEvent).toHaveBeenCalledWith( expect.objectContaining({ action: 'navigate', subject: '/', @@ -156,7 +154,9 @@ describe('ExtensionBoundary', () => { extensionId: 'test', }), }), + ); + expect(analyticsApiMock.captureEvent).toHaveBeenCalledWith( expect.objectContaining({ action: 'dummy' }), - ]); + ); }); }); diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index 38f4b5f69c..6e614321b6 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -81,7 +81,9 @@ export type LogCollector = AsyncLogCollector | SyncLogCollector; // @public export type LogFuncs = 'log' | 'warn' | 'error'; -// @public +// Warning: (ae-unresolved-link) The @link reference could not be resolved: The reference is ambiguous because "analytics" has more than one declaration; you need to add a TSDoc member reference selector +// +// @public @deprecated export class MockAnalyticsApi implements AnalyticsApi { // (undocumented) captureEvent(event: AnalyticsEvent): void; @@ -91,6 +93,15 @@ export class MockAnalyticsApi implements AnalyticsApi { // @public export namespace mockApis { + // (undocumented) + export function analytics(): jest.Mocked; + // (undocumented) + export namespace analytics { + const // (undocumented) + factory: () => ApiFactory; + const // (undocumented) + mock: () => jest.Mocked; + } export function config(options?: { data?: JsonObject }): ConfigApi; export namespace config { const factory: ( @@ -303,8 +314,8 @@ export function wrapInTestApp( // Warnings were encountered during analysis: // // src/deprecated.d.ts:5:1 - (ae-undocumented) Missing documentation for "setupRequestMockHandlers". -// src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.d.ts:10:5 - (ae-undocumented) Missing documentation for "captureEvent". -// src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.d.ts:11:5 - (ae-undocumented) Missing documentation for "getEvents". +// src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.d.ts:11:5 - (ae-undocumented) Missing documentation for "captureEvent". +// src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.d.ts:12:5 - (ae-undocumented) Missing documentation for "getEvents". // src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:28:5 - (ae-undocumented) Missing documentation for "post". // src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:29:5 - (ae-undocumented) Missing documentation for "error$". // src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:33:5 - (ae-undocumented) Missing documentation for "getErrors". @@ -316,4 +327,8 @@ export function wrapInTestApp( // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:22:5 - (ae-undocumented) Missing documentation for "set". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:23:5 - (ae-undocumented) Missing documentation for "remove". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:24:5 - (ae-undocumented) Missing documentation for "observe$". +// src/testUtils/apis/mockApis.d.ts:44:5 - (ae-undocumented) Missing documentation for "analytics". +// src/testUtils/apis/mockApis.d.ts:45:5 - (ae-undocumented) Missing documentation for "analytics". +// src/testUtils/apis/mockApis.d.ts:46:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:47:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/test-utils/src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.ts b/packages/test-utils/src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.ts index 6da225df1c..8c3ef4b326 100644 --- a/packages/test-utils/src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.ts +++ b/packages/test-utils/src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.ts @@ -21,6 +21,7 @@ import { AnalyticsApi, AnalyticsEvent } from '@backstage/core-plugin-api'; * Use getEvents in tests to verify captured events. * * @public + * @deprecated Use {@link mockApis.analytics} instead */ export class MockAnalyticsApi implements AnalyticsApi { private events: AnalyticsEvent[] = []; diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index eed5a88012..f0bd519eac 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -16,9 +16,11 @@ import { ConfigReader } from '@backstage/config'; import { + AnalyticsApi, ApiFactory, ApiRef, ConfigApi, + analyticsApiRef, configApiRef, createApiFactory, } from '@backstage/core-plugin-api'; @@ -103,6 +105,17 @@ function simpleMock( * ``` */ export namespace mockApis { + const analyticsMockSkeleton = (): jest.Mocked => ({ + captureEvent: jest.fn(), + }); + export function analytics() { + return analyticsMockSkeleton(); + } + export namespace analytics { + export const factory = simpleFactory(analyticsApiRef, analytics); + export const mock = analyticsMockSkeleton; + } + /** * Fake implementation of {@link @backstage/frontend-plugin-api#ConfigApi} * with optional data supplied. diff --git a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx index 916653f600..22eff03843 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx @@ -24,7 +24,7 @@ import { } from '@backstage/plugin-catalog-react'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { - MockAnalyticsApi, + mockApis, renderInTestApp, TestApiProvider, TestApiRegistry, @@ -212,9 +212,9 @@ describe('', () => { ], })); - const analyticsSpy = new MockAnalyticsApi(); + const analyticsApi = mockApis.analytics(); await renderInTestApp( - + {wrapper} , { @@ -228,12 +228,14 @@ describe('', () => { expect(await screen.findByText('b:d/c')).toBeInTheDocument(); await userEvent.click(await screen.findByText('b:d/c')); - expect(analyticsSpy.getEvents()[0]).toMatchObject({ - action: 'click', - subject: 'b:d/c', - attributes: { - to: '/entity/{kind}/{namespace}/{name}', - }, - }); + expect(analyticsApi.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + action: 'click', + subject: 'b:d/c', + attributes: { + to: '/entity/{kind}/{namespace}/{name}', + }, + }), + ); }); }); diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx index 9a081747ad..054986e595 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx @@ -23,7 +23,7 @@ import { analyticsApiRef } from '@backstage/core-plugin-api'; import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { - MockAnalyticsApi, + mockApis, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -227,9 +227,9 @@ describe.skip('', () => { }), ); - const analyticsSpy = new MockAnalyticsApi(); + const analyticsApi = mockApis.analytics(); await renderInTestApp( - + {wrapper} , { @@ -243,10 +243,12 @@ describe.skip('', () => { await userEvent.click(screen.getByText('b:d/e')); - expect(analyticsSpy.getEvents()[0]).toMatchObject({ - action: 'click', - subject: 'b:d/e', - }); + expect(analyticsApi.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + action: 'click', + subject: 'b:d/e', + }), + ); }); test('should capture analytics event when navigating to entity', async () => { @@ -256,9 +258,9 @@ describe.skip('', () => { }), ); - const analyticsSpy = new MockAnalyticsApi(); + const analyticsApi = mockApis.analytics(); await renderInTestApp( - + {wrapper} , { @@ -274,12 +276,14 @@ describe.skip('', () => { await user.keyboard('{Shift>}'); await user.click(screen.getByText('b:d/e')); - expect(analyticsSpy.getEvents()[0]).toMatchObject({ - action: 'click', - subject: 'b:d/e', - attributes: { - to: '/entity/b/d/e', - }, - }); + expect(analyticsApi.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + action: 'click', + subject: 'b:d/e', + attributes: { + to: '/entity/b/d/e', + }, + }), + ); }); }); diff --git a/plugins/catalog-react/src/hooks/useEntity.test.tsx b/plugins/catalog-react/src/hooks/useEntity.test.tsx index 2923ed828d..c0ad3c2111 100644 --- a/plugins/catalog-react/src/hooks/useEntity.test.tsx +++ b/plugins/catalog-react/src/hooks/useEntity.test.tsx @@ -25,7 +25,7 @@ import { import { Entity } from '@backstage/catalog-model'; import { analyticsApiRef, useAnalytics } from '@backstage/core-plugin-api'; import { - MockAnalyticsApi, + mockApis, TestApiRegistry, withLogCollector, } from '@backstage/test-utils'; @@ -57,7 +57,7 @@ describe('useEntity', () => { }); it('should provide entityRef analytics context', () => { - const analyticsSpy = new MockAnalyticsApi(); + const analyticsSpy = mockApis.analytics(); const apis = TestApiRegistry.from([analyticsApiRef, analyticsSpy]); const { result } = renderHook(() => useAnalytics(), { wrapper: ({ children }: React.PropsWithChildren<{}>) => ( @@ -69,9 +69,13 @@ describe('useEntity', () => { result.current.captureEvent('test', 'value'); - expect(analyticsSpy.getEvents()[0]).toMatchObject({ - context: { entityRef: 'mykind:default/my-entity' }, - }); + expect(analyticsSpy.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + context: expect.objectContaining({ + entityRef: 'mykind:default/my-entity', + }), + }), + ); }); }); @@ -127,7 +131,7 @@ describe('useAsyncEntity', () => { }); it('should provide entityRef analytics context', () => { - const analyticsSpy = new MockAnalyticsApi(); + const analyticsSpy = mockApis.analytics(); const apis = TestApiRegistry.from([analyticsApiRef, analyticsSpy]); const { result } = renderHook(() => useAnalytics(), { wrapper: ({ children }: React.PropsWithChildren<{}>) => ( @@ -144,13 +148,13 @@ describe('useAsyncEntity', () => { result.current.captureEvent('test', 'value'); - expect(analyticsSpy.getEvents()[0]).toMatchObject({ - context: { entityRef: 'mykind:default/my-entity' }, - }); + expect(analyticsSpy.captureEvent.mock.calls[0][0].context.entityRef).toBe( + 'mykind:default/my-entity', + ); }); it('should omit entityRef analytics context', () => { - const analyticsSpy = new MockAnalyticsApi(); + const analyticsSpy = mockApis.analytics(); const apis = TestApiRegistry.from([analyticsApiRef, analyticsSpy]); const { result } = renderHook(() => useAnalytics(), { wrapper: ({ children }: PropsWithChildren<{}>) => ( @@ -162,6 +166,8 @@ describe('useAsyncEntity', () => { result.current.captureEvent('test', 'value'); - expect(analyticsSpy.getEvents()[0].context).not.toHaveProperty('entityRef'); + expect( + analyticsSpy.captureEvent.mock.calls[0][0].context, + ).not.toHaveProperty('entityRef'); }); }); diff --git a/plugins/scaffolder-react/src/next/components/Workflow/Workflow.test.tsx b/plugins/scaffolder-react/src/next/components/Workflow/Workflow.test.tsx index 49f5c1feb0..243b9b7e79 100644 --- a/plugins/scaffolder-react/src/next/components/Workflow/Workflow.test.tsx +++ b/plugins/scaffolder-react/src/next/components/Workflow/Workflow.test.tsx @@ -16,7 +16,7 @@ import { ApiProvider } from '@backstage/core-app-api'; import { - MockAnalyticsApi, + mockApis, renderInTestApp, TestApiRegistry, } from '@backstage/test-utils'; @@ -42,7 +42,7 @@ const scaffolderApiMock: jest.Mocked = { const catalogApi = catalogApiMock.mock(); -const analyticsMock = new MockAnalyticsApi(); +const analyticsMock = mockApis.analytics(); const apis = TestApiRegistry.from( [scaffolderApiRef, scaffolderApiMock], [catalogApiRef, catalogApi], diff --git a/plugins/scaffolder/src/alpha/components/TemplateWizardPage/TemplateWizardPage.test.tsx b/plugins/scaffolder/src/alpha/components/TemplateWizardPage/TemplateWizardPage.test.tsx index 750efd70d0..18211d185a 100644 --- a/plugins/scaffolder/src/alpha/components/TemplateWizardPage/TemplateWizardPage.test.tsx +++ b/plugins/scaffolder/src/alpha/components/TemplateWizardPage/TemplateWizardPage.test.tsx @@ -17,7 +17,7 @@ import { ApiProvider } from '@backstage/core-app-api'; import { analyticsApiRef } from '@backstage/core-plugin-api'; import { - MockAnalyticsApi, + mockApis, renderInTestApp, TestApiRegistry, } from '@backstage/test-utils'; @@ -56,12 +56,12 @@ const scaffolderApiMock: jest.Mocked = { }; const catalogApi = catalogApiMock.mock(); +const analyticsApi = mockApis.analytics(); -const analyticsMock = new MockAnalyticsApi(); const apis = TestApiRegistry.from( [scaffolderApiRef, scaffolderApiMock], [catalogApiRef, catalogApi], - [analyticsApiRef, analyticsMock], + [analyticsApiRef, analyticsApi], [catalogApiRef, catalogApi], ); @@ -81,6 +81,7 @@ const entityRefResponse = { }, }, }; + describe('TemplateWizardPage', () => { it('captures expected analytics events', async () => { scaffolderApiMock.scaffold.mockResolvedValue({ taskId: 'xyz' }); @@ -130,20 +131,29 @@ describe('TemplateWizardPage', () => { }); // The "Next Step" button should have fired an event - expect(analyticsMock.getEvents()[0]).toMatchObject({ - action: 'click', - subject: 'Next Step (1)', - context: { entityRef: 'template:default/test' }, - }); + expect(analyticsApi.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + action: 'click', + subject: 'Next Step (1)', + context: expect.objectContaining({ + entityRef: 'template:default/test', + }), + }), + ); // And the "Create" button should have fired an event - expect(analyticsMock.getEvents()[1]).toMatchObject({ - action: 'create', - subject: 'expected-name', - context: { entityRef: 'template:default/test' }, - value: 120, - }); + expect(analyticsApi.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + action: 'create', + subject: 'expected-name', + context: expect.objectContaining({ + entityRef: 'template:default/test', + }), + value: 120, + }), + ); }); + describe('scaffolder page context menu', () => { it('should render if editUrl is set to url', async () => { catalogApi.getEntityByRef.mockResolvedValue({ @@ -175,6 +185,7 @@ describe('TemplateWizardPage', () => { ); expect(queryByTestId('menu-button')).toBeInTheDocument(); }); + it('should not render if editUrl is undefined', async () => { catalogApi.getEntityByRef.mockResolvedValue({ apiVersion: 'v1', diff --git a/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx b/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx index 3f667a4ad6..0e4df4fb34 100644 --- a/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx +++ b/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx @@ -20,7 +20,7 @@ import userEvent from '@testing-library/user-event'; import { configApiRef } from '@backstage/core-plugin-api'; import { ConfigReader } from '@backstage/core-app-api'; import { - MockAnalyticsApi, + mockApis, TestApiProvider, renderInTestApp, } from '@backstage/test-utils'; @@ -273,7 +273,7 @@ describe('SearchBar', () => { }); it('Does not capture analytics event if not enabled in app', async () => { - const analyticsApiMock = new MockAnalyticsApi(); + const analyticsApiMock = mockApis.analytics(); await renderInTestApp( { await waitFor(() => expect(textbox).toHaveValue(value)); - expect(analyticsApiMock.getEvents()).toHaveLength(0); + expect(analyticsApiMock.captureEvent).not.toHaveBeenCalled(); }); it('Renders custom search icon', async () => { diff --git a/plugins/search-react/src/components/SearchResultGroup/SearchResultGroup.test.tsx b/plugins/search-react/src/components/SearchResultGroup/SearchResultGroup.test.tsx index 66513783d4..fe1e279dd3 100644 --- a/plugins/search-react/src/components/SearchResultGroup/SearchResultGroup.test.tsx +++ b/plugins/search-react/src/components/SearchResultGroup/SearchResultGroup.test.tsx @@ -24,7 +24,7 @@ import DocsIcon from '@material-ui/icons/InsertDriveFile'; import { renderInTestApp, TestApiProvider, - MockAnalyticsApi, + mockApis, } from '@backstage/test-utils'; import { createPlugin, analyticsApiRef } from '@backstage/core-plugin-api'; @@ -40,7 +40,7 @@ import { const query = jest.fn().mockResolvedValue({ results: [] }); const searchApiMock = { query }; -const analyticsApiMock = new MockAnalyticsApi(); +const analyticsApiMock = mockApis.analytics(); describe('SearchResultGroup', () => { const results = [ diff --git a/plugins/search-react/src/components/SearchResultList/SearchResultList.test.tsx b/plugins/search-react/src/components/SearchResultList/SearchResultList.test.tsx index 146e5822a4..86ce237135 100644 --- a/plugins/search-react/src/components/SearchResultList/SearchResultList.test.tsx +++ b/plugins/search-react/src/components/SearchResultList/SearchResultList.test.tsx @@ -20,7 +20,7 @@ import { screen, waitFor } from '@testing-library/react'; import { TestApiProvider, renderInTestApp, - MockAnalyticsApi, + mockApis, } from '@backstage/test-utils'; import { analyticsApiRef, createPlugin } from '@backstage/core-plugin-api'; @@ -31,7 +31,7 @@ import { SearchResultList } from './SearchResultList'; const query = jest.fn().mockResolvedValue({ results: [] }); const searchApiMock = { query }; -const analyticsApiMock = new MockAnalyticsApi(); +const analyticsApiMock = mockApis.analytics(); describe('SearchResultList', () => { const results = [ diff --git a/plugins/search-react/src/context/SearchContext.test.tsx b/plugins/search-react/src/context/SearchContext.test.tsx index 2cb83e5ab6..f858715adb 100644 --- a/plugins/search-react/src/context/SearchContext.test.tsx +++ b/plugins/search-react/src/context/SearchContext.test.tsx @@ -422,9 +422,7 @@ describe('SearchContext', () => { describe('analytics', () => { it('captures analytics events if enabled in app', async () => { - const analyticsApiMock = { - captureEvent: jest.fn(), - } satisfies typeof analyticsApiRef.T; + const analyticsApiMock = mockApis.analytics(); searchApiMock.query.mockResolvedValue({ results: [], @@ -481,9 +479,7 @@ describe('SearchContext', () => { }); it('captures analytics events even if number of results does not exist', async () => { - const analyticsApiMock = { - captureEvent: jest.fn(), - } satisfies typeof analyticsApiRef.T; + const analyticsApiMock = mockApis.analytics(); searchApiMock.query.mockResolvedValue({ results: [], diff --git a/plugins/search-react/src/extensions.test.tsx b/plugins/search-react/src/extensions.test.tsx index 170dca2b6d..8305f951ef 100644 --- a/plugins/search-react/src/extensions.test.tsx +++ b/plugins/search-react/src/extensions.test.tsx @@ -23,7 +23,7 @@ import ListItemText from '@material-ui/core/ListItemText'; import { renderInTestApp, TestApiProvider, - MockAnalyticsApi, + mockApis, } from '@backstage/test-utils'; import { createPlugin, @@ -38,7 +38,7 @@ import { SearchResultListItemExtensionOptions, } from './extensions'; -const analyticsApiMock = new MockAnalyticsApi(); +const analyticsApiMock = mockApis.analytics(); const results = [ { @@ -118,7 +118,7 @@ describe('extensions', () => { screen.getByRole('link', { name: /Search Result 1/ }), ); - expect(analyticsApiMock.getEvents()[0]).toMatchObject({ + expect(analyticsApiMock.captureEvent).toHaveBeenCalledWith({ action: 'discover', subject: 'Search Result 1', context: { routeRef: 'unknown', pluginId: 'root', extension: 'App' }, @@ -141,7 +141,7 @@ describe('extensions', () => { await userEvent.click(screen.getByRole('listitem')); - expect(analyticsApiMock.getEvents()[0]).toMatchObject({ + expect(analyticsApiMock.captureEvent).toHaveBeenCalledWith({ action: 'discover', subject: 'Search Result 1', context: { routeRef: 'unknown', pluginId: 'root', extension: 'App' }, diff --git a/plugins/techdocs-module-addons-contrib/src/ReportIssue/IssueLink.test.tsx b/plugins/techdocs-module-addons-contrib/src/ReportIssue/IssueLink.test.tsx index 85ffaa5782..2bc770cc31 100644 --- a/plugins/techdocs-module-addons-contrib/src/ReportIssue/IssueLink.test.tsx +++ b/plugins/techdocs-module-addons-contrib/src/ReportIssue/IssueLink.test.tsx @@ -19,7 +19,7 @@ import { screen, fireEvent, waitFor } from '@testing-library/react'; import { analyticsApiRef } from '@backstage/core-plugin-api'; import { - MockAnalyticsApi, + mockApis, TestApiProvider, renderInTestApp, } from '@backstage/test-utils'; @@ -55,11 +55,11 @@ const defaultGitlabProps = { }; describe('FeedbackLink', () => { - const apiSpy = new MockAnalyticsApi(); + const analytics = mockApis.analytics(); it('Should open new Github issue tab', async () => { await renderInTestApp( - + , ); @@ -77,7 +77,7 @@ describe('FeedbackLink', () => { it('Should open new Gitlab issue tab', async () => { await renderInTestApp( - + , ); @@ -95,7 +95,7 @@ describe('FeedbackLink', () => { it('Should track click events', async () => { await renderInTestApp( - + , ); @@ -103,10 +103,12 @@ describe('FeedbackLink', () => { fireEvent.click(screen.getByText(/Open new Github issue/)); await waitFor(() => { - expect(apiSpy.getEvents()[0]).toMatchObject({ - action: 'click', - subject: 'Open new Github issue', - }); + expect(analytics.captureEvent).toHaveBeenCalledWith( + expect.objectContaining({ + action: 'click', + subject: 'Open new Github issue', + }), + ); }); }); }); diff --git a/plugins/techdocs-react/src/context.test.tsx b/plugins/techdocs-react/src/context.test.tsx index 6c947b6858..6605d9ceaf 100644 --- a/plugins/techdocs-react/src/context.test.tsx +++ b/plugins/techdocs-react/src/context.test.tsx @@ -20,11 +20,7 @@ import { renderHook, act, waitFor } from '@testing-library/react'; import { ThemeProvider } from '@material-ui/core/styles'; import { lightTheme } from '@backstage/theme'; -import { - MockAnalyticsApi, - mockApis, - TestApiProvider, -} from '@backstage/test-utils'; +import { mockApis, TestApiProvider } from '@backstage/test-utils'; import { Entity, CompoundEntityRef } from '@backstage/catalog-model'; import { analyticsApiRef, @@ -66,7 +62,7 @@ const techdocsApiMock = { getTechDocsMetadata: jest.fn().mockResolvedValue(mockTechDocsMetadata), }; -const analyticsApiMock = new MockAnalyticsApi(); +const analyticsApiMock = mockApis.analytics(); const wrapper = ({ entityRef = { @@ -170,12 +166,12 @@ describe('useTechDocsReaderPage', () => { wrapper, }); await waitFor(() => { - expect(analyticsApiMock.getEvents()[0]).toMatchObject({ + expect(analyticsApiMock.captureEvent).toHaveBeenCalledWith({ action: 'action', subject: 'subject', - context: { + context: expect.objectContaining({ entityRef: 'component:default/test', - }, + }), }); }); }); diff --git a/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx b/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx index 59c388df69..84c7275228 100644 --- a/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx @@ -16,12 +16,11 @@ import { TechDocsNotFound } from './TechDocsNotFound'; import React from 'react'; -import { render, screen, waitFor } from '@testing-library/react'; +import { screen, waitFor } from '@testing-library/react'; import { - MockAnalyticsApi, + mockApis, TestApiProvider, renderInTestApp, - wrapInTestApp, } from '@backstage/test-utils'; import { analyticsApiRef } from '@backstage/core-plugin-api'; @@ -58,18 +57,16 @@ describe('', () => { }); it('should trigger analytics event not-found', async () => { - const mockAnalyticsApi = new MockAnalyticsApi(); + const mockAnalyticsApi = mockApis.analytics(); - render( - wrapInTestApp( - - - , - ), + await renderInTestApp( + + + , ); await waitFor(() => { - expect(mockAnalyticsApi.getEvents()[0]).toMatchObject({ + expect(mockAnalyticsApi.captureEvent).toHaveBeenCalledWith({ action: 'not-found', subject: '/the/pathname?the=search#the-anchor', attributes: { @@ -77,6 +74,7 @@ describe('', () => { namespace: 'namespace', kind: 'kind', }, + context: expect.anything(), }); }); }); From b52715bc2e4122a229b5fb4faa450354bbf124ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 8 Oct 2024 22:49:42 +0200 Subject: [PATCH 085/268] implement identity too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- ...dentityAuthInjectorFetchMiddleware.test.ts | 17 +-- .../core-app-api/src/app/AppRouter.test.tsx | 11 +- .../components/AutoLogout/Autologout.test.tsx | 14 +- .../src/createPublicSignInApp.test.tsx | 7 +- packages/test-utils/report.api.md | 37 +++++- .../src/testUtils/apis/mockApis.test.tsx | 124 +++++++++++++++++- .../test-utils/src/testUtils/apis/mockApis.ts | 48 ++++++- .../CookieAuthRedirect.test.tsx | 8 +- .../UserListPicker/UserListPicker.test.tsx | 19 +-- .../useOwnedEntitiesCount.test.tsx | 45 +++---- .../src/hooks/useEntityListProvider.test.tsx | 24 ++-- .../src/hooks/useEntityOwnership.test.tsx | 21 +-- .../CatalogPage/DefaultCatalogPage.test.tsx | 23 +--- plugins/home/src/api/VisitsStorageApi.test.ts | 15 +-- .../home/src/api/VisitsWebStorageApi.test.ts | 14 +- .../MyGroupsSidebarItem.test.tsx | 63 ++++----- .../ListTasksPage/ListTaskPage.test.tsx | 13 +- .../columns/OwnerEntityColumn.test.tsx | 14 +- .../MyGroupsPicker/MyGroupsPicker.test.tsx | 31 ++--- plugins/signals/src/api/SignalsClient.test.ts | 11 +- plugins/techdocs/src/client.test.ts | 5 +- .../StorageApi/UserSettingsStorage.test.ts | 22 ++-- .../DefaultSettingsPage.test.tsx | 13 +- .../General/UserSettingsIdentityCard.test.tsx | 26 ++-- .../General/UserSettingsMenu.test.tsx | 7 +- .../General/UserSettingsProfileCard.test.tsx | 33 ++--- .../SettingsPage/SettingsPage.test.tsx | 19 +-- 27 files changed, 396 insertions(+), 288 deletions(-) diff --git a/packages/core-app-api/src/apis/implementations/FetchApi/IdentityAuthInjectorFetchMiddleware.test.ts b/packages/core-app-api/src/apis/implementations/FetchApi/IdentityAuthInjectorFetchMiddleware.test.ts index 1e29f2548a..f1daced2a1 100644 --- a/packages/core-app-api/src/apis/implementations/FetchApi/IdentityAuthInjectorFetchMiddleware.test.ts +++ b/packages/core-app-api/src/apis/implementations/FetchApi/IdentityAuthInjectorFetchMiddleware.test.ts @@ -15,8 +15,8 @@ */ import { ConfigReader } from '@backstage/config'; -import { IdentityApi } from '@backstage/core-plugin-api'; import { IdentityAuthInjectorFetchMiddleware } from './IdentityAuthInjectorFetchMiddleware'; +import { mockApis } from '@backstage/test-utils'; describe('IdentityAuthInjectorFetchMiddleware', () => { it('creates using defaults', async () => { @@ -58,10 +58,7 @@ describe('IdentityAuthInjectorFetchMiddleware', () => { }); it('injects the header only when a token is available', async () => { - const tokenFunction = jest.fn(); - const identityApi = { - getCredentials: tokenFunction, - } as unknown as IdentityApi; + const identityApi = mockApis.identity(); const middleware = new IdentityAuthInjectorFetchMiddleware( identityApi, @@ -73,27 +70,25 @@ describe('IdentityAuthInjectorFetchMiddleware', () => { const outer = middleware.apply(inner); // No token available - tokenFunction.mockResolvedValueOnce({ token: undefined }); + identityApi.getCredentials.mockResolvedValueOnce({ token: undefined }); await outer(new Request('https://example.com')); expect([...inner.mock.calls[0][0].headers.entries()]).toEqual([]); // Supply a token, header gets added - tokenFunction.mockResolvedValueOnce({ token: 'token' }); + identityApi.getCredentials.mockResolvedValueOnce({ token: 'token' }); await outer(new Request('https://example.com')); expect([...inner.mock.calls[1][0].headers.entries()]).toEqual([ ['authorization', 'Bearer token'], ]); // Token no longer available - tokenFunction.mockResolvedValueOnce({ token: undefined }); + identityApi.getCredentials.mockResolvedValueOnce({ token: undefined }); await outer(new Request('https://example.com')); expect([...inner.mock.calls[2][0].headers.entries()]).toEqual([]); }); it('does not overwrite an existing header with the same name', async () => { - const identityApi = { - getCredentials: () => ({ token: 'token' }), - } as unknown as IdentityApi; + const identityApi = mockApis.identity({ token: 'token' }); const middleware = new IdentityAuthInjectorFetchMiddleware( identityApi, diff --git a/packages/core-app-api/src/app/AppRouter.test.tsx b/packages/core-app-api/src/app/AppRouter.test.tsx index 9f3ab2ad89..b595f91794 100644 --- a/packages/core-app-api/src/app/AppRouter.test.tsx +++ b/packages/core-app-api/src/app/AppRouter.test.tsx @@ -18,7 +18,6 @@ import React from 'react'; import { AppComponents, configApiRef, - IdentityApi, identityApiRef, SignInPageProps, useApi, @@ -30,7 +29,7 @@ import { render, screen } from '@testing-library/react'; import { AppRouter } from './AppRouter'; import useAsync from 'react-use/esm/useAsync'; import { AppContextProvider } from './AppContext'; -import { TestApiProvider } from '@backstage/test-utils'; +import { mockApis, TestApiProvider } from '@backstage/test-utils'; import { ConfigReader } from '@backstage/config'; function UserRefDisplay() { @@ -78,13 +77,7 @@ describe('AppRouter', () => { const appIdentityProxy = new AppIdentityProxy(); const SignInPage = (props: SignInPageProps) => { - props.onSignInSuccess({ - getBackstageIdentity: async () => ({ - type: 'user', - userEntityRef: 'user:default/test', - ownershipEntityRefs: ['user:default/test'], - }), - } as IdentityApi); + props.onSignInSuccess(mockApis.identity()); return null; }; diff --git a/packages/core-components/src/components/AutoLogout/Autologout.test.tsx b/packages/core-components/src/components/AutoLogout/Autologout.test.tsx index 164ad716d2..5a555cd215 100644 --- a/packages/core-components/src/components/AutoLogout/Autologout.test.tsx +++ b/packages/core-components/src/components/AutoLogout/Autologout.test.tsx @@ -13,23 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { createMocks } from 'react-idle-timer'; // eslint-disable-next-line no-restricted-imports import { MessageChannel } from 'worker_threads'; import { ApiProvider } from '@backstage/core-app-api'; import { identityApiRef } from '@backstage/core-plugin-api'; -import { TestApiRegistry, renderInTestApp } from '@backstage/test-utils'; +import { + TestApiRegistry, + renderInTestApp, + mockApis, +} from '@backstage/test-utils'; import React from 'react'; import { AutoLogout } from './AutoLogout'; import { cleanup } from '@testing-library/react'; -// Mock the signOut function of identityApiRef -const mockSignOut = jest.fn(); -const mockIdentityApi = { - signOut: mockSignOut, - getCredentials: jest.fn().mockReturnValue({ token: 'xxx' }), -}; +const mockIdentityApi = mockApis.identity({ token: 'xxx' }); const apis = TestApiRegistry.from([identityApiRef, mockIdentityApi]); describe('AutoLogout', () => { diff --git a/packages/frontend-defaults/src/createPublicSignInApp.test.tsx b/packages/frontend-defaults/src/createPublicSignInApp.test.tsx index ce0f8c4b2a..560abc602f 100644 --- a/packages/frontend-defaults/src/createPublicSignInApp.test.tsx +++ b/packages/frontend-defaults/src/createPublicSignInApp.test.tsx @@ -15,7 +15,6 @@ */ import { - IdentityApi, SignInPageBlueprint, createFrontendModule, } from '@backstage/frontend-plugin-api'; @@ -70,9 +69,9 @@ describe('createPublicSignInApp', () => { async () => ({ onSignInSuccess }) => { useEffect(() => { - onSignInSuccess({ - getCredentials: async () => ({ token: 'mock-token' }), - } as IdentityApi); + onSignInSuccess( + mockApis.identity({ token: 'mock-token' }), + ); }, [onSignInSuccess]); return
; }, diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index 6e614321b6..f570aacde4 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -100,7 +100,9 @@ export namespace mockApis { const // (undocumented) factory: () => ApiFactory; const // (undocumented) - mock: () => jest.Mocked; + mock: ( + partialImpl?: Partial | undefined, + ) => ApiMock; } export function config(options?: { data?: JsonObject }): ConfigApi; export namespace config { @@ -113,6 +115,35 @@ export namespace mockApis { ) => ApiFactory; const mock: (partialImpl?: Partial | undefined) => ApiMock; } + // (undocumented) + export function identity(options?: { + userEntityRef?: string; + ownershipEntityRefs?: string[]; + token?: string; + email?: string; + displayName?: string; + picture?: string; + }): jest.Mocked; + // (undocumented) + export namespace identity { + const // (undocumented) + factory: ( + options?: + | { + userEntityRef?: string | undefined; + ownershipEntityRefs?: string[] | undefined; + token?: string | undefined; + email?: string | undefined; + displayName?: string | undefined; + picture?: string | undefined; + } + | undefined, + ) => ApiFactory; + const // (undocumented) + mock: ( + partialImpl?: Partial | undefined, + ) => ApiMock; + } } // @public @deprecated @@ -331,4 +362,8 @@ export function wrapInTestApp( // src/testUtils/apis/mockApis.d.ts:45:5 - (ae-undocumented) Missing documentation for "analytics". // src/testUtils/apis/mockApis.d.ts:46:15 - (ae-undocumented) Missing documentation for "factory". // src/testUtils/apis/mockApis.d.ts:47:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:98:5 - (ae-undocumented) Missing documentation for "identity". +// src/testUtils/apis/mockApis.d.ts:106:5 - (ae-undocumented) Missing documentation for "identity". +// src/testUtils/apis/mockApis.d.ts:107:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:115:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx index ebbdb41884..f9286897b4 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx +++ b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx @@ -17,13 +17,49 @@ import { mockApis } from './mockApis'; describe('mockApis', () => { + describe('analytics', () => { + it('can create an instance and make assertions on it', () => { + const analytics = mockApis.analytics(); + expect( + analytics.captureEvent({ + action: 'a', + subject: 'b', + context: { pluginId: 'c', extension: 'd', routeRef: 'e' }, + }), + ).toBeUndefined(); + expect(analytics.captureEvent).toHaveBeenCalledTimes(1); + }); + + it('can create a mock and make assertions on it', async () => { + expect.assertions(3); + const analytics = mockApis.analytics.mock({ + captureEvent: event => { + expect(event).toEqual({ + action: 'a', + subject: 'b', + context: { pluginId: 'c', extension: 'd', routeRef: 'e' }, + }); + }, + }); + expect( + analytics.captureEvent({ + action: 'a', + subject: 'b', + context: { pluginId: 'c', extension: 'd', routeRef: 'e' }, + }), + ).toBeUndefined(); + expect(analytics.captureEvent).toHaveBeenCalledTimes(1); + }); + }); + describe('config', () => { const data = { backend: { baseUrl: 'http://test.com' } }; it('can create an instance', () => { const empty = mockApis.config(); - const notEmpty = mockApis.config({ data }); expect(empty.getOptional('backend.baseUrl')).toBeUndefined(); + + const notEmpty = mockApis.config({ data }); expect(notEmpty.getOptional('backend.baseUrl')).toEqual( 'http://test.com', ); @@ -35,4 +71,90 @@ describe('mockApis', () => { expect(mock.getString).toHaveBeenCalledTimes(1); }); }); + + describe('identity', () => { + it('can create an instance and make assertions on it', async () => { + const empty = mockApis.identity(); + await expect(empty.getBackstageIdentity()).resolves.toEqual({ + type: 'user', + userEntityRef: 'user:default/test', + ownershipEntityRefs: ['user:default/test'], + }); + await expect(empty.getCredentials()).resolves.toEqual({}); + await expect(empty.getProfileInfo()).resolves.toEqual({}); + await expect(empty.signOut()).resolves.toBeUndefined(); + expect(empty.getBackstageIdentity).toHaveBeenCalledTimes(1); + expect(empty.getCredentials).toHaveBeenCalledTimes(1); + expect(empty.getProfileInfo).toHaveBeenCalledTimes(1); + expect(empty.signOut).toHaveBeenCalledTimes(1); + + const notEmpty = mockApis.identity({ + userEntityRef: 'a', + ownershipEntityRefs: ['b'], + token: 'c', + email: 'd', + displayName: 'e', + picture: 'f', + }); + await expect(notEmpty.getBackstageIdentity()).resolves.toEqual({ + type: 'user', + userEntityRef: 'a', + ownershipEntityRefs: ['b'], + }); + await expect(notEmpty.getCredentials()).resolves.toEqual({ token: 'c' }); + await expect(notEmpty.getProfileInfo()).resolves.toEqual({ + email: 'd', + displayName: 'e', + picture: 'f', + }); + await expect(notEmpty.signOut()).resolves.toBeUndefined(); + expect(notEmpty.getBackstageIdentity).toHaveBeenCalledTimes(1); + expect(notEmpty.getCredentials).toHaveBeenCalledTimes(1); + expect(notEmpty.getProfileInfo).toHaveBeenCalledTimes(1); + expect(notEmpty.signOut).toHaveBeenCalledTimes(1); + }); + + it('can create a mock and make assertions on it', async () => { + const empty = mockApis.identity.mock(); + expect(empty.getBackstageIdentity()).toBeUndefined(); + expect(empty.getCredentials()).toBeUndefined(); + expect(empty.getProfileInfo()).toBeUndefined(); + expect(empty.signOut()).toBeUndefined(); + expect(empty.getBackstageIdentity).toHaveBeenCalledTimes(1); + expect(empty.getCredentials).toHaveBeenCalledTimes(1); + expect(empty.getProfileInfo).toHaveBeenCalledTimes(1); + expect(empty.signOut).toHaveBeenCalledTimes(1); + + const notEmpty = mockApis.identity.mock({ + getBackstageIdentity: async () => ({ + type: 'user', + userEntityRef: 'a', + ownershipEntityRefs: ['b'], + }), + getCredentials: async () => ({ token: 'c' }), + getProfileInfo: async () => ({ + email: 'd', + displayName: 'e', + picture: 'f', + }), + signOut: async () => undefined, + }); + await expect(notEmpty.getBackstageIdentity()).resolves.toEqual({ + type: 'user', + userEntityRef: 'a', + ownershipEntityRefs: ['b'], + }); + await expect(notEmpty.getCredentials()).resolves.toEqual({ token: 'c' }); + await expect(notEmpty.getProfileInfo()).resolves.toEqual({ + email: 'd', + displayName: 'e', + picture: 'f', + }); + await expect(notEmpty.signOut()).resolves.toBeUndefined(); + expect(notEmpty.getBackstageIdentity).toHaveBeenCalledTimes(1); + expect(notEmpty.getCredentials).toHaveBeenCalledTimes(1); + expect(notEmpty.getProfileInfo).toHaveBeenCalledTimes(1); + expect(notEmpty.signOut).toHaveBeenCalledTimes(1); + }); + }); }); diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index f0bd519eac..e47ee4ec3e 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -20,9 +20,11 @@ import { ApiFactory, ApiRef, ConfigApi, + IdentityApi, analyticsApiRef, configApiRef, createApiFactory, + identityApiRef, } from '@backstage/core-plugin-api'; import { JsonObject } from '@backstage/types'; import { ApiMock } from './ApiMock'; @@ -113,7 +115,7 @@ export namespace mockApis { } export namespace analytics { export const factory = simpleFactory(analyticsApiRef, analytics); - export const mock = analyticsMockSkeleton; + export const mock = simpleMock(analyticsApiRef, analyticsMockSkeleton); } /** @@ -180,4 +182,48 @@ export namespace mockApis { getOptionalStringArray: jest.fn(), })); } + + const identityMockSkeleton = (): jest.Mocked => ({ + getBackstageIdentity: jest.fn(), + getCredentials: jest.fn(), + getProfileInfo: jest.fn(), + signOut: jest.fn(), + }); + export function identity(options?: { + userEntityRef?: string; + ownershipEntityRefs?: string[]; + token?: string; + email?: string; + displayName?: string; + picture?: string; + }) { + const { + userEntityRef = 'user:default/test', + ownershipEntityRefs = ['user:default/test'], + token, + email, + displayName, + picture, + } = options ?? {}; + return simpleInstance( + identityApiRef, + { + async getBackstageIdentity() { + return { type: 'user', ownershipEntityRefs, userEntityRef }; + }, + async getCredentials() { + return { token }; + }, + async getProfileInfo() { + return { email, displayName, picture }; + }, + async signOut() {}, + }, + identityMockSkeleton, + ); + } + export namespace identity { + export const factory = simpleFactory(identityApiRef, identity); + export const mock = simpleMock(identityApiRef, identityMockSkeleton); + } } diff --git a/plugins/auth-react/src/components/CookieAuthRedirect/CookieAuthRedirect.test.tsx b/plugins/auth-react/src/components/CookieAuthRedirect/CookieAuthRedirect.test.tsx index 6c0141a9d1..18c6408407 100644 --- a/plugins/auth-react/src/components/CookieAuthRedirect/CookieAuthRedirect.test.tsx +++ b/plugins/auth-react/src/components/CookieAuthRedirect/CookieAuthRedirect.test.tsx @@ -16,12 +16,16 @@ import React from 'react'; import { screen, waitFor } from '@testing-library/react'; -import { TestApiProvider, renderInTestApp } from '@backstage/test-utils'; +import { + TestApiProvider, + renderInTestApp, + mockApis, +} from '@backstage/test-utils'; import { identityApiRef } from '@backstage/core-plugin-api'; import { CookieAuthRedirect } from './CookieAuthRedirect'; describe('CookieAuthRedirect', () => { - const identityApiMock = { getCredentials: jest.fn() }; + const identityApiMock = mockApis.identity.mock(); beforeEach(() => { jest.clearAllMocks(); diff --git a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx index 888940f30b..3f7c2034a0 100644 --- a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx @@ -36,13 +36,12 @@ import { catalogApiRef } from '../../api'; import { MockStorageApi, TestApiRegistry, + mockApis, renderInTestApp, } from '@backstage/test-utils'; import { ApiProvider } from '@backstage/core-app-api'; import { - ConfigApi, configApiRef, - IdentityApi, identityApiRef, storageApiRef, } from '@backstage/core-plugin-api'; @@ -61,15 +60,18 @@ const mockUser: UserEntity = { }, }; -const mockConfigApi = { - getOptionalString: () => 'Test Company', -} as Partial; +const ownershipEntityRefs = ['user:default/testuser']; + +const mockConfigApi = mockApis.config({ + data: { organization: { name: 'Test Company' } }, +}); const mockCatalogApi = catalogApiMock.mock(); -const mockIdentityApi = { - getBackstageIdentity: jest.fn(), -} as Partial>; +const mockIdentityApi = mockApis.identity({ + userEntityRef: ownershipEntityRefs[0], + ownershipEntityRefs, +}); const mockStarredEntitiesApi = new MockStarredEntitiesApi(); @@ -81,7 +83,6 @@ const apis = TestApiRegistry.from( [starredEntitiesApiRef, mockStarredEntitiesApi], ); -const ownershipEntityRefs = ['user:default/testuser']; describe('', () => { const mockQueryEntitiesImplementation: CatalogApi['queryEntities'] = async request => { diff --git a/plugins/catalog-react/src/components/UserListPicker/useOwnedEntitiesCount.test.tsx b/plugins/catalog-react/src/components/UserListPicker/useOwnedEntitiesCount.test.tsx index 4c620060fe..99b746c80c 100644 --- a/plugins/catalog-react/src/components/UserListPicker/useOwnedEntitiesCount.test.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/useOwnedEntitiesCount.test.tsx @@ -23,11 +23,7 @@ import { useEntityList, } from '../../hooks'; import { catalogApiRef } from '../../api'; -import { - ApiRef, - IdentityApi, - identityApiRef, -} from '@backstage/core-plugin-api'; +import { ApiRef, identityApiRef } from '@backstage/core-plugin-api'; import { MemoryRouter } from 'react-router-dom'; import { useOwnedEntitiesCount } from './useOwnedEntitiesCount'; import { @@ -36,12 +32,13 @@ import { EntityUserFilter, } from '../../filters'; import { useMountEffect } from '@react-hookz/web'; +import { mockApis } from '@backstage/test-utils'; const mockCatalogApi = catalogApiMock.mock(); - -const mockGetBackstageIdentity: jest.MockedFn< - IdentityApi['getBackstageIdentity'] -> = jest.fn(); +const mockIdentityApi = mockApis.identity({ + ownershipEntityRefs: ['user:default/spiderman', 'user:group/a-group'], + userEntityRef: 'user:default/spiderman', +}); jest.mock('@backstage/core-plugin-api', () => { const actual = jest.requireActual('@backstage/core-plugin-api'); @@ -50,13 +47,9 @@ jest.mock('@backstage/core-plugin-api', () => { useApi: (ref: ApiRef) => { if (ref === catalogApiRef) { return mockCatalogApi; + } else if (ref === identityApiRef) { + return mockIdentityApi; } - if (ref === identityApiRef) { - return { - getBackstageIdentity: mockGetBackstageIdentity, - }; - } - return actual.useApi(ref); }, }; @@ -65,12 +58,6 @@ jest.mock('@backstage/core-plugin-api', () => { describe('useOwnedEntitiesCount', () => { beforeEach(() => { jest.clearAllMocks(); - - mockGetBackstageIdentity.mockResolvedValue({ - ownershipEntityRefs: ['user:default/spiderman', 'user:group/a-group'], - userEntityRef: 'user:default/spiderman', - type: 'user', - }); }); it(`shouldn't invoke queryEntities when filters are loading`, async () => { @@ -84,7 +71,9 @@ describe('useOwnedEntitiesCount', () => { wrapper: createWrapperWithInitialFilters({}), }); - await waitFor(() => expect(mockGetBackstageIdentity).toHaveBeenCalled()); + await waitFor(() => + expect(mockIdentityApi.getBackstageIdentity).toHaveBeenCalled(), + ); await expect( waitFor(() => expect(mockCatalogApi.queryEntities).toHaveBeenCalled()), @@ -114,7 +103,9 @@ describe('useOwnedEntitiesCount', () => { }), }); - await waitFor(() => expect(mockGetBackstageIdentity).toHaveBeenCalled()); + await waitFor(() => + expect(mockIdentityApi.getBackstageIdentity).toHaveBeenCalled(), + ); await waitFor(() => expect(mockCatalogApi.queryEntities).toHaveBeenCalledWith({ @@ -151,7 +142,9 @@ describe('useOwnedEntitiesCount', () => { }), }); - await waitFor(() => expect(mockGetBackstageIdentity).toHaveBeenCalled()); + await waitFor(() => + expect(mockIdentityApi.getBackstageIdentity).toHaveBeenCalled(), + ); await expect( waitFor(() => expect(mockCatalogApi.queryEntities).toHaveBeenCalled()), @@ -185,7 +178,9 @@ describe('useOwnedEntitiesCount', () => { }), }); - await waitFor(() => expect(mockGetBackstageIdentity).toHaveBeenCalled()); + await waitFor(() => + expect(mockIdentityApi.getBackstageIdentity).toHaveBeenCalled(), + ); await waitFor(() => expect(mockCatalogApi.queryEntities).toHaveBeenCalledWith({ diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx index 0bda2d19ec..067ca33fa3 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx @@ -18,14 +18,16 @@ import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { Entity } from '@backstage/catalog-model'; import { alertApiRef, - ConfigApi, configApiRef, errorApiRef, - IdentityApi, identityApiRef, storageApiRef, } from '@backstage/core-plugin-api'; -import { MockStorageApi, TestApiProvider } from '@backstage/test-utils'; +import { + MockStorageApi, + TestApiProvider, + mockApis, +} from '@backstage/test-utils'; import { act, renderHook, waitFor } from '@testing-library/react'; import qs from 'qs'; import React, { PropsWithChildren } from 'react'; @@ -67,20 +69,14 @@ const entities: Entity[] = [ }, ]; -const mockConfigApi = { - getOptionalString: () => '', -} as Partial; +const mockConfigApi = mockApis.config(); const ownershipEntityRefs = ['user:default/guest']; -const mockIdentityApi: Partial = { - getBackstageIdentity: async () => ({ - type: 'user', - userEntityRef: 'user:default/guest', - ownershipEntityRefs, - }), - getCredentials: async () => ({ token: undefined }), -}; +const mockIdentityApi = mockApis.identity({ + userEntityRef: 'user:default/guest', + ownershipEntityRefs, +}); const mockCatalogApi = catalogApiMock.mock({ getEntities: jest.fn().mockResolvedValue({ items: entities }), queryEntities: jest.fn().mockResolvedValue({ diff --git a/plugins/catalog-react/src/hooks/useEntityOwnership.test.tsx b/plugins/catalog-react/src/hooks/useEntityOwnership.test.tsx index 5516a249ea..684580792d 100644 --- a/plugins/catalog-react/src/hooks/useEntityOwnership.test.tsx +++ b/plugins/catalog-react/src/hooks/useEntityOwnership.test.tsx @@ -15,20 +15,17 @@ */ import { ComponentEntity, RELATION_OWNED_BY } from '@backstage/catalog-model'; -import { IdentityApi, identityApiRef } from '@backstage/core-plugin-api'; -import { TestApiProvider } from '@backstage/test-utils'; +import { identityApiRef } from '@backstage/core-plugin-api'; +import { TestApiProvider, mockApis } from '@backstage/test-utils'; import { renderHook, waitFor } from '@testing-library/react'; import React from 'react'; import { useEntityOwnership } from './useEntityOwnership'; describe('useEntityOwnership', () => { - type MockIdentityApi = jest.Mocked>; - - const mockIdentityApi: MockIdentityApi = { - getBackstageIdentity: jest.fn(), - }; - - const identityApi = mockIdentityApi as unknown as IdentityApi; + const identityApi = mockApis.identity({ + userEntityRef: 'user:default/user1', + ownershipEntityRefs: ['user:default/user1', 'group:default/group1'], + }); const Wrapper = (props: { children?: React.ReactNode }) => ( @@ -64,12 +61,6 @@ describe('useEntityOwnership', () => { describe('useEntityOwnership', () => { it('matches ownership via ownership entity refs', async () => { - mockIdentityApi.getBackstageIdentity.mockResolvedValue({ - type: 'user', - userEntityRef: 'user:default/user1', - ownershipEntityRefs: ['user:default/user1', 'group:default/group1'], - }); - const { result } = renderHook(() => useEntityOwnership(), { wrapper: Wrapper, }); diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx index f5a16e3af3..a5ced77749 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx @@ -17,12 +17,7 @@ import { QueryEntitiesInitialRequest } from '@backstage/catalog-client'; import { 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 { identityApiRef, storageApiRef } from '@backstage/core-plugin-api'; import { catalogApiRef, entityRouteRef, @@ -34,6 +29,7 @@ import { MockPermissionApi, MockStorageApi, TestApiProvider, + mockApis, renderInTestApp, } from '@backstage/test-utils'; import DashboardIcon from '@material-ui/icons/Dashboard'; @@ -166,18 +162,11 @@ describe('DefaultCatalogPage', () => { }), }); - const testProfile: Partial = { + const identityApi = mockApis.identity({ + userEntityRef: 'user:default/guest', + ownershipEntityRefs: ['user:default/guest', 'group:default/tools'], displayName: 'Display Name', - }; - const identityApi: Partial = { - getBackstageIdentity: async () => ({ - type: 'user', - userEntityRef: 'user:default/guest', - ownershipEntityRefs: ['user:default/guest', 'group:default/tools'], - }), - getCredentials: async () => ({ token: undefined }), - getProfileInfo: async () => testProfile, - }; + }); const storageApi = MockStorageApi.create(); const renderWrapped = (children: React.ReactNode) => diff --git a/plugins/home/src/api/VisitsStorageApi.test.ts b/plugins/home/src/api/VisitsStorageApi.test.ts index 5e8bc2dbfc..206cf42689 100644 --- a/plugins/home/src/api/VisitsStorageApi.test.ts +++ b/plugins/home/src/api/VisitsStorageApi.test.ts @@ -14,9 +14,8 @@ * limitations under the License. */ -import { BackstageUserIdentity, IdentityApi } from '@backstage/core-plugin-api'; import { VisitsStorageApi } from './VisitsStorageApi'; -import { MockStorageApi } from '@backstage/test-utils'; +import { MockStorageApi, mockApis } from '@backstage/test-utils'; import { Visit, VisitsApi } from './VisitsApi'; describe('VisitsStorageApi.create', () => { @@ -26,13 +25,9 @@ describe('VisitsStorageApi.create', () => { () => Math.floor(Math.random() * 16).toString(16), // 0x0 to 0xf ) as `${string}-${string}-${string}-${string}-${string}`; - const mockIdentityApi: IdentityApi = { - signOut: jest.fn(), - getProfileInfo: jest.fn(), - getBackstageIdentity: async () => - ({ userEntityRef: 'user:default/guest' } as BackstageUserIdentity), - getCredentials: jest.fn(), - }; + const mockIdentityApi = mockApis.identity({ + userEntityRef: 'user:default/guest', + }); beforeEach(() => { window.crypto.randomUUID = mockRandomUUID; @@ -40,7 +35,7 @@ describe('VisitsStorageApi.create', () => { }); afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); jest.useRealTimers(); window.localStorage.clear(); }); diff --git a/plugins/home/src/api/VisitsWebStorageApi.test.ts b/plugins/home/src/api/VisitsWebStorageApi.test.ts index 1cf1fa3129..8d8669e99e 100644 --- a/plugins/home/src/api/VisitsWebStorageApi.test.ts +++ b/plugins/home/src/api/VisitsWebStorageApi.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { BackstageUserIdentity, IdentityApi } from '@backstage/core-plugin-api'; +import { mockApis } from '@backstage/test-utils'; import { VisitsWebStorageApi } from './VisitsWebStorageApi'; describe('VisitsWebStorageApi.create()', () => { @@ -24,13 +24,9 @@ describe('VisitsWebStorageApi.create()', () => { () => Math.floor(Math.random() * 16).toString(16), // 0x0 to 0xf ) as `${string}-${string}-${string}-${string}-${string}`; - const mockIdentityApi: IdentityApi = { - signOut: jest.fn(), - getProfileInfo: jest.fn(), - getBackstageIdentity: async () => - ({ userEntityRef: 'user:default/guest' } as BackstageUserIdentity), - getCredentials: jest.fn(), - }; + const mockIdentityApi = mockApis.identity({ + userEntityRef: 'user:default/guest', + }); const mockErrorApi = { post: jest.fn(), error$: jest.fn() }; @@ -40,7 +36,7 @@ describe('VisitsWebStorageApi.create()', () => { afterEach(() => { window.localStorage.clear(); - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('instantiates with only identitiyApi', () => { diff --git a/plugins/org/src/components/MyGroupsSidebarItem/MyGroupsSidebarItem.test.tsx b/plugins/org/src/components/MyGroupsSidebarItem/MyGroupsSidebarItem.test.tsx index 9eb9b3f70f..de46be98be 100644 --- a/plugins/org/src/components/MyGroupsSidebarItem/MyGroupsSidebarItem.test.tsx +++ b/plugins/org/src/components/MyGroupsSidebarItem/MyGroupsSidebarItem.test.tsx @@ -14,11 +14,15 @@ * limitations under the License. */ -import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; +import { + renderInTestApp, + TestApiProvider, + mockApis, +} from '@backstage/test-utils'; import React from 'react'; import { MyGroupsSidebarItem } from './MyGroupsSidebarItem'; import GroupIcon from '@material-ui/icons/People'; -import { IdentityApi, identityApiRef } from '@backstage/core-plugin-api'; +import { identityApiRef } from '@backstage/core-plugin-api'; import { Entity } from '@backstage/catalog-model'; import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; @@ -26,13 +30,10 @@ import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; describe('MyGroupsSidebarItem Test', () => { describe('For guests or users with no groups', () => { it('MyGroupsSidebarItem should be empty', async () => { - const identityApi: Partial = { - getBackstageIdentity: async () => ({ - type: 'user', - userEntityRef: 'user:default/guest', - ownershipEntityRefs: ['user:default/guest'], - }), - }; + const identityApi = mockApis.identity({ + userEntityRef: 'user:default/guest', + ownershipEntityRefs: ['user:default/guest'], + }); const catalogApi = catalogApiMock(); const rendered = await renderInTestApp( { describe('For users that are members of a single group', () => { it('MyGroupsSidebarItem should display a single item that links to their group', async () => { - const identityApi: Partial = { - getBackstageIdentity: async () => ({ - type: 'user', - userEntityRef: 'user:default/nigel.manning', - ownershipEntityRefs: ['user:default/nigel.manning'], - }), - }; + const identityApi = mockApis.identity({ + userEntityRef: 'user:default/nigel.manning', + ownershipEntityRefs: ['user:default/nigel.manning'], + }); const catalogApi = catalogApiMock.mock({ getEntities: async () => ({ items: [ @@ -114,13 +112,10 @@ describe('MyGroupsSidebarItem Test', () => { describe('For users that are members of multiple groups', () => { it('MyGroupsSidebarItem should display a sub-menu with all their groups and a link to each group', async () => { - const identityApi: Partial = { - getBackstageIdentity: async () => ({ - type: 'user', - userEntityRef: 'user:default/nigel.manning', - ownershipEntityRefs: ['user:default/nigel.manning'], - }), - }; + const identityApi = mockApis.identity({ + userEntityRef: 'user:default/nigel.manning', + ownershipEntityRefs: ['user:default/nigel.manning'], + }); const catalogApi = catalogApiMock.mock({ getEntities: async () => ({ items: [ @@ -192,13 +187,10 @@ describe('MyGroupsSidebarItem Test', () => { describe('When an additional filter is not provided', () => { it('catalogApi.getEntities() should be called with the default filter', async () => { - const identityApi: Partial = { - getBackstageIdentity: async () => ({ - type: 'user', - userEntityRef: 'user:default/guest', - ownershipEntityRefs: ['user:default/guest'], - }), - }; + const identityApi = mockApis.identity({ + userEntityRef: 'user:default/guest', + ownershipEntityRefs: ['user:default/guest'], + }); const mockCatalogApi = catalogApiMock.mock(); await renderInTestApp( { describe('When an additional filter is provided', () => { it('catalogApi.getEntities() should be called with an additional filter item', async () => { - const identityApi: Partial = { - getBackstageIdentity: async () => ({ - type: 'user', - userEntityRef: 'user:default/guest', - ownershipEntityRefs: ['user:default/guest'], - }), - }; + const identityApi = mockApis.identity({ + userEntityRef: 'user:default/guest', + ownershipEntityRefs: ['user:default/guest'], + }); const mockCatalogApi = catalogApiMock.mock(); await renderInTestApp( ', () => { const catalogApi = catalogApiMock.mock(); - const identityApi = { - getBackstageIdentity: jest.fn(), - getProfileInfo: jest.fn(), - getCredentials: jest.fn(), - signOut: jest.fn(), - }; + const identityApi = mockApis.identity(); const scaffolderApiMock: jest.Mocked> = { scaffold: jest.fn(), diff --git a/plugins/scaffolder/src/components/ListTasksPage/columns/OwnerEntityColumn.test.tsx b/plugins/scaffolder/src/components/ListTasksPage/columns/OwnerEntityColumn.test.tsx index 35eb9ce0b7..bd5676ba31 100644 --- a/plugins/scaffolder/src/components/ListTasksPage/columns/OwnerEntityColumn.test.tsx +++ b/plugins/scaffolder/src/components/ListTasksPage/columns/OwnerEntityColumn.test.tsx @@ -15,7 +15,11 @@ */ import { Entity } from '@backstage/catalog-model'; -import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; +import { + renderInTestApp, + TestApiProvider, + mockApis, +} from '@backstage/test-utils'; import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import React from 'react'; @@ -24,13 +28,7 @@ import { identityApiRef } from '@backstage/core-plugin-api'; describe('', () => { const catalogApi = catalogApiMock.mock(); - - const identityApi = { - getBackstageIdentity: jest.fn(), - getProfileInfo: jest.fn(), - getCredentials: jest.fn(), - signOut: jest.fn(), - }; + const identityApi = mockApis.identity(); it('should render the column with the user', async () => { const props = { diff --git a/plugins/scaffolder/src/components/fields/MyGroupsPicker/MyGroupsPicker.test.tsx b/plugins/scaffolder/src/components/fields/MyGroupsPicker/MyGroupsPicker.test.tsx index d4a37d0752..57ce2d3023 100644 --- a/plugins/scaffolder/src/components/fields/MyGroupsPicker/MyGroupsPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/MyGroupsPicker/MyGroupsPicker.test.tsx @@ -18,7 +18,11 @@ import React from 'react'; import { waitFor } from '@testing-library/react'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { MyGroupsPicker } from './MyGroupsPicker'; -import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; +import { + renderInTestApp, + TestApiProvider, + mockApis, +} from '@backstage/test-utils'; import { catalogApiRef, entityPresentationApiRef, @@ -26,7 +30,6 @@ import { import { Entity } from '@backstage/catalog-model'; import { ErrorApi, - IdentityApi, errorApiRef, identityApiRef, } from '@backstage/core-plugin-api'; @@ -34,25 +37,9 @@ import userEvent from '@testing-library/user-event'; import { ScaffolderRJSFFieldProps as FieldProps } from '@backstage/plugin-scaffolder-react'; import { DefaultEntityPresentationApi } from '@backstage/plugin-catalog'; -// Create a mock IdentityApi -const mockIdentityApi: IdentityApi = { - getProfileInfo: () => - Promise.resolve({ - displayName: 'Bob', - email: 'bob@example.com', - picture: 'https://example.com/picture.jpg', - }), - getBackstageIdentity: () => - Promise.resolve({ - id: 'Bob', - idToken: 'token', - type: 'user', - userEntityRef: 'user:default/bob', - ownershipEntityRefs: ['group:default/group1', 'group:default/group2'], - }), - getCredentials: () => Promise.resolve({ token: 'token' }), - signOut: () => Promise.resolve(), -}; +const mockIdentityApi = mockApis.identity({ + userEntityRef: 'user:default/bob', +}); describe('', () => { let entities: Entity[]; @@ -96,7 +83,7 @@ describe('', () => { }); afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('should only return the groups a user is part of and not the groups a user is not part of', async () => { diff --git a/plugins/signals/src/api/SignalsClient.test.ts b/plugins/signals/src/api/SignalsClient.test.ts index 2e93cd69f1..057b1fb23f 100644 --- a/plugins/signals/src/api/SignalsClient.test.ts +++ b/plugins/signals/src/api/SignalsClient.test.ts @@ -14,16 +14,14 @@ * limitations under the License. */ -import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api'; +import { DiscoveryApi } from '@backstage/core-plugin-api'; +import { mockApis } from '@backstage/test-utils'; import WS from 'jest-websocket-mock'; import { SignalClient } from './SignalClient'; describe('SignalsClient', () => { - const tokenFunction = jest.fn(); const baseUrlFunction = jest.fn(); - const identity = { - getCredentials: tokenFunction, - } as unknown as IdentityApi; + const identity = mockApis.identity({ token: '12345' }); const discoveryApi = { getBaseUrl: baseUrlFunction, } as unknown as DiscoveryApi; @@ -31,8 +29,7 @@ describe('SignalsClient', () => { let server: WS; beforeEach(async () => { - jest.resetAllMocks(); - tokenFunction.mockResolvedValue({ token: '12345' }); + jest.clearAllMocks(); baseUrlFunction.mockResolvedValue('http://localhost:1234'); server = new WS('ws://localhost:1234', { jsonProtocol: true }); }); diff --git a/plugins/techdocs/src/client.test.ts b/plugins/techdocs/src/client.test.ts index e2c68a7d73..8724e027f5 100644 --- a/plugins/techdocs/src/client.test.ts +++ b/plugins/techdocs/src/client.test.ts @@ -15,7 +15,6 @@ */ import { UrlPatternDiscovery } from '@backstage/core-app-api'; -import { IdentityApi } from '@backstage/core-plugin-api'; import { NotFoundError } from '@backstage/errors'; import { fetchEventSource } from '@microsoft/fetch-event-source'; import { mockApis, MockFetchApi } from '@backstage/test-utils'; @@ -36,9 +35,7 @@ describe('TechDocsStorageClient', () => { const mockBaseUrl = 'http://backstage:9191/api/techdocs'; const configApi = mockApis.config(); const discoveryApi = UrlPatternDiscovery.compile(mockBaseUrl); - const identityApi: jest.Mocked = { - getCredentials: jest.fn(), - } as unknown as jest.Mocked; + const identityApi = mockApis.identity(); const fetchApi = new MockFetchApi({ injectIdentityAuth: { identityApi } }); beforeEach(() => { diff --git a/plugins/user-settings/src/apis/StorageApi/UserSettingsStorage.test.ts b/plugins/user-settings/src/apis/StorageApi/UserSettingsStorage.test.ts index 6bb0035b83..e54ac36624 100644 --- a/plugins/user-settings/src/apis/StorageApi/UserSettingsStorage.test.ts +++ b/plugins/user-settings/src/apis/StorageApi/UserSettingsStorage.test.ts @@ -18,10 +18,13 @@ import { DiscoveryApi, ErrorApi, FetchApi, - IdentityApi, StorageApi, } from '@backstage/core-plugin-api'; -import { MockFetchApi, registerMswTestHooks } from '@backstage/test-utils'; +import { + MockFetchApi, + mockApis, + registerMswTestHooks, +} from '@backstage/test-utils'; import { rest } from 'msw'; import { setupServer } from 'msw/node'; import { UserSettingsStorage } from './UserSettingsStorage'; @@ -35,13 +38,8 @@ describe('Persistent Storage API', () => { const mockDiscoveryApi = { getBaseUrl: async () => mockBaseUrl, }; - const mockIdentityApi: Partial = { - getCredentials: async () => ({ token: 'a-token' }), - }; - const mockIdentityApiFallback: Partial = { - // This API recreates the guest mode, where the WebStorage is used as fallback - getCredentials: async () => ({}), - }; + const mockIdentityApi = mockApis.identity({ token: 'a-token' }); + const mockIdentityApiFallback = mockApis.identity(); const createPersistentStorage = ( args?: Partial<{ @@ -55,7 +53,7 @@ describe('Persistent Storage API', () => { errorApi: mockErrorApi, fetchApi: new MockFetchApi(), discoveryApi: mockDiscoveryApi, - identityApi: mockIdentityApi as IdentityApi, + identityApi: mockIdentityApi, ...args, }); }; @@ -72,13 +70,13 @@ describe('Persistent Storage API', () => { errorApi: mockErrorApi, fetchApi: new MockFetchApi(), discoveryApi: mockDiscoveryApi, - identityApi: mockIdentityApiFallback as IdentityApi, + identityApi: mockIdentityApiFallback, ...args, }); }; afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('should return undefined for values which are unset', async () => { diff --git a/plugins/user-settings/src/components/DefaultSettingsPage/DefaultSettingsPage.test.tsx b/plugins/user-settings/src/components/DefaultSettingsPage/DefaultSettingsPage.test.tsx index 14b7b7b48b..8a2e882aa8 100644 --- a/plugins/user-settings/src/components/DefaultSettingsPage/DefaultSettingsPage.test.tsx +++ b/plugins/user-settings/src/components/DefaultSettingsPage/DefaultSettingsPage.test.tsx @@ -20,16 +20,15 @@ import { DefaultSettingsPage } from './DefaultSettingsPage'; import { UserSettingsTab } from '../UserSettingsTab'; import { useOutlet } from 'react-router-dom'; import { SettingsLayout } from '../SettingsLayout'; -import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; +import { catalogApiRef } from '@backstage/plugin-catalog-react'; +import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useOutlet: jest.fn().mockReturnValue(undefined), })); -const catalogApiMock: jest.Mocked = { - getEntityByRef: jest.fn(), -} as any; +const catalogApi = catalogApiMock(); describe('', () => { beforeEach(() => { @@ -38,7 +37,7 @@ describe('', () => { it('should render the settings page with 3 tabs', async () => { const { container } = await renderInTestApp( - + , ); @@ -54,7 +53,7 @@ describe('', () => { ); const { container } = await renderInTestApp( - + , ); @@ -71,7 +70,7 @@ describe('', () => { ); const { container } = await renderInTestApp( - + , ); diff --git a/plugins/user-settings/src/components/General/UserSettingsIdentityCard.test.tsx b/plugins/user-settings/src/components/General/UserSettingsIdentityCard.test.tsx index b1a811d7fa..6fe0ee01d7 100644 --- a/plugins/user-settings/src/components/General/UserSettingsIdentityCard.test.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsIdentityCard.test.tsx @@ -14,32 +14,28 @@ * limitations under the License. */ -import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils'; +import { + renderInTestApp, + TestApiRegistry, + mockApis, +} from '@backstage/test-utils'; import { screen } from '@testing-library/react'; import React from 'react'; import { UserSettingsIdentityCard } from './UserSettingsIdentityCard'; import { ApiProvider } from '@backstage/core-app-api'; import { identityApiRef } from '@backstage/core-plugin-api'; import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; +import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; const apiRegistry = TestApiRegistry.from( [ identityApiRef, - { - getProfileInfo: jest.fn(async () => ({})), - getBackstageIdentity: jest.fn(async () => ({ - type: 'user' as const, - userEntityRef: 'foo:bar/foobar', - ownershipEntityRefs: ['user:default/test-ownership'], - })), - }, - ], - [ - catalogApiRef, - { - getEntityByRef: jest.fn(), - }, + mockApis.identity({ + userEntityRef: 'foo:bar/foobar', + ownershipEntityRefs: ['user:default/test-ownership'], + }), ], + [catalogApiRef, catalogApiMock.mock()], ); describe('', () => { diff --git a/plugins/user-settings/src/components/General/UserSettingsMenu.test.tsx b/plugins/user-settings/src/components/General/UserSettingsMenu.test.tsx index c3b0aae4a7..0af33fac00 100644 --- a/plugins/user-settings/src/components/General/UserSettingsMenu.test.tsx +++ b/plugins/user-settings/src/components/General/UserSettingsMenu.test.tsx @@ -18,6 +18,7 @@ import { MockErrorApi, TestApiProvider, renderInTestApp, + mockApis, } from '@backstage/test-utils'; import { errorApiRef, identityApiRef } from '@backstage/core-plugin-api'; import { fireEvent, waitFor, screen } from '@testing-library/react'; @@ -35,9 +36,9 @@ describe('', () => { }); it('handles errors that occur when signing out', async () => { - const failingIdentityApi = { - signOut: jest.fn().mockRejectedValue(new Error('Logout error')), - }; + const failingIdentityApi = mockApis.identity.mock({ + signOut: () => Promise.reject(new Error('Logout error')), + }); const mockErrorApi = new MockErrorApi({ collect: true }); await renderInTestApp( ({})), - getBackstageIdentity: jest.fn(async () => ({ - type: 'user' as const, - userEntityRef: 'foo:bar/foobar', - ownershipEntityRefs: ['user:default/test-ownership'], - })), - }, - ], + [identityApiRef, mockApis.identity()], [ catalogApiRef, - { - getEntityByRef: jest.fn(async () => { - return { + catalogApiMock({ + entities: [ + { apiVersion: 'backstage.io/v1beta1', kind: 'User', metadata: { - name: 'Guest', + name: 'test', annotations: {}, }, spec: { @@ -50,9 +45,9 @@ const apiRegistry = TestApiRegistry.from( picture: 'https://example.com/avatar.png', }, }, - }; - }), - }, + }, + ], + }), ], ); diff --git a/plugins/user-settings/src/components/SettingsPage/SettingsPage.test.tsx b/plugins/user-settings/src/components/SettingsPage/SettingsPage.test.tsx index acdb6c3f87..12431a44a2 100644 --- a/plugins/user-settings/src/components/SettingsPage/SettingsPage.test.tsx +++ b/plugins/user-settings/src/components/SettingsPage/SettingsPage.test.tsx @@ -22,20 +22,15 @@ import { useOutlet } from 'react-router-dom'; import { SettingsLayout } from '../SettingsLayout'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { - CatalogApi, - catalogApiRef, - entityRouteRef, -} from '@backstage/plugin-catalog-react'; +import { catalogApiRef, entityRouteRef } from '@backstage/plugin-catalog-react'; +import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), useOutlet: jest.fn().mockReturnValue(undefined), })); -const catalogApiMock: jest.Mocked = { - getEntityByRef: jest.fn(), -} as any; +const catalogApi = catalogApiMock(); describe('', () => { beforeEach(() => { @@ -44,7 +39,7 @@ describe('', () => { it('should render the default settings page with 3 tabs', async () => { const { container } = await renderInTestApp( - + , { @@ -64,7 +59,7 @@ describe('', () => { ); (useOutlet as jest.Mock).mockReturnValue(advancedTabRoute); const { container } = await renderInTestApp( - + , { @@ -85,7 +80,7 @@ describe('', () => { ); (useOutlet as jest.Mock).mockReturnValue(advancedTabRoute); const { container } = await renderInTestApp( - + , { @@ -115,7 +110,7 @@ describe('', () => { ); (useOutlet as jest.Mock).mockReturnValue(customLayout); const { container } = await renderInTestApp( - + , { From e39f72f813783c459a60ee754785631b0fc02776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 9 Oct 2024 12:09:36 +0200 Subject: [PATCH 086/268] implement permission too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/thin-chairs-ring.md | 1 + .../components/catalog/EntityPage.test.tsx | 5 +- packages/test-utils/report.api.md | 56 +++++++++-- .../apis/PermissionApi/MockPermissionApi.ts | 1 + .../src/testUtils/apis/mockApis.test.tsx | 98 +++++++++++++++++++ .../test-utils/src/testUtils/apis/mockApis.ts | 42 ++++++++ .../DefaultApiExplorerPage.test.tsx | 4 +- .../components/AboutCard/AboutCard.test.tsx | 38 +++---- .../CatalogPage/DefaultCatalogPage.test.tsx | 3 +- .../EntityContextMenu.test.tsx | 6 +- .../UnregisterEntity.test.tsx | 6 +- .../EntityLayout/EntityLayout.test.tsx | 24 ++--- .../MembersList/MembersListCard.test.tsx | 20 ++-- .../src/hooks/usePermission.test.tsx | 28 +++--- .../TemplateCard/TemplateCard.test.tsx | 31 +++--- .../TemplateListPage.test.tsx | 15 +-- .../OngoingTask/OngoingTask.test.tsx | 11 +-- 17 files changed, 279 insertions(+), 110 deletions(-) diff --git a/.changeset/thin-chairs-ring.md b/.changeset/thin-chairs-ring.md index df388a7365..dc3c7a0a25 100644 --- a/.changeset/thin-chairs-ring.md +++ b/.changeset/thin-chairs-ring.md @@ -7,3 +7,4 @@ Added a `mockApis` export, which will replace the `MockX` API implementation cla - Deprecated `MockAnalyticsApi`, please use `mockApis.analytics` instead. - Deprecated `MockConfigApi`, please use `mockApis.config` instead. +- Deprecated `MockPermissionApi`, please use `mockApis.permission` instead. diff --git a/packages/app/src/components/catalog/EntityPage.test.tsx b/packages/app/src/components/catalog/EntityPage.test.tsx index 5d2b23b007..0943a82efb 100644 --- a/packages/app/src/components/catalog/EntityPage.test.tsx +++ b/packages/app/src/components/catalog/EntityPage.test.tsx @@ -22,7 +22,7 @@ import { } from '@backstage/plugin-catalog-react'; import { permissionApiRef } from '@backstage/plugin-permission-react'; import { - MockPermissionApi, + mockApis, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -46,7 +46,6 @@ describe('EntityPage Test', () => { }, }; - const mockPermissionApi = new MockPermissionApi(); const rootRouteRef = catalogPlugin.routes.catalogIndex; describe('cicdContent', () => { @@ -55,7 +54,7 @@ describe('EntityPage Test', () => { diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index f570aacde4..4f29b2cdc1 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -144,6 +144,36 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } + // (undocumented) + export function permission(options?: { + authorize?: + | AuthorizeResult.ALLOW + | AuthorizeResult.DENY + | (( + request: EvaluatePermissionRequest, + ) => AuthorizeResult.ALLOW | AuthorizeResult.DENY); + }): jest.Mocked; + // (undocumented) + export namespace permission { + const // (undocumented) + factory: ( + options?: + | { + authorize?: + | AuthorizeResult.DENY + | AuthorizeResult.ALLOW + | (( + request: EvaluatePermissionRequest, + ) => AuthorizeResult.DENY | AuthorizeResult.ALLOW) + | undefined; + } + | undefined, + ) => ApiFactory; + const // (undocumented) + mock: ( + partialImpl?: Partial | undefined, + ) => ApiMock; + } } // @public @deprecated @@ -215,7 +245,9 @@ export interface MockFetchApiOptions { }; } -// @public +// Warning: (ae-unresolved-link) The @link reference could not be resolved: No member was found with name "permissions" +// +// @public @deprecated export class MockPermissionApi implements PermissionApi { constructor( requestHandler?: ( @@ -351,19 +383,23 @@ export function wrapInTestApp( // src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:29:5 - (ae-undocumented) Missing documentation for "error$". // src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:33:5 - (ae-undocumented) Missing documentation for "getErrors". // src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:34:5 - (ae-undocumented) Missing documentation for "waitForError". -// src/testUtils/apis/PermissionApi/MockPermissionApi.d.ts:13:5 - (ae-undocumented) Missing documentation for "authorize". +// src/testUtils/apis/PermissionApi/MockPermissionApi.d.ts:14:5 - (ae-undocumented) Missing documentation for "authorize". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:19:5 - (ae-undocumented) Missing documentation for "create". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:20:5 - (ae-undocumented) Missing documentation for "forBucket". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:21:5 - (ae-undocumented) Missing documentation for "snapshot". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:22:5 - (ae-undocumented) Missing documentation for "set". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:23:5 - (ae-undocumented) Missing documentation for "remove". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:24:5 - (ae-undocumented) Missing documentation for "observe$". -// src/testUtils/apis/mockApis.d.ts:44:5 - (ae-undocumented) Missing documentation for "analytics". -// src/testUtils/apis/mockApis.d.ts:45:5 - (ae-undocumented) Missing documentation for "analytics". -// src/testUtils/apis/mockApis.d.ts:46:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:47:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:98:5 - (ae-undocumented) Missing documentation for "identity". -// src/testUtils/apis/mockApis.d.ts:106:5 - (ae-undocumented) Missing documentation for "identity". -// src/testUtils/apis/mockApis.d.ts:107:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:115:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:46:5 - (ae-undocumented) Missing documentation for "analytics". +// src/testUtils/apis/mockApis.d.ts:47:5 - (ae-undocumented) Missing documentation for "analytics". +// src/testUtils/apis/mockApis.d.ts:48:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:49:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:100:5 - (ae-undocumented) Missing documentation for "identity". +// src/testUtils/apis/mockApis.d.ts:108:5 - (ae-undocumented) Missing documentation for "identity". +// src/testUtils/apis/mockApis.d.ts:109:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:117:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:119:5 - (ae-undocumented) Missing documentation for "permission". +// src/testUtils/apis/mockApis.d.ts:122:5 - (ae-undocumented) Missing documentation for "permission". +// src/testUtils/apis/mockApis.d.ts:123:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:126:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/test-utils/src/testUtils/apis/PermissionApi/MockPermissionApi.ts b/packages/test-utils/src/testUtils/apis/PermissionApi/MockPermissionApi.ts index 163af5dd53..3e5e4c9875 100644 --- a/packages/test-utils/src/testUtils/apis/PermissionApi/MockPermissionApi.ts +++ b/packages/test-utils/src/testUtils/apis/PermissionApi/MockPermissionApi.ts @@ -26,6 +26,7 @@ import { * {@link @backstage/plugin-permission-react#PermissionApi}. Supply a * requestHandler function to override the mock result returned for a given * request. + * @deprecated Use {@link mockApis.permissions} instead * @public */ export class MockPermissionApi implements PermissionApi { diff --git a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx index f9286897b4..f64aae9901 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx +++ b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx @@ -14,6 +14,10 @@ * limitations under the License. */ +import { + AuthorizeResult, + createPermission, +} from '@backstage/plugin-permission-common'; import { mockApis } from './mockApis'; describe('mockApis', () => { @@ -157,4 +161,98 @@ describe('mockApis', () => { expect(notEmpty.signOut).toHaveBeenCalledTimes(1); }); }); + + describe('permission', () => { + it('can create an instance and make assertions on it', async () => { + // default allow + const permission1 = mockApis.permission(); + await expect( + permission1.authorize({ + permission: createPermission({ + name: 'permission.1', + attributes: {}, + }), + }), + ).resolves.toEqual({ result: AuthorizeResult.ALLOW }); + expect(permission1.authorize).toHaveBeenCalledTimes(1); + + // static value + const permission2 = mockApis.permission({ + authorize: AuthorizeResult.DENY, + }); + await expect( + permission2.authorize({ + permission: createPermission({ + name: 'permission.1', + attributes: {}, + }), + }), + ).resolves.toEqual({ result: AuthorizeResult.DENY }); + expect(permission2.authorize).toHaveBeenCalledTimes(1); + + // callback form + const permission3 = mockApis.permission({ + authorize: req => + req.permission.name === 'permission.1' + ? AuthorizeResult.ALLOW + : AuthorizeResult.DENY, + }); + await expect( + permission3.authorize({ + permission: createPermission({ + name: 'permission.1', + attributes: {}, + }), + }), + ).resolves.toEqual({ result: AuthorizeResult.ALLOW }); + await expect( + permission3.authorize({ + permission: createPermission({ + name: 'permission.2', + attributes: {}, + }), + }), + ).resolves.toEqual({ result: AuthorizeResult.DENY }); + expect(permission3.authorize).toHaveBeenCalledTimes(2); + }); + + it('can create a mock and make assertions on it', async () => { + const empty = mockApis.permission.mock(); + expect( + empty.authorize({ + permission: createPermission({ + name: 'permission.1', + attributes: {}, + }), + }), + ).toBeUndefined(); + expect(empty.authorize).toHaveBeenCalledTimes(1); + + const notEmpty = mockApis.permission.mock({ + authorize: async req => ({ + result: + req.permission.name === 'permission.1' + ? AuthorizeResult.ALLOW + : AuthorizeResult.DENY, + }), + }); + await expect( + notEmpty.authorize({ + permission: createPermission({ + name: 'permission.1', + attributes: {}, + }), + }), + ).resolves.toEqual({ result: AuthorizeResult.ALLOW }); + await expect( + notEmpty.authorize({ + permission: createPermission({ + name: 'permission.2', + attributes: {}, + }), + }), + ).resolves.toEqual({ result: AuthorizeResult.DENY }); + expect(notEmpty.authorize).toHaveBeenCalledTimes(2); + }); + }); }); diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index e47ee4ec3e..7ed886d577 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -26,8 +26,17 @@ import { createApiFactory, identityApiRef, } from '@backstage/core-plugin-api'; +import { + AuthorizeResult, + EvaluatePermissionRequest, +} from '@backstage/plugin-permission-common'; +import { + PermissionApi, + permissionApiRef, +} from '@backstage/plugin-permission-react'; import { JsonObject } from '@backstage/types'; import { ApiMock } from './ApiMock'; +import { MockPermissionApi } from './PermissionApi'; /** @internal */ function simpleFactory( @@ -226,4 +235,37 @@ export namespace mockApis { export const factory = simpleFactory(identityApiRef, identity); export const mock = simpleMock(identityApiRef, identityMockSkeleton); } + + const permissionMockSkeleton = (): jest.Mocked => ({ + authorize: jest.fn(), + }); + export function permission(options?: { + authorize?: + | AuthorizeResult.ALLOW + | AuthorizeResult.DENY + | (( + request: EvaluatePermissionRequest, + ) => AuthorizeResult.ALLOW | AuthorizeResult.DENY); + }) { + const authorizeInput = options?.authorize; + let authorize: ( + request: EvaluatePermissionRequest, + ) => AuthorizeResult.ALLOW | AuthorizeResult.DENY; + if (authorizeInput === undefined) { + authorize = () => AuthorizeResult.ALLOW; + } else if (typeof authorizeInput === 'function') { + authorize = authorizeInput; + } else { + authorize = () => authorizeInput; + } + return simpleInstance( + permissionApiRef, + new MockPermissionApi(authorize), + permissionMockSkeleton, + ); + } + export namespace permission { + export const factory = simpleFactory(permissionApiRef, permission); + export const mock = simpleMock(permissionApiRef, permissionMockSkeleton); + } } diff --git a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx index b8d8b07436..7847ac8336 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx @@ -28,7 +28,7 @@ import { } from '@backstage/plugin-catalog-react'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { - MockPermissionApi, + mockApis, MockStorageApi, TestApiProvider, renderInTestApp, @@ -96,7 +96,7 @@ describe('DefaultApiExplorerPage', () => { new DefaultStarredEntitiesApi({ storageApi }), ], [apiDocsConfigRef, apiDocsConfig], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > {children} diff --git a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx index b175593b68..87f35bbc3e 100644 --- a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx @@ -24,7 +24,11 @@ import { ScmIntegrationsApi, scmIntegrationsApiRef, } from '@backstage/integration-react'; -import { TestApiProvider, renderInTestApp } from '@backstage/test-utils'; +import { + TestApiProvider, + mockApis, + renderInTestApp, +} from '@backstage/test-utils'; import { createFromTemplateRouteRef, viewTechDocRouteRef } from '../../routes'; import { AboutCard } from './AboutCard'; @@ -37,10 +41,6 @@ import { permissionApiRef } from '@backstage/plugin-permission-react'; import { AuthorizeResult } from '@backstage/plugin-permission-common'; import { SWRConfig } from 'swr'; -const mockAuthorize = jest.fn(); - -const mockPermissionApi = { authorize: mockAuthorize }; - describe('', () => { const catalogApi = catalogApiMock.mock(); @@ -411,10 +411,6 @@ describe('', () => { }, }; - mockAuthorize.mockImplementation(async () => ({ - result: AuthorizeResult.ALLOW, - })); - await renderInTestApp( ', () => { ScmIntegrationsApi.fromConfig(new ConfigReader({})), ], [catalogApiRef, catalogApi], - [permissionApiRef, mockPermissionApi], + [permissionApiRef, mockApis.permission()], ]} > @@ -466,10 +462,6 @@ describe('', () => { }, }; - mockAuthorize.mockImplementation(async () => ({ - result: AuthorizeResult.DENY, - })); - await renderInTestApp( ', () => { ScmIntegrationsApi.fromConfig(new ConfigReader({})), ], [catalogApiRef, catalogApi], - [permissionApiRef, mockPermissionApi], + [ + permissionApiRef, + mockApis.permission({ authorize: AuthorizeResult.DENY }), + ], ]} > @@ -766,9 +761,6 @@ describe('', () => { namespace: 'default', }, }; - mockAuthorize.mockImplementation(async () => ({ - result: AuthorizeResult.ALLOW, - })); await renderInTestApp( ', () => { ), ], [catalogApiRef, catalogApi], - [permissionApiRef, mockPermissionApi], + [permissionApiRef, mockApis.permission()], ]} > @@ -819,9 +811,6 @@ describe('', () => { namespace: 'default', }, }; - mockAuthorize.mockImplementation(async () => ({ - result: AuthorizeResult.DENY, - })); await renderInTestApp( new Map() }}> ', () => { ), ], [catalogApiRef, catalogApi], - [permissionApiRef, mockPermissionApi], + [ + permissionApiRef, + mockApis.permission({ authorize: AuthorizeResult.DENY }), + ], ]} > diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx index a5ced77749..38310bbbf5 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx @@ -26,7 +26,6 @@ import { } from '@backstage/plugin-catalog-react'; import { mockBreakpoint } from '@backstage/core-components/testUtils'; import { - MockPermissionApi, MockStorageApi, TestApiProvider, mockApis, @@ -177,7 +176,7 @@ describe('DefaultCatalogPage', () => { [identityApiRef, identityApi], [storageApiRef, storageApi], [starredEntitiesApiRef, new MockStarredEntitiesApi()], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > {children} diff --git a/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.test.tsx b/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.test.tsx index f7220cb1ea..4725f35c86 100644 --- a/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.test.tsx +++ b/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.test.tsx @@ -17,7 +17,7 @@ import { EntityProvider } from '@backstage/plugin-catalog-react'; import { permissionApiRef } from '@backstage/plugin-permission-react'; import { - MockPermissionApi, + mockApis, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -26,11 +26,9 @@ import { fireEvent, screen } from '@testing-library/react'; import * as React from 'react'; import { EntityContextMenu } from './EntityContextMenu'; -const mockPermissionApi = new MockPermissionApi(); - function render(children: React.ReactNode) { return renderInTestApp( - + + { }, } as Entity; - const mockApis = TestApiRegistry.from( + const apis = TestApiRegistry.from( [catalogApiRef, catalogApiMock()], [alertApiRef, {} as AlertApi], [starredEntitiesApiRef, new MockStarredEntitiesApi()], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ); it('renders simplest case', async () => { await renderInTestApp( - + @@ -93,7 +93,7 @@ describe('EntityLayout', () => { } as Entity; await renderInTestApp( - + @@ -117,7 +117,7 @@ describe('EntityLayout', () => { it('renders default error message when entity is not found', async () => { await renderInTestApp( - + @@ -142,7 +142,7 @@ describe('EntityLayout', () => { it('renders custom message when entity is not found', async () => { await renderInTestApp( - + Oppps.. Your entity was not found
} @@ -171,7 +171,7 @@ describe('EntityLayout', () => { it('navigates when user clicks different tab', async () => { await renderInTestApp( - + @@ -211,7 +211,7 @@ describe('EntityLayout', () => { const shouldNotRenderTab = (e: Entity) => e.metadata.name === 'some-entity'; await renderInTestApp( - + @@ -254,7 +254,7 @@ describe('EntityLayout', () => { relations: [{ type: 'ownedBy', targetRef: mockTargetRef }], }; await renderInTestApp( - + @@ -327,7 +327,7 @@ describe('EntityLayout - CleanUpAfterRemoval', () => { [catalogApiRef, catalogApi], [alertApiRef, alertApi], [starredEntitiesApiRef, new MockStarredEntitiesApi()], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -378,7 +378,7 @@ describe('EntityLayout - CleanUpAfterRemoval', () => { [catalogApiRef, catalogApi], [alertApiRef, alertApi], [starredEntitiesApiRef, new MockStarredEntitiesApi()], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx index 6b8261e015..04de321c50 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.test.tsx @@ -22,7 +22,11 @@ import { StarredEntitiesApi, starredEntitiesApiRef, } from '@backstage/plugin-catalog-react'; -import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; +import { + mockApis, + renderInTestApp, + TestApiProvider, +} from '@backstage/test-utils'; import React from 'react'; import { MembersListCard } from './MembersListCard'; import { @@ -184,7 +188,7 @@ describe('MemberTab Test', () => { apis={[ [catalogApiRef, mockedCatalogApiSupportingGroups], [starredEntitiesApiRef, mockedStarredEntitiesApi], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -212,7 +216,7 @@ describe('MemberTab Test', () => { apis={[ [catalogApiRef, mockedCatalogApiSupportingGroups], [starredEntitiesApiRef, mockedStarredEntitiesApi], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -238,7 +242,7 @@ describe('MemberTab Test', () => { apis={[ [catalogApiRef, mockedCatalogApiSupportingGroups], [starredEntitiesApiRef, mockedStarredEntitiesApi], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -273,7 +277,7 @@ describe('MemberTab Test', () => { apis={[ [catalogApiRef, mockedCatalogApiSupportingGroups], [starredEntitiesApiRef, mockedStarredEntitiesApi], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -308,7 +312,7 @@ describe('MemberTab Test', () => { apis={[ [catalogApiRef, mockedCatalogApiSupportingGroups], [starredEntitiesApiRef, mockedStarredEntitiesApi], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -366,7 +370,7 @@ describe('MemberTab Test', () => { apis={[ [catalogApiRef, mockedCatalogApiSupportingGroups], [starredEntitiesApiRef, mockedStarredEntitiesApi], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -406,7 +410,7 @@ describe('MemberTab Test', () => { apis={[ [catalogApiRef, mockedCatalogApiSupportingGroups], [starredEntitiesApiRef, mockedStarredEntitiesApi], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > diff --git a/plugins/permission-react/src/hooks/usePermission.test.tsx b/plugins/permission-react/src/hooks/usePermission.test.tsx index 1987382f47..e4a0c82eab 100644 --- a/plugins/permission-react/src/hooks/usePermission.test.tsx +++ b/plugins/permission-react/src/hooks/usePermission.test.tsx @@ -21,7 +21,7 @@ import { AuthorizeResult, createPermission, } from '@backstage/plugin-permission-common'; -import { TestApiProvider } from '@backstage/test-utils'; +import { TestApiProvider, mockApis } from '@backstage/test-utils'; import { PermissionApi, permissionApiRef } from '../apis'; import { SWRConfig } from 'swr'; @@ -52,36 +52,36 @@ function renderComponent(mockApi: PermissionApi) { } describe('usePermission', () => { - const mockPermissionApi = { authorize: jest.fn() }; - it('Returns loading when permissionApi has not yet responded.', () => { - mockPermissionApi.authorize.mockReturnValueOnce(new Promise(() => {})); + const permissionApi = mockApis.permission.mock({ + authorize: async () => new Promise(() => {}), + }); - const { getByText } = renderComponent(mockPermissionApi); + const { getByText } = renderComponent(permissionApi); - expect(mockPermissionApi.authorize).toHaveBeenCalledWith({ permission }); + expect(permissionApi.authorize).toHaveBeenCalledWith({ permission }); expect(getByText('loading')).toBeTruthy(); }); it('Returns allowed when permissionApi allows authorization.', async () => { - mockPermissionApi.authorize.mockResolvedValueOnce({ - result: AuthorizeResult.ALLOW, + const permissionApi = mockApis.permission({ + authorize: AuthorizeResult.ALLOW, }); - const { findByText } = renderComponent(mockPermissionApi); + const { findByText } = renderComponent(permissionApi); - expect(mockPermissionApi.authorize).toHaveBeenCalledWith({ permission }); + expect(permissionApi.authorize).toHaveBeenCalledWith({ permission }); expect(await findByText('content')).toBeTruthy(); }); it('Returns not allowed when permissionApi denies authorization.', async () => { - mockPermissionApi.authorize.mockResolvedValueOnce({ - result: AuthorizeResult.DENY, + const permissionApi = mockApis.permission({ + authorize: AuthorizeResult.DENY, }); - const { findByText } = renderComponent(mockPermissionApi); + const { findByText } = renderComponent(permissionApi); - expect(mockPermissionApi.authorize).toHaveBeenCalledWith({ permission }); + expect(permissionApi.authorize).toHaveBeenCalledWith({ permission }); await expect(findByText('content')).rejects.toThrow(); }); }); diff --git a/plugins/scaffolder-react/src/next/components/TemplateCard/TemplateCard.test.tsx b/plugins/scaffolder-react/src/next/components/TemplateCard/TemplateCard.test.tsx index febdc7c99e..5b2324b222 100644 --- a/plugins/scaffolder-react/src/next/components/TemplateCard/TemplateCard.test.tsx +++ b/plugins/scaffolder-react/src/next/components/TemplateCard/TemplateCard.test.tsx @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { DefaultStarredEntitiesApi } from '@backstage/plugin-catalog'; import { entityRouteRef, starredEntitiesApiRef, } from '@backstage/plugin-catalog-react'; import { - MockPermissionApi, + mockApis, MockStorageApi, renderInTestApp, TestApiProvider, @@ -54,7 +55,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -84,7 +85,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -116,7 +117,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -146,7 +147,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -182,7 +183,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -222,7 +223,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -267,7 +268,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -316,7 +317,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -359,7 +360,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -399,7 +400,7 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi()], + [permissionApiRef, mockApis.permission()], ]} > @@ -428,9 +429,6 @@ describe('TemplateCard', () => { }, }; const mockOnSelected = jest.fn(); - const mockAuthorize = jest - .fn() - .mockImplementation(async () => ({ result: AuthorizeResult.DENY })); // SWR used by the usePermission hook needs cache to be reset for each test const { queryByText } = await renderInTestApp( new Map() }}> @@ -442,7 +440,10 @@ describe('TemplateCard', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, new MockPermissionApi(mockAuthorize)], + [ + permissionApiRef, + mockApis.permission({ authorize: AuthorizeResult.DENY }), + ], ]} > diff --git a/plugins/scaffolder/src/alpha/components/TemplateListPage/TemplateListPage.test.tsx b/plugins/scaffolder/src/alpha/components/TemplateListPage/TemplateListPage.test.tsx index 6079ec2e1d..a02c90f687 100644 --- a/plugins/scaffolder/src/alpha/components/TemplateListPage/TemplateListPage.test.tsx +++ b/plugins/scaffolder/src/alpha/components/TemplateListPage/TemplateListPage.test.tsx @@ -25,6 +25,7 @@ import { MockStorageApi, renderInTestApp, TestApiProvider, + mockApis, } from '@backstage/test-utils'; import React from 'react'; import { rootRouteRef } from '../../../routes'; @@ -55,7 +56,7 @@ describe('TemplateListPage', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -77,7 +78,7 @@ describe('TemplateListPage', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -100,7 +101,7 @@ describe('TemplateListPage', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -122,7 +123,7 @@ describe('TemplateListPage', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -145,7 +146,7 @@ describe('TemplateListPage', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -167,7 +168,7 @@ describe('TemplateListPage', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > @@ -188,7 +189,7 @@ describe('TemplateListPage', () => { storageApi: MockStorageApi.create(), }), ], - [permissionApiRef, {}], + [permissionApiRef, mockApis.permission()], ]} > { @@ -146,10 +146,9 @@ describe('OngoingTask', () => { }); it('should have cancel and start over buttons be disabled without the proper permissions', async () => { - const mockAuthorize = jest - .fn() - .mockImplementation(async () => ({ result: AuthorizeResult.DENY })); - const permissionApi: PermissionApi = { authorize: mockAuthorize }; + const permissionApi = mockApis.permission({ + authorize: AuthorizeResult.DENY, + }); const rendered = await render(permissionApi); const { getByTestId } = rendered; From 7d06a4391679890f7ce7117f00a6735ccb77d723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 9 Oct 2024 13:53:08 +0200 Subject: [PATCH 087/268] implement storage too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/thin-chairs-ring.md | 1 + .../DismissableBanner.test.tsx | 22 +- packages/test-utils/report.api.md | 43 ++- .../apis/StorageApi/MockStorageApi.test.ts | 1 + .../apis/StorageApi/MockStorageApi.ts | 18 +- .../src/testUtils/apis/mockApis.test.tsx | 284 ++++++++++++++++++ .../test-utils/src/testUtils/apis/mockApis.ts | 22 ++ .../DefaultApiExplorerPage.test.tsx | 10 +- .../CookieAuthRefreshProvider.test.tsx | 11 +- .../FavoriteEntity/FavoriteEntity.test.tsx | 8 +- .../UserListPicker/UserListPicker.test.tsx | 11 +- .../src/hooks/useEntityListProvider.test.tsx | 12 +- .../DefaultStarredEntitiesApi.test.ts | 8 +- .../apis/StarredEntitiesApi/migration.test.ts | 6 +- .../CatalogPage/DefaultCatalogPage.test.tsx | 5 +- plugins/home/src/api/VisitsStorageApi.test.ts | 12 +- .../TemplateCard/CardHeader.test.tsx | 11 +- .../TemplateCard/TemplateCard.test.tsx | 23 +- .../TemplateListPage.test.tsx | 15 +- .../components/DefaultTechDocsHome.test.tsx | 24 +- .../Grids/EntityListDocsGrid.test.tsx | 22 +- 21 files changed, 437 insertions(+), 132 deletions(-) diff --git a/.changeset/thin-chairs-ring.md b/.changeset/thin-chairs-ring.md index dc3c7a0a25..5561b6f551 100644 --- a/.changeset/thin-chairs-ring.md +++ b/.changeset/thin-chairs-ring.md @@ -8,3 +8,4 @@ Added a `mockApis` export, which will replace the `MockX` API implementation cla - Deprecated `MockAnalyticsApi`, please use `mockApis.analytics` instead. - Deprecated `MockConfigApi`, please use `mockApis.config` instead. - Deprecated `MockPermissionApi`, please use `mockApis.permission` instead. +- Deprecated `MockStorageApi`, please use `mockApis.storage` instead. diff --git a/packages/core-components/src/components/DismissableBanner/DismissableBanner.test.tsx b/packages/core-components/src/components/DismissableBanner/DismissableBanner.test.tsx index 8d93186ccc..6f6da1231f 100644 --- a/packages/core-components/src/components/DismissableBanner/DismissableBanner.test.tsx +++ b/packages/core-components/src/components/DismissableBanner/DismissableBanner.test.tsx @@ -16,24 +16,18 @@ import React from 'react'; import { fireEvent } from '@testing-library/react'; -import { TestApiRegistry, renderInTestApp } from '@backstage/test-utils'; +import { + TestApiRegistry, + renderInTestApp, + mockApis, +} from '@backstage/test-utils'; import { DismissableBanner } from './DismissableBanner'; -import { ApiProvider, WebStorage } from '@backstage/core-app-api'; -import { storageApiRef, StorageApi } from '@backstage/core-plugin-api'; +import { ApiProvider } from '@backstage/core-app-api'; +import { storageApiRef } from '@backstage/core-plugin-api'; import { screen } from '@testing-library/react'; describe('', () => { - let apis: TestApiRegistry; - const mockErrorApi = { post: jest.fn(), error$: jest.fn() }; - const createWebStorage = (): StorageApi => { - return WebStorage.create({ - errorApi: mockErrorApi, - }); - }; - - beforeEach(() => { - apis = TestApiRegistry.from([storageApiRef, createWebStorage()]); - }); + const apis = TestApiRegistry.from([storageApiRef, mockApis.storage()]); it('renders the message and the popover', async () => { await renderInTestApp( diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index 4f29b2cdc1..0845218a33 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -174,6 +174,25 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } + // (undocumented) + export function storage(options?: { + data?: JsonObject; + }): jest.Mocked; + // (undocumented) + export namespace storage { + const // (undocumented) + factory: ( + options?: + | { + data?: JsonObject | undefined; + } + | undefined, + ) => ApiFactory; + const // (undocumented) + mock: ( + partialImpl?: Partial | undefined, + ) => ApiMock; + } } // @public @deprecated @@ -260,7 +279,9 @@ export class MockPermissionApi implements PermissionApi { ): Promise; } -// @public +// Warning: (ae-unresolved-link) The @link reference could not be resolved: The reference is ambiguous because "storage" has more than one declaration; you need to add a TSDoc member reference selector +// +// @public @deprecated export class MockStorageApi implements StorageApi { // (undocumented) static create(data?: MockStorageBucket): MockStorageApi; @@ -278,7 +299,9 @@ export class MockStorageApi implements StorageApi { snapshot(key: string): StorageValueSnapshot; } -// @public +// Warning: (ae-unresolved-link) The @link reference could not be resolved: The reference is ambiguous because "storage" has more than one declaration; you need to add a TSDoc member reference selector +// +// @public @deprecated export type MockStorageBucket = { [key: string]: any; }; @@ -384,12 +407,12 @@ export function wrapInTestApp( // src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:33:5 - (ae-undocumented) Missing documentation for "getErrors". // src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:34:5 - (ae-undocumented) Missing documentation for "waitForError". // src/testUtils/apis/PermissionApi/MockPermissionApi.d.ts:14:5 - (ae-undocumented) Missing documentation for "authorize". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:19:5 - (ae-undocumented) Missing documentation for "create". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:20:5 - (ae-undocumented) Missing documentation for "forBucket". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:21:5 - (ae-undocumented) Missing documentation for "snapshot". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:22:5 - (ae-undocumented) Missing documentation for "set". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:23:5 - (ae-undocumented) Missing documentation for "remove". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:24:5 - (ae-undocumented) Missing documentation for "observe$". +// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:21:5 - (ae-undocumented) Missing documentation for "create". +// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:22:5 - (ae-undocumented) Missing documentation for "forBucket". +// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:23:5 - (ae-undocumented) Missing documentation for "snapshot". +// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:24:5 - (ae-undocumented) Missing documentation for "set". +// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:25:5 - (ae-undocumented) Missing documentation for "remove". +// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:26:5 - (ae-undocumented) Missing documentation for "observe$". // src/testUtils/apis/mockApis.d.ts:46:5 - (ae-undocumented) Missing documentation for "analytics". // src/testUtils/apis/mockApis.d.ts:47:5 - (ae-undocumented) Missing documentation for "analytics". // src/testUtils/apis/mockApis.d.ts:48:15 - (ae-undocumented) Missing documentation for "factory". @@ -402,4 +425,8 @@ export function wrapInTestApp( // src/testUtils/apis/mockApis.d.ts:122:5 - (ae-undocumented) Missing documentation for "permission". // src/testUtils/apis/mockApis.d.ts:123:15 - (ae-undocumented) Missing documentation for "factory". // src/testUtils/apis/mockApis.d.ts:126:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:128:5 - (ae-undocumented) Missing documentation for "storage". +// src/testUtils/apis/mockApis.d.ts:131:5 - (ae-undocumented) Missing documentation for "storage". +// src/testUtils/apis/mockApis.d.ts:132:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:135:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.test.ts b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.test.ts index 63aa4235e1..cdae96d5e4 100644 --- a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.test.ts +++ b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.test.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { StorageApi } from '@backstage/core-plugin-api'; import { MockStorageApi } from './MockStorageApi'; diff --git a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts index 30d523aed2..5ef3846bfa 100644 --- a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts +++ b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts @@ -20,12 +20,14 @@ import ObservableImpl from 'zen-observable'; /** * Type for map holding data in {@link MockStorageApi} + * @deprecated Use {@link mockApis.storage} instead * @public */ export type MockStorageBucket = { [key: string]: any }; /** * Mock implementation of the {@link core-plugin-api#StorageApi} to be used in tests + * @deprecated Use {@link mockApis.storage} instead * @public */ export class MockStorageApi implements StorageApi { @@ -44,7 +46,21 @@ export class MockStorageApi implements StorageApi { } static create(data?: MockStorageBucket) { - return new MockStorageApi('', new Map(), data); + // Translate a nested data object structure into a flat object with keys + // like `/a/b` with their corresponding leaf values + const keyValues: { [key: string]: any } = {}; + function put(value: { [key: string]: any }, namespace: string) { + for (const [key, val] of Object.entries(value)) { + if (typeof val === 'object' && val !== null) { + put(val, `${namespace}/${key}`); + } else { + const namespacedKey = `${namespace}/${key.replace(/^\//, '')}`; + keyValues[namespacedKey] = val; + } + } + } + put(data ?? {}, ''); + return new MockStorageApi('', new Map(), keyValues); } forBucket(name: string): StorageApi { diff --git a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx index f64aae9901..87b9472377 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx +++ b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx @@ -255,4 +255,288 @@ describe('mockApis', () => { expect(notEmpty.authorize).toHaveBeenCalledTimes(2); }); }); + + describe('storage', () => { + describe('instance deep tests', () => { + it('should return undefined for values which are unset', async () => { + const storage = mockApis.storage(); + + expect(storage.snapshot('myfakekey').value).toBeUndefined(); + expect(storage.snapshot('myfakekey')).toEqual({ + key: 'myfakekey', + presence: 'absent', + value: undefined, + newValue: undefined, + }); + }); + + it('should allow the setting and snapshotting of the simple data structures', async () => { + const storage = mockApis.storage(); + + await storage.set('myfakekey', 'helloimastring'); + await storage.set('mysecondfakekey', 1234); + await storage.set('mythirdfakekey', true); + expect(storage.snapshot('myfakekey').value).toBe('helloimastring'); + expect(storage.snapshot('mysecondfakekey').value).toBe(1234); + expect(storage.snapshot('mythirdfakekey').value).toBe(true); + expect(storage.snapshot('myfakekey')).toEqual({ + key: 'myfakekey', + presence: 'present', + value: 'helloimastring', + }); + expect(storage.snapshot('mysecondfakekey')).toEqual({ + key: 'mysecondfakekey', + presence: 'present', + value: 1234, + }); + expect(storage.snapshot('mythirdfakekey')).toEqual({ + key: 'mythirdfakekey', + presence: 'present', + value: true, + }); + }); + + it('should allow setting of complex datastructures', async () => { + const storage = mockApis.storage(); + + const mockData = { + something: 'here', + is: [{ super: { complex: [{ but: 'something', why: true }] } }], + }; + + await storage.set('myfakekey', mockData); + + expect(storage.snapshot('myfakekey').value).toEqual(mockData); + expect(storage.snapshot('myfakekey')).toEqual({ + key: 'myfakekey', + presence: 'present', + value: mockData, + }); + }); + + it('should subscribe to key changes when setting a new value', async () => { + const storage = mockApis.storage(); + + const wrongKeyNextHandler = jest.fn(); + const selectedKeyNextHandler = jest.fn(); + const mockData = { hello: 'im a great new value' }; + + await new Promise(resolve => { + storage.observe$('correctKey').subscribe({ + next: (...args) => { + selectedKeyNextHandler(...args); + resolve(); + }, + }); + + storage.observe$('wrongKey').subscribe({ next: wrongKeyNextHandler }); + + storage.set('correctKey', mockData); + }); + + expect(wrongKeyNextHandler).not.toHaveBeenCalled(); + expect(selectedKeyNextHandler).toHaveBeenCalledTimes(1); + expect(selectedKeyNextHandler).toHaveBeenCalledWith({ + key: 'correctKey', + presence: 'present', + value: mockData, + }); + }); + + it('should subscribe to key changes when deleting a value', async () => { + const storage = mockApis.storage(); + + const wrongKeyNextHandler = jest.fn(); + const selectedKeyNextHandler = jest.fn(); + const mockData = { hello: 'im a great new value' }; + + storage.set('correctKey', mockData); + + await new Promise(resolve => { + storage.observe$('correctKey').subscribe({ + next: (...args) => { + selectedKeyNextHandler(...args); + resolve(); + }, + }); + + storage.observe$('wrongKey').subscribe({ next: wrongKeyNextHandler }); + + storage.remove('correctKey'); + }); + + expect(wrongKeyNextHandler).not.toHaveBeenCalled(); + expect(selectedKeyNextHandler).toHaveBeenCalledTimes(1); + expect(selectedKeyNextHandler).toHaveBeenCalledWith({ + key: 'correctKey', + presence: 'absent', + value: undefined, + newValue: undefined, + }); + }); + + it('should be able to create different buckets for different uses', async () => { + const rootStorage = mockApis.storage(); + + const firstStorage = rootStorage.forBucket('userSettings'); + const secondStorage = rootStorage.forBucket('profileSettings'); + const keyName = 'blobby'; + + await firstStorage.set(keyName, 'boop'); + await secondStorage.set(keyName, 'deerp'); + + expect(firstStorage.snapshot(keyName)).not.toBe( + secondStorage.snapshot(keyName), + ); + expect(firstStorage.snapshot(keyName).value).toBe('boop'); + expect(secondStorage.snapshot(keyName).value).toBe('deerp'); + expect(firstStorage.snapshot(keyName)).not.toEqual( + secondStorage.snapshot(keyName), + ); + expect(firstStorage.snapshot(keyName)).toEqual({ + key: keyName, + presence: 'present', + value: 'boop', + }); + expect(secondStorage.snapshot(keyName)).toEqual({ + key: keyName, + presence: 'present', + value: 'deerp', + }); + }); + + it('should not clash with other namespaces when creating buckets', async () => { + const rootStorage = mockApis.storage(); + + // when getting key test2 it will translate to /profile/something/deep/test2 + const firstStorage = rootStorage + .forBucket('profile') + .forBucket('something') + .forBucket('deep'); + // when getting key deep/test2 it will translate to /profile/something/deep/test2 + const secondStorage = rootStorage.forBucket('profile/something'); + + await firstStorage.set('test2', { error: true }); + + expect(secondStorage.snapshot('deep/test2').value).toBe(undefined); + expect(secondStorage.snapshot('deep/test2')).toMatchObject({ + presence: 'absent', + }); + }); + + it('should not reuse storage instances between different rootStorages', async () => { + const rootStorage1 = mockApis.storage(); + const rootStorage2 = mockApis.storage(); + + const firstStorage = rootStorage1.forBucket('something'); + const secondStorage = rootStorage2.forBucket('something'); + + await firstStorage.set('test2', true); + + expect(firstStorage.snapshot('test2').value).toBe(true); + expect(secondStorage.snapshot('test2').value).toBe(undefined); + expect(firstStorage.snapshot('test2')).toEqual({ + key: 'test2', + presence: 'present', + value: true, + }); + expect(secondStorage.snapshot('test2')).toEqual({ + key: 'test2', + presence: 'absent', + value: undefined, + }); + }); + + it('should freeze the snapshot value', async () => { + const storage = mockApis.storage(); + + const data = { foo: 'bar', baz: [{ foo: 'bar' }] }; + storage.set('foo', data); + + const snapshot = storage.snapshot('foo'); + expect(snapshot.value).not.toBe(data); + + if (snapshot.presence !== 'present') { + throw new Error('Invalid presence'); + } + + expect(() => { + snapshot.value.foo = 'buzz'; + }).toThrow(/Cannot assign to read only property/); + expect(() => { + snapshot.value.baz[0].foo = 'buzz'; + }).toThrow(/Cannot assign to read only property/); + expect(() => { + snapshot.value.baz.push({ foo: 'buzz' }); + }).toThrow(/Cannot add property 1, object is not extensible/); + }); + + it('should freeze observed values', async () => { + const storage = mockApis.storage(); + + const snapshotPromise = new Promise(resolve => { + storage.observe$('test').subscribe({ + next: resolve, + }); + }); + + storage.set('test', { + foo: { + bar: 'baz', + }, + }); + + const snapshot = await snapshotPromise; + expect(snapshot.presence).toBe('present'); + expect(() => { + snapshot.value!.foo.bar = 'qux'; + }).toThrow(/Cannot assign to read only property 'bar' of object/); + }); + + it('should JSON serialize stored values', async () => { + const storage = mockApis.storage(); + + storage.set('test', { + foo: { + toJSON() { + return { + bar: 'baz', + }; + }, + }, + }); + + expect(storage.snapshot('test')).toMatchObject({ + presence: 'present', + value: { + foo: { + bar: 'baz', + }, + }, + }); + }); + }); + + it('can create an instance and make assertions on it', () => { + const empty = mockApis.storage(); + expect(empty.snapshot('a')).toEqual({ key: 'a', presence: 'absent' }); + expect(empty.snapshot).toHaveBeenCalledTimes(1); + + const notEmpty = mockApis.storage({ data: { a: 1, b: { c: 2 } } }); + expect(notEmpty.snapshot('a')).toEqual({ + key: 'a', + presence: 'present', + value: 1, + }); + expect(notEmpty.forBucket('b').snapshot('c')).toEqual({ + key: 'c', + presence: 'present', + value: 2, + }); + expect(notEmpty.snapshot).toHaveBeenCalledTimes(1); // "inner" (forBucket returned) instances aren't mocked + expect(notEmpty.forBucket).toHaveBeenCalledTimes(1); + }); + + it('can create a mock and make assertions on it', () => {}); + }); }); diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index 7ed886d577..7a334c69b6 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -21,10 +21,12 @@ import { ApiRef, ConfigApi, IdentityApi, + StorageApi, analyticsApiRef, configApiRef, createApiFactory, identityApiRef, + storageApiRef, } from '@backstage/core-plugin-api'; import { AuthorizeResult, @@ -37,6 +39,7 @@ import { import { JsonObject } from '@backstage/types'; import { ApiMock } from './ApiMock'; import { MockPermissionApi } from './PermissionApi'; +import { MockStorageApi } from './StorageApi'; /** @internal */ function simpleFactory( @@ -268,4 +271,23 @@ export namespace mockApis { export const factory = simpleFactory(permissionApiRef, permission); export const mock = simpleMock(permissionApiRef, permissionMockSkeleton); } + + const storageMockSkeleton = (): jest.Mocked => ({ + forBucket: jest.fn(), + set: jest.fn(), + remove: jest.fn(), + observe$: jest.fn(), + snapshot: jest.fn(), + }); + export function storage(options?: { data?: JsonObject }) { + return simpleInstance( + storageApiRef, + MockStorageApi.create(options?.data), + storageMockSkeleton, + ); + } + export namespace storage { + export const factory = simpleFactory(storageApiRef, storage); + export const mock = simpleMock(storageApiRef, storageMockSkeleton); + } } diff --git a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx index 7847ac8336..34706e8136 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx @@ -14,7 +14,6 @@ * limitations under the License. */ -import { ConfigReader } from '@backstage/core-app-api'; import { TableColumn, TableProps } from '@backstage/core-components'; import { configApiRef, storageApiRef } from '@backstage/core-plugin-api'; import { @@ -29,7 +28,6 @@ import { import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { mockApis, - MockStorageApi, TestApiProvider, renderInTestApp, } from '@backstage/test-utils'; @@ -72,17 +70,15 @@ describe('DefaultApiExplorerPage', () => { }), }); - const configApi = new ConfigReader({ - organization: { - name: 'My Company', - }, + const configApi = mockApis.config({ + data: { organization: { name: 'My Company' } }, }); const apiDocsConfig = { getApiDefinitionWidget: () => undefined, }; - const storageApi = MockStorageApi.create(); + const storageApi = mockApis.storage(); const renderWrapped = (children: React.ReactNode) => renderInTestApp( diff --git a/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.test.tsx b/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.test.tsx index bba876e6be..6ff9d8a1c5 100644 --- a/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.test.tsx +++ b/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.test.tsx @@ -19,7 +19,7 @@ import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { CookieAuthRefreshProvider } from './CookieAuthRefreshProvider'; import { - MockStorageApi, + mockApis, TestApiProvider, renderInTestApp, } from '@backstage/test-utils'; @@ -30,7 +30,6 @@ import { } from '@backstage/core-plugin-api'; describe('CookieAuthRefreshProvider', () => { - const storageApiMock = MockStorageApi.create(); const discoveryApiMock = { getBaseUrl: jest .fn() @@ -51,7 +50,7 @@ describe('CookieAuthRefreshProvider', () => { @@ -76,7 +75,7 @@ describe('CookieAuthRefreshProvider', () => { @@ -107,7 +106,7 @@ describe('CookieAuthRefreshProvider', () => { @@ -153,7 +152,7 @@ describe('CookieAuthRefreshProvider', () => { diff --git a/plugins/catalog-react/src/components/FavoriteEntity/FavoriteEntity.test.tsx b/plugins/catalog-react/src/components/FavoriteEntity/FavoriteEntity.test.tsx index d36700452a..ac06b3a34d 100644 --- a/plugins/catalog-react/src/components/FavoriteEntity/FavoriteEntity.test.tsx +++ b/plugins/catalog-react/src/components/FavoriteEntity/FavoriteEntity.test.tsx @@ -21,7 +21,7 @@ import { MockStarredEntitiesApi, starredEntitiesApiRef } from '../../apis'; import { FavoriteEntity } from './FavoriteEntity'; import { ComponentEntity } from '@backstage/catalog-model'; import { - MockStorageApi, + mockApis, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -41,14 +41,12 @@ const entity: ComponentEntity = { }, }; -const mockStorage = MockStorageApi.create(); - describe('', () => { it('should add to favorites', async () => { await renderInTestApp( @@ -79,7 +77,7 @@ describe('', () => { await renderInTestApp( diff --git a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx index 3f7c2034a0..7ff30dbf5f 100644 --- a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx @@ -34,7 +34,6 @@ import { } from '@backstage/catalog-client'; import { catalogApiRef } from '../../api'; import { - MockStorageApi, TestApiRegistry, mockApis, renderInTestApp, @@ -79,7 +78,7 @@ const apis = TestApiRegistry.from( [configApiRef, mockConfigApi], [catalogApiRef, mockCatalogApi], [identityApiRef, mockIdentityApi], - [storageApiRef, MockStorageApi.create()], + [storageApiRef, mockApis.storage()], [starredEntitiesApiRef, mockStarredEntitiesApi], ); @@ -134,19 +133,13 @@ describe('', () => { beforeEach(() => { mockCatalogApi.getEntityByRef?.mockResolvedValue(mockUser); - mockIdentityApi.getBackstageIdentity?.mockResolvedValue({ - ownershipEntityRefs, - type: 'user', - userEntityRef: 'user:default/testuser', - }); - mockCatalogApi.queryEntities?.mockImplementation( mockQueryEntitiesImplementation, ); }); afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('renders filter groups', async () => { diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx index 067ca33fa3..4ef6b175ae 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx @@ -23,11 +23,7 @@ import { identityApiRef, storageApiRef, } from '@backstage/core-plugin-api'; -import { - MockStorageApi, - TestApiProvider, - mockApis, -} from '@backstage/test-utils'; +import { TestApiProvider, mockApis } from '@backstage/test-utils'; import { act, renderHook, waitFor } from '@testing-library/react'; import qs from 'qs'; import React, { PropsWithChildren } from 'react'; @@ -69,8 +65,6 @@ const entities: Entity[] = [ }, ]; -const mockConfigApi = mockApis.config(); - const ownershipEntityRefs = ['user:default/guest']; const mockIdentityApi = mockApis.identity({ @@ -104,10 +98,10 @@ const createWrapper = { describe('constructor', () => { it('should call migration', () => { const api = new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }); expect(performMigrationToTheNewBucket).toHaveBeenCalledTimes(1); expect(api).toBeDefined(); @@ -54,7 +54,7 @@ describe('DefaultStarredEntitiesApi', () => { it('should notify and toggle starred entities', async () => { const entityRef = 'component:default/mock'; - const storageApi = MockStorageApi.create(); + const storageApi = mockApis.storage(); const storageBucket = storageApi.forBucket('starredEntities'); const api = new DefaultStarredEntitiesApi({ storageApi }); @@ -85,7 +85,7 @@ describe('DefaultStarredEntitiesApi', () => { it('should read starred entities from storage', async () => { const entityRef = 'component:default/mock'; - const storageApi = MockStorageApi.create(); + const storageApi = mockApis.storage(); const storageBucket = storageApi.forBucket('starredEntities'); storageBucket.set('entityRefs', [entityRef]); const api = new DefaultStarredEntitiesApi({ storageApi }); diff --git a/plugins/catalog/src/apis/StarredEntitiesApi/migration.test.ts b/plugins/catalog/src/apis/StarredEntitiesApi/migration.test.ts index c9083969ee..9f99c6e2dd 100644 --- a/plugins/catalog/src/apis/StarredEntitiesApi/migration.test.ts +++ b/plugins/catalog/src/apis/StarredEntitiesApi/migration.test.ts @@ -15,18 +15,18 @@ */ import { StorageApi } from '@backstage/core-plugin-api'; -import { MockStorageApi } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; import { performMigrationToTheNewBucket } from './migration'; describe('performMigrationToTheNewBucket', () => { let mockStorage: StorageApi; beforeEach(() => { - mockStorage = MockStorageApi.create(); + mockStorage = mockApis.storage(); }); afterEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); it('should migrate', async () => { diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx index 38310bbbf5..07cf98359e 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx @@ -26,7 +26,6 @@ import { } from '@backstage/plugin-catalog-react'; import { mockBreakpoint } from '@backstage/core-components/testUtils'; import { - MockStorageApi, TestApiProvider, mockApis, renderInTestApp, @@ -49,7 +48,6 @@ describe('DefaultCatalogPage', () => { }); afterEach(() => { window.history.replaceState = origReplaceState; - jest.clearAllMocks(); }); @@ -166,7 +164,6 @@ describe('DefaultCatalogPage', () => { ownershipEntityRefs: ['user:default/guest', 'group:default/tools'], displayName: 'Display Name', }); - const storageApi = MockStorageApi.create(); const renderWrapped = (children: React.ReactNode) => renderInTestApp( @@ -174,7 +171,7 @@ describe('DefaultCatalogPage', () => { apis={[ [catalogApiRef, catalogApi], [identityApiRef, identityApi], - [storageApiRef, storageApi], + [storageApiRef, mockApis.storage()], [starredEntitiesApiRef, new MockStarredEntitiesApi()], [permissionApiRef, mockApis.permission()], ]} diff --git a/plugins/home/src/api/VisitsStorageApi.test.ts b/plugins/home/src/api/VisitsStorageApi.test.ts index 206cf42689..55cf623149 100644 --- a/plugins/home/src/api/VisitsStorageApi.test.ts +++ b/plugins/home/src/api/VisitsStorageApi.test.ts @@ -15,7 +15,7 @@ */ import { VisitsStorageApi } from './VisitsStorageApi'; -import { MockStorageApi, mockApis } from '@backstage/test-utils'; +import { mockApis } from '@backstage/test-utils'; import { Visit, VisitsApi } from './VisitsApi'; describe('VisitsStorageApi.create', () => { @@ -42,7 +42,7 @@ describe('VisitsStorageApi.create', () => { it('instantiates', () => { const api = VisitsStorageApi.create({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), identityApi: mockIdentityApi, }); expect(api).toBeTruthy(); @@ -51,7 +51,7 @@ describe('VisitsStorageApi.create', () => { describe('.save()', () => { it('saves a visit', async () => { const api = VisitsStorageApi.create({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), identityApi: mockIdentityApi, }); const visit = { @@ -68,7 +68,7 @@ describe('VisitsStorageApi.create', () => { it('can control the number of stored entities', async () => { const api = VisitsStorageApi.create({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), identityApi: mockIdentityApi, limit: 2, }); @@ -102,7 +102,7 @@ describe('VisitsStorageApi.create', () => { it('correctly bumps the hits from a previous visit', async () => { const api = VisitsStorageApi.create({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), identityApi: mockIdentityApi, }); const visit = { @@ -144,7 +144,7 @@ describe('VisitsStorageApi.create', () => { beforeEach(() => { api = VisitsStorageApi.create({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), identityApi: mockIdentityApi, }); diff --git a/plugins/scaffolder-react/src/next/components/TemplateCard/CardHeader.test.tsx b/plugins/scaffolder-react/src/next/components/TemplateCard/CardHeader.test.tsx index 58033b718c..9ae2a507dd 100644 --- a/plugins/scaffolder-react/src/next/components/TemplateCard/CardHeader.test.tsx +++ b/plugins/scaffolder-react/src/next/components/TemplateCard/CardHeader.test.tsx @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import React from 'react'; import { fireEvent } from '@testing-library/react'; import { CardHeader } from './CardHeader'; import { ThemeProvider } from '@material-ui/core/styles'; import { lightTheme } from '@backstage/theme'; import { - MockStorageApi, + mockApis, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -44,7 +45,7 @@ describe('CardHeader', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], ]} @@ -75,7 +76,7 @@ describe('CardHeader', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], ]} @@ -135,7 +136,7 @@ describe('CardHeader', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], ]} @@ -164,7 +165,7 @@ describe('CardHeader', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], ]} diff --git a/plugins/scaffolder-react/src/next/components/TemplateCard/TemplateCard.test.tsx b/plugins/scaffolder-react/src/next/components/TemplateCard/TemplateCard.test.tsx index 5b2324b222..673f1e4a9e 100644 --- a/plugins/scaffolder-react/src/next/components/TemplateCard/TemplateCard.test.tsx +++ b/plugins/scaffolder-react/src/next/components/TemplateCard/TemplateCard.test.tsx @@ -21,7 +21,6 @@ import { } from '@backstage/plugin-catalog-react'; import { mockApis, - MockStorageApi, renderInTestApp, TestApiProvider, } from '@backstage/test-utils'; @@ -52,7 +51,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -82,7 +81,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -114,7 +113,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -144,7 +143,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -180,7 +179,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -220,7 +219,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -265,7 +264,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -314,7 +313,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -357,7 +356,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -397,7 +396,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -437,7 +436,7 @@ describe('TemplateCard', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [ diff --git a/plugins/scaffolder/src/alpha/components/TemplateListPage/TemplateListPage.test.tsx b/plugins/scaffolder/src/alpha/components/TemplateListPage/TemplateListPage.test.tsx index a02c90f687..01274cf6a6 100644 --- a/plugins/scaffolder/src/alpha/components/TemplateListPage/TemplateListPage.test.tsx +++ b/plugins/scaffolder/src/alpha/components/TemplateListPage/TemplateListPage.test.tsx @@ -22,7 +22,6 @@ import { import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { permissionApiRef } from '@backstage/plugin-permission-react'; import { - MockStorageApi, renderInTestApp, TestApiProvider, mockApis, @@ -53,7 +52,7 @@ describe('TemplateListPage', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -75,7 +74,7 @@ describe('TemplateListPage', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -98,7 +97,7 @@ describe('TemplateListPage', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -120,7 +119,7 @@ describe('TemplateListPage', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -143,7 +142,7 @@ describe('TemplateListPage', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -165,7 +164,7 @@ describe('TemplateListPage', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], @@ -186,7 +185,7 @@ describe('TemplateListPage', () => { [ starredEntitiesApiRef, new DefaultStarredEntitiesApi({ - storageApi: MockStorageApi.create(), + storageApi: mockApis.storage(), }), ], [permissionApiRef, mockApis.permission()], diff --git a/plugins/techdocs/src/home/components/DefaultTechDocsHome.test.tsx b/plugins/techdocs/src/home/components/DefaultTechDocsHome.test.tsx index 513a56265c..4c3be25325 100644 --- a/plugins/techdocs/src/home/components/DefaultTechDocsHome.test.tsx +++ b/plugins/techdocs/src/home/components/DefaultTechDocsHome.test.tsx @@ -14,22 +14,18 @@ * limitations under the License. */ -import { ApiProvider, ConfigReader } from '@backstage/core-app-api'; -import { - ConfigApi, - configApiRef, - storageApiRef, -} from '@backstage/core-plugin-api'; +import { ApiProvider } from '@backstage/core-app-api'; +import { configApiRef, storageApiRef } from '@backstage/core-plugin-api'; import { + MockStarredEntitiesApi, catalogApiRef, starredEntitiesApiRef, - MockStarredEntitiesApi, } from '@backstage/plugin-catalog-react'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; import { - MockStorageApi, - renderInTestApp, TestApiRegistry, + mockApis, + renderInTestApp, } from '@backstage/test-utils'; import { screen } from '@testing-library/react'; import React from 'react'; @@ -50,18 +46,14 @@ const mockCatalogApi = catalogApiMock({ }); describe('TechDocs Home', () => { - const configApi: ConfigApi = new ConfigReader({ - organization: { - name: 'My Company', - }, + const configApi = mockApis.config({ + data: { organization: { name: 'My Company' } }, }); - const storageApi = MockStorageApi.create(); - const apiRegistry = TestApiRegistry.from( [catalogApiRef, mockCatalogApi], [configApiRef, configApi], - [storageApiRef, storageApi], + [storageApiRef, mockApis.storage()], [starredEntitiesApiRef, new MockStarredEntitiesApi()], ); diff --git a/plugins/techdocs/src/home/components/Grids/EntityListDocsGrid.test.tsx b/plugins/techdocs/src/home/components/Grids/EntityListDocsGrid.test.tsx index 947c81ae85..25471d0769 100644 --- a/plugins/techdocs/src/home/components/Grids/EntityListDocsGrid.test.tsx +++ b/plugins/techdocs/src/home/components/Grids/EntityListDocsGrid.test.tsx @@ -14,12 +14,8 @@ * limitations under the License. */ -import { ApiProvider, ConfigReader } from '@backstage/core-app-api'; -import { - ConfigApi, - configApiRef, - storageApiRef, -} from '@backstage/core-plugin-api'; +import { ApiProvider } from '@backstage/core-app-api'; +import { configApiRef, storageApiRef } from '@backstage/core-plugin-api'; import { catalogApiRef, starredEntitiesApiRef, @@ -30,9 +26,9 @@ import { catalogApiMock, } from '@backstage/plugin-catalog-react/testUtils'; import { - MockStorageApi, renderInTestApp, TestApiRegistry, + mockApis, } from '@backstage/test-utils'; import { screen } from '@testing-library/react'; import React from 'react'; @@ -68,21 +64,17 @@ const mockCatalogApi = catalogApiMock({ entities }); describe('Entity List Docs Grid', () => { beforeEach(() => { - jest.resetAllMocks(); + jest.clearAllMocks(); }); - const configApi: ConfigApi = new ConfigReader({ - organization: { - name: 'My Company', - }, + const configApi = mockApis.config({ + data: { organization: { name: 'My Company' } }, }); - const storageApi = MockStorageApi.create(); - const apiRegistry = TestApiRegistry.from( [catalogApiRef, mockCatalogApi], [configApiRef, configApi], - [storageApiRef, storageApi], + [storageApiRef, mockApis.storage()], [starredEntitiesApiRef, new MockStarredEntitiesApi()], ); From d081861694552a84f04d060bbbbbd483bef38a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 9 Oct 2024 14:34:58 +0200 Subject: [PATCH 088/268] implement translation too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/thin-chairs-ring.md | 3 + packages/test-utils/report-alpha.api.md | 10 +- packages/test-utils/report.api.md | 54 +++-- .../apis/AnalyticsApi/MockAnalyticsApi.ts | 2 +- .../apis/PermissionApi/MockPermissionApi.ts | 2 +- .../apis/StorageApi/MockStorageApi.ts | 4 +- .../apis/TranslationApi/MockTranslationApi.ts | 5 +- .../src/testUtils/apis/mockApis.test.tsx | 223 +++++++++++++++++- .../test-utils/src/testUtils/apis/mockApis.ts | 57 +++-- .../src/hooks/useEntityListProvider.test.tsx | 3 +- 10 files changed, 301 insertions(+), 62 deletions(-) diff --git a/.changeset/thin-chairs-ring.md b/.changeset/thin-chairs-ring.md index 5561b6f551..104c78a96d 100644 --- a/.changeset/thin-chairs-ring.md +++ b/.changeset/thin-chairs-ring.md @@ -5,7 +5,10 @@ Added a `mockApis` export, which will replace the `MockX` API implementation classes and their related types. This is analogous with the backend's `mockServices`. +**DEPRECATED** several old helpers: + - Deprecated `MockAnalyticsApi`, please use `mockApis.analytics` instead. - Deprecated `MockConfigApi`, please use `mockApis.config` instead. - Deprecated `MockPermissionApi`, please use `mockApis.permission` instead. - Deprecated `MockStorageApi`, please use `mockApis.storage` instead. +- Deprecated `MockTranslationApi`, please use `mockApis.translation` instead. diff --git a/packages/test-utils/report-alpha.api.md b/packages/test-utils/report-alpha.api.md index ba098135fb..19a3786fc9 100644 --- a/packages/test-utils/report-alpha.api.md +++ b/packages/test-utils/report-alpha.api.md @@ -8,7 +8,7 @@ import { TranslationApi } from '@backstage/core-plugin-api/alpha'; import { TranslationRef } from '@backstage/core-plugin-api/alpha'; import { TranslationSnapshot } from '@backstage/core-plugin-api/alpha'; -// @alpha (undocumented) +// @alpha @deprecated (undocumented) export class MockTranslationApi implements TranslationApi { // (undocumented) static create(): MockTranslationApi; @@ -30,10 +30,10 @@ export class MockTranslationApi implements TranslationApi { // Warnings were encountered during analysis: // -// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:4:1 - (ae-undocumented) Missing documentation for "MockTranslationApi". -// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:6:5 - (ae-undocumented) Missing documentation for "create". -// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:8:5 - (ae-undocumented) Missing documentation for "getTranslation". -// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:11:5 - (ae-undocumented) Missing documentation for "translation$". +// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:7:1 - (ae-undocumented) Missing documentation for "MockTranslationApi". +// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:9:5 - (ae-undocumented) Missing documentation for "create". +// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:11:5 - (ae-undocumented) Missing documentation for "getTranslation". +// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:14:5 - (ae-undocumented) Missing documentation for "translation$". // (No @packageDocumentation comment for this package) ``` diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index 0845218a33..167494d4f6 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -41,6 +41,7 @@ import { RenderResult } from '@testing-library/react'; import { RouteRef } from '@backstage/core-plugin-api'; import { StorageApi } from '@backstage/core-plugin-api'; import { StorageValueSnapshot } from '@backstage/core-plugin-api'; +import { TranslationApi } from '@backstage/core-plugin-api/alpha'; // @public export type ApiMock = { @@ -81,8 +82,6 @@ export type LogCollector = AsyncLogCollector | SyncLogCollector; // @public export type LogFuncs = 'log' | 'warn' | 'error'; -// Warning: (ae-unresolved-link) The @link reference could not be resolved: The reference is ambiguous because "analytics" has more than one declaration; you need to add a TSDoc member reference selector -// // @public @deprecated export class MockAnalyticsApi implements AnalyticsApi { // (undocumented) @@ -193,6 +192,17 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } + // (undocumented) + export function translation(): jest.Mocked; + // (undocumented) + export namespace translation { + const // (undocumented) + factory: () => ApiFactory; + const // (undocumented) + mock: ( + partialImpl?: Partial | undefined, + ) => ApiMock; + } } // @public @deprecated @@ -264,8 +274,6 @@ export interface MockFetchApiOptions { }; } -// Warning: (ae-unresolved-link) The @link reference could not be resolved: No member was found with name "permissions" -// // @public @deprecated export class MockPermissionApi implements PermissionApi { constructor( @@ -279,8 +287,6 @@ export class MockPermissionApi implements PermissionApi { ): Promise; } -// Warning: (ae-unresolved-link) The @link reference could not be resolved: The reference is ambiguous because "storage" has more than one declaration; you need to add a TSDoc member reference selector -// // @public @deprecated export class MockStorageApi implements StorageApi { // (undocumented) @@ -299,8 +305,6 @@ export class MockStorageApi implements StorageApi { snapshot(key: string): StorageValueSnapshot; } -// Warning: (ae-unresolved-link) The @link reference could not be resolved: The reference is ambiguous because "storage" has more than one declaration; you need to add a TSDoc member reference selector -// // @public @deprecated export type MockStorageBucket = { [key: string]: any; @@ -413,20 +417,24 @@ export function wrapInTestApp( // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:24:5 - (ae-undocumented) Missing documentation for "set". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:25:5 - (ae-undocumented) Missing documentation for "remove". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:26:5 - (ae-undocumented) Missing documentation for "observe$". -// src/testUtils/apis/mockApis.d.ts:46:5 - (ae-undocumented) Missing documentation for "analytics". // src/testUtils/apis/mockApis.d.ts:47:5 - (ae-undocumented) Missing documentation for "analytics". -// src/testUtils/apis/mockApis.d.ts:48:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:49:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:100:5 - (ae-undocumented) Missing documentation for "identity". -// src/testUtils/apis/mockApis.d.ts:108:5 - (ae-undocumented) Missing documentation for "identity". -// src/testUtils/apis/mockApis.d.ts:109:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:117:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:119:5 - (ae-undocumented) Missing documentation for "permission". -// src/testUtils/apis/mockApis.d.ts:122:5 - (ae-undocumented) Missing documentation for "permission". -// src/testUtils/apis/mockApis.d.ts:123:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:126:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:128:5 - (ae-undocumented) Missing documentation for "storage". -// src/testUtils/apis/mockApis.d.ts:131:5 - (ae-undocumented) Missing documentation for "storage". -// src/testUtils/apis/mockApis.d.ts:132:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:135:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:48:5 - (ae-undocumented) Missing documentation for "analytics". +// src/testUtils/apis/mockApis.d.ts:49:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:50:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:101:5 - (ae-undocumented) Missing documentation for "identity". +// src/testUtils/apis/mockApis.d.ts:109:5 - (ae-undocumented) Missing documentation for "identity". +// src/testUtils/apis/mockApis.d.ts:110:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:118:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:120:5 - (ae-undocumented) Missing documentation for "permission". +// src/testUtils/apis/mockApis.d.ts:123:5 - (ae-undocumented) Missing documentation for "permission". +// src/testUtils/apis/mockApis.d.ts:124:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:127:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:129:5 - (ae-undocumented) Missing documentation for "storage". +// src/testUtils/apis/mockApis.d.ts:132:5 - (ae-undocumented) Missing documentation for "storage". +// src/testUtils/apis/mockApis.d.ts:133:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:136:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:138:5 - (ae-undocumented) Missing documentation for "translation". +// src/testUtils/apis/mockApis.d.ts:139:5 - (ae-undocumented) Missing documentation for "translation". +// src/testUtils/apis/mockApis.d.ts:140:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:141:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/test-utils/src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.ts b/packages/test-utils/src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.ts index 8c3ef4b326..788d2ca0d8 100644 --- a/packages/test-utils/src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.ts +++ b/packages/test-utils/src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.ts @@ -21,7 +21,7 @@ import { AnalyticsApi, AnalyticsEvent } from '@backstage/core-plugin-api'; * Use getEvents in tests to verify captured events. * * @public - * @deprecated Use {@link mockApis.analytics} instead + * @deprecated Use {@link @backstage/test-utils#mockApis.(analytics:namespace)} instead */ export class MockAnalyticsApi implements AnalyticsApi { private events: AnalyticsEvent[] = []; diff --git a/packages/test-utils/src/testUtils/apis/PermissionApi/MockPermissionApi.ts b/packages/test-utils/src/testUtils/apis/PermissionApi/MockPermissionApi.ts index 3e5e4c9875..6bd3c5d4c5 100644 --- a/packages/test-utils/src/testUtils/apis/PermissionApi/MockPermissionApi.ts +++ b/packages/test-utils/src/testUtils/apis/PermissionApi/MockPermissionApi.ts @@ -26,7 +26,7 @@ import { * {@link @backstage/plugin-permission-react#PermissionApi}. Supply a * requestHandler function to override the mock result returned for a given * request. - * @deprecated Use {@link mockApis.permissions} instead + * @deprecated Use {@link @backstage/test-utils#mockApis.(permission:namespace)} instead * @public */ export class MockPermissionApi implements PermissionApi { diff --git a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts index 5ef3846bfa..2fb70834ef 100644 --- a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts +++ b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts @@ -20,14 +20,14 @@ import ObservableImpl from 'zen-observable'; /** * Type for map holding data in {@link MockStorageApi} - * @deprecated Use {@link mockApis.storage} instead + * @deprecated Use {@link @backstage/test-utils#mockApis.(storage:namespace)} instead * @public */ export type MockStorageBucket = { [key: string]: any }; /** * Mock implementation of the {@link core-plugin-api#StorageApi} to be used in tests - * @deprecated Use {@link mockApis.storage} instead + * @deprecated Use {@link @backstage/test-utils#mockApis.(storage:namespace)} instead * @public */ export class MockStorageApi implements StorageApi { diff --git a/packages/test-utils/src/testUtils/apis/TranslationApi/MockTranslationApi.ts b/packages/test-utils/src/testUtils/apis/TranslationApi/MockTranslationApi.ts index 608b634cc4..46c5bfd5d3 100644 --- a/packages/test-utils/src/testUtils/apis/TranslationApi/MockTranslationApi.ts +++ b/packages/test-utils/src/testUtils/apis/TranslationApi/MockTranslationApi.ts @@ -30,7 +30,10 @@ import { toInternalTranslationRef } from '../../../../../core-plugin-api/src/tra const DEFAULT_LANGUAGE = 'en'; -/** @alpha */ +/** + * @alpha + * @deprecated Use `mockApis` from `@backstage/test-utils` instead + */ export class MockTranslationApi implements TranslationApi { static create() { const i18n = createI18n({ diff --git a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx index 87b9472377..662567066c 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx +++ b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx @@ -19,6 +19,9 @@ import { createPermission, } from '@backstage/plugin-permission-common'; import { mockApis } from './mockApis'; +import { JsonValue } from '@backstage/types'; +import { StorageValueSnapshot } from '@backstage/core-plugin-api'; +import { createTranslationRef } from '@backstage/core-plugin-api/alpha'; describe('mockApis', () => { describe('analytics', () => { @@ -537,6 +540,224 @@ describe('mockApis', () => { expect(notEmpty.forBucket).toHaveBeenCalledTimes(1); }); - it('can create a mock and make assertions on it', () => {}); + it('can create a mock and make assertions on it', () => { + const empty = mockApis.storage.mock(); + expect(empty.snapshot('a')).toBeUndefined(); + expect(empty.snapshot).toHaveBeenCalledTimes(1); + + const notEmpty = mockApis.storage.mock({ + snapshot(k: string): StorageValueSnapshot { + return { key: k, presence: 'present', value: 'v' as T }; + }, + }); + expect(notEmpty.snapshot('a')).toEqual({ + key: 'a', + presence: 'present', + value: 'v', + }); + expect(notEmpty.snapshot).toHaveBeenCalledTimes(1); + }); + }); + + describe('translation', () => { + describe('instance deep tests', () => { + function snapshotWithMessages< + const TMessages extends { [key in string]: string }, + >(messages: TMessages) { + const translationApi = mockApis.translation(); + const ref = createTranslationRef({ + id: 'test', + messages, + }); + const snapshot = translationApi.getTranslation(ref); + if (!snapshot.ready) { + throw new Error('Translation snapshot is not ready'); + } + return snapshot; + } + + it('should format plain messages', () => { + const snapshot = snapshotWithMessages({ + foo: 'Foo', + bar: 'Bar', + baz: 'Baz', + }); + + expect(snapshot.t('foo')).toBe('Foo'); + expect(snapshot.t('bar')).toBe('Bar'); + expect(snapshot.t('baz')).toBe('Baz'); + }); + + it('should support interpolation', () => { + const snapshot = snapshotWithMessages({ + shallow: 'Foo {{ bar }}', + multiple: 'Foo {{ bar }} {{ baz }}', + deep: 'Foo {{ bar.baz }}', + }); + + // @ts-expect-error + expect(snapshot.t('shallow')).toBe('Foo {{ bar }}'); + expect(snapshot.t('shallow', { bar: 'Bar' })).toBe('Foo Bar'); + + // @ts-expect-error + expect(snapshot.t('multiple')).toBe('Foo {{ bar }} {{ baz }}'); + // @ts-expect-error + expect(snapshot.t('multiple', { bar: 'Bar' })).toBe( + 'Foo Bar {{ baz }}', + ); + expect(snapshot.t('multiple', { bar: 'Bar', baz: 'Baz' })).toBe( + 'Foo Bar Baz', + ); + + // @ts-expect-error + expect(snapshot.t('deep')).toBe('Foo {{ bar.baz }}'); + expect(snapshot.t('deep', { bar: { baz: 'Baz' } })).toBe('Foo Baz'); + }); + + // Escaping isn't as useful in React, since we don't need to escape HTML in strings + it('should not escape by default', () => { + const snapshot = snapshotWithMessages({ + foo: 'Foo {{ foo }}', + }); + + expect(snapshot.t('foo', { foo: '
' })).toBe('Foo
'); + expect( + snapshot.t('foo', { + foo: '
', + interpolation: { escapeValue: true }, + }), + ).toBe('Foo <div>'); + }); + + it('should support nesting', () => { + const snapshot = snapshotWithMessages({ + foo: 'Foo $t(bar) $t(baz)', + bar: 'Nested', + baz: 'Baz {{ qux }}', + }); + + expect(snapshot.t('foo', { qux: 'Deep' })).toBe('Foo Nested Baz Deep'); + }); + + it('should support formatting', () => { + const snapshot = snapshotWithMessages({ + plain: '= {{ x }}', + number: '= {{ x, number }}', + numberFixed: '= {{ x, number(minimumFractionDigits: 2) }}', + relativeTime: '= {{ x, relativeTime }}', + relativeSeconds: '= {{ x, relativeTime(second) }}', + relativeSecondsShort: + '= {{ x, relativeTime(range: second; style: short) }}', + list: '= {{ x, list }}', + }); + + expect(snapshot.t('plain', { x: '5' })).toBe('= 5'); + expect(snapshot.t('number', { x: 5 })).toBe('= 5'); + expect( + snapshot.t('number', { + x: 5, + formatParams: { x: { minimumFractionDigits: 1 } }, + }), + ).toBe('= 5.0'); + expect(snapshot.t('numberFixed', { x: 5 })).toBe('= 5.00'); + expect( + snapshot.t('numberFixed', { + x: 5, + formatParams: { x: { minimumFractionDigits: 3 } }, + }), + ).toBe('= 5.000'); + expect(snapshot.t('relativeTime', { x: 3 })).toBe('= in 3 days'); + expect(snapshot.t('relativeTime', { x: -3 })).toBe('= 3 days ago'); + expect( + snapshot.t('relativeTime', { + x: 15, + formatParams: { x: { range: 'weeks' } }, + }), + ).toBe('= in 15 weeks'); + expect( + snapshot.t('relativeTime', { + x: 15, + formatParams: { x: { range: 'weeks', style: 'short' } }, + }), + ).toBe('= in 15 wk.'); + expect(snapshot.t('relativeSeconds', { x: 1 })).toBe('= in 1 second'); + expect(snapshot.t('relativeSeconds', { x: 2 })).toBe('= in 2 seconds'); + expect(snapshot.t('relativeSeconds', { x: -3 })).toBe( + '= 3 seconds ago', + ); + expect(snapshot.t('relativeSeconds', { x: 0 })).toBe('= in 0 seconds'); + expect(snapshot.t('relativeSecondsShort', { x: 1 })).toBe( + '= in 1 sec.', + ); + expect(snapshot.t('relativeSecondsShort', { x: 2 })).toBe( + '= in 2 sec.', + ); + expect(snapshot.t('relativeSecondsShort', { x: -3 })).toBe( + '= 3 sec. ago', + ); + expect(snapshot.t('relativeSecondsShort', { x: 0 })).toBe( + '= in 0 sec.', + ); + expect(snapshot.t('list', { x: ['a'] })).toBe('= a'); + expect(snapshot.t('list', { x: ['a', 'b'] })).toBe('= a and b'); + expect(snapshot.t('list', { x: ['a', 'b', 'c'] })).toBe( + '= a, b, and c', + ); + }); + + it('should support plurals', () => { + const snapshot = snapshotWithMessages({ + derp_one: 'derp', + derp_other: 'derps', + derpWithCount_one: '{{ count }} derp', + derpWithCount_other: '{{ count }} derps', + }); + + expect(snapshot.t('derp', { count: 1 })).toBe('derp'); + expect(snapshot.t('derp', { count: 2 })).toBe('derps'); + expect(snapshot.t('derp', { count: 0 })).toBe('derps'); + expect(snapshot.t('derpWithCount', { count: 1 })).toBe('1 derp'); + expect(snapshot.t('derpWithCount', { count: 2 })).toBe('2 derps'); + expect(snapshot.t('derpWithCount', { count: 0 })).toBe('0 derps'); + }); + }); + + it('can create an instance and make assertions on it', () => { + const translation = mockApis.translation(); + const ref = createTranslationRef({ + id: 'test', + messages: { a: 'b' }, + }); + const result = translation.getTranslation(ref); + if (!result.ready) { + throw new Error('not ready'); + } + expect(result.t('a')).toEqual('b'); + expect(translation.getTranslation).toHaveBeenCalledTimes(1); + }); + + it('can create a mock and make assertions on it', () => { + const ref = createTranslationRef({ + id: 'test', + messages: { a: 'b' }, + }); + + const empty = mockApis.translation.mock(); + expect(empty.getTranslation(ref)).toBeUndefined(); + + const notEmpty = mockApis.translation.mock({ + getTranslation: () => + ({ + ready: true, + t: () => 'b', + } as any), + }); + const result = notEmpty.getTranslation(ref); + if (!result.ready) { + throw new Error('not ready'); + } + expect(result.t('a')).toEqual('b'); + expect(notEmpty.getTranslation).toHaveBeenCalledTimes(1); + }); }); }); diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index 7a334c69b6..cfc174c5ad 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -40,6 +40,11 @@ import { JsonObject } from '@backstage/types'; import { ApiMock } from './ApiMock'; import { MockPermissionApi } from './PermissionApi'; import { MockStorageApi } from './StorageApi'; +import { + TranslationApi, + translationApiRef, +} from '@backstage/core-plugin-api/alpha'; +import { MockTranslationApi } from './TranslationApi'; /** @internal */ function simpleFactory( @@ -208,7 +213,7 @@ export namespace mockApis { email?: string; displayName?: string; picture?: string; - }) { + }): IdentityApi { const { userEntityRef = 'user:default/test', ownershipEntityRefs = ['user:default/test'], @@ -217,22 +222,18 @@ export namespace mockApis { displayName, picture, } = options ?? {}; - return simpleInstance( - identityApiRef, - { - async getBackstageIdentity() { - return { type: 'user', ownershipEntityRefs, userEntityRef }; - }, - async getCredentials() { - return { token }; - }, - async getProfileInfo() { - return { email, displayName, picture }; - }, - async signOut() {}, + return { + async getBackstageIdentity() { + return { type: 'user', ownershipEntityRefs, userEntityRef }; }, - identityMockSkeleton, - ); + async getCredentials() { + return { token }; + }, + async getProfileInfo() { + return { email, displayName, picture }; + }, + async signOut() {}, + }; } export namespace identity { export const factory = simpleFactory(identityApiRef, identity); @@ -261,11 +262,7 @@ export namespace mockApis { } else { authorize = () => authorizeInput; } - return simpleInstance( - permissionApiRef, - new MockPermissionApi(authorize), - permissionMockSkeleton, - ); + return new MockPermissionApi(authorize); } export namespace permission { export const factory = simpleFactory(permissionApiRef, permission); @@ -280,14 +277,22 @@ export namespace mockApis { snapshot: jest.fn(), }); export function storage(options?: { data?: JsonObject }) { - return simpleInstance( - storageApiRef, - MockStorageApi.create(options?.data), - storageMockSkeleton, - ); + return MockStorageApi.create(options?.data); } export namespace storage { export const factory = simpleFactory(storageApiRef, storage); export const mock = simpleMock(storageApiRef, storageMockSkeleton); } + + const translationMockSkeleton = (): jest.Mocked => ({ + getTranslation: jest.fn(), + translation$: jest.fn(), + }); + export function translation() { + return MockTranslationApi.create(); + } + export namespace translation { + export const factory = simpleFactory(translationApiRef, translation); + export const mock = simpleMock(translationApiRef, translationMockSkeleton); + } } diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx index 4ef6b175ae..2ed944d339 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx @@ -39,7 +39,6 @@ import { import { EntityListProvider, useEntityList } from './useEntityListProvider'; import { useMountEffect } from '@react-hookz/web'; import { translationApiRef } from '@backstage/core-plugin-api/alpha'; -import { MockTranslationApi } from '@backstage/test-utils/alpha'; import { EntityListPagination } from '../types'; const entities: Entity[] = [ @@ -104,7 +103,7 @@ const createWrapper = [storageApiRef, mockApis.storage()], [starredEntitiesApiRef, new MockStarredEntitiesApi()], [alertApiRef, { post: jest.fn() }], - [translationApiRef, MockTranslationApi.create()], + [translationApiRef, mockApis.translation()], [errorApiRef, { error$: jest.fn(), post: jest.fn() }], ]} > From 3afafea87b7143944b2279768291297c325ee075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 9 Oct 2024 16:33:39 +0200 Subject: [PATCH 089/268] implement discovery too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- ...ginProtocolResolverFetchMiddleware.test.ts | 22 ++++---- .../core-app-api/src/app/AppManager.test.tsx | 6 +- .../ProxiedSignInPage.test.tsx | 5 +- packages/test-utils/report.api.md | 55 +++++++++++++------ .../src/testUtils/apis/mockApis.test.tsx | 28 ++++++++++ .../test-utils/src/testUtils/apis/mockApis.ts | 30 ++++++++-- .../CookieAuthRefreshProvider.test.tsx | 8 +-- .../useCookieAuthRefresh.test.tsx | 10 +--- .../PodExecTerminal/PodExecTerminal.test.tsx | 9 ++- .../Pods/PodDrawer/PodDrawer.test.tsx | 12 ++-- plugins/signals/src/api/SignalsClient.test.ts | 11 ++-- .../TechDocsReaderPage.test.tsx | 8 +-- 12 files changed, 129 insertions(+), 75 deletions(-) diff --git a/packages/core-app-api/src/apis/implementations/FetchApi/PluginProtocolResolverFetchMiddleware.test.ts b/packages/core-app-api/src/apis/implementations/FetchApi/PluginProtocolResolverFetchMiddleware.test.ts index 3b4b7136bb..7a9ebdc4f9 100644 --- a/packages/core-app-api/src/apis/implementations/FetchApi/PluginProtocolResolverFetchMiddleware.test.ts +++ b/packages/core-app-api/src/apis/implementations/FetchApi/PluginProtocolResolverFetchMiddleware.test.ts @@ -14,15 +14,14 @@ * limitations under the License. */ -import { DiscoveryApi } from '@backstage/core-plugin-api'; +import { mockApis } from '@backstage/test-utils'; import { PluginProtocolResolverFetchMiddleware } from './PluginProtocolResolverFetchMiddleware'; describe('PluginProtocolResolverFetchMiddleware', () => { it.each([['https://passthrough.com/a']])( 'passes through regular URLs, %p', async url => { - const resolve = jest.fn(); - const discoveryApi = { getBaseUrl: resolve } as unknown as DiscoveryApi; + const discoveryApi = mockApis.discovery(); const middleware = new PluginProtocolResolverFetchMiddleware( discoveryApi, ); @@ -31,7 +30,7 @@ describe('PluginProtocolResolverFetchMiddleware', () => { await outer(url); expect(inner.mock.calls[0][0]).toBe(url); - expect(resolve).not.toHaveBeenCalled(); + expect(discoveryApi.getBaseUrl).not.toHaveBeenCalled(); }, ); @@ -76,30 +75,29 @@ describe('PluginProtocolResolverFetchMiddleware', () => { ])( 'resolves backstage URLs, %p', async (original, host, resolved, result) => { - const resolve = jest.fn(); - const discoveryApi = { getBaseUrl: resolve } as unknown as DiscoveryApi; + const discoveryApi = mockApis.discovery.mock({ + getBaseUrl: async () => resolved, + }); const middleware = new PluginProtocolResolverFetchMiddleware( discoveryApi, ); const inner = jest.fn(); const outer = middleware.apply(inner); - resolve.mockResolvedValueOnce(resolved); await outer(original); expect(inner.mock.calls[0][0]).toBe(result); - expect(resolve).toHaveBeenLastCalledWith(host); + expect(discoveryApi.getBaseUrl).toHaveBeenLastCalledWith(host); }, ); it('properly supports transferring request bodies too', async () => { - const resolve = jest.fn(); - const discoveryApi = { getBaseUrl: resolve } as unknown as DiscoveryApi; + const discoveryApi = mockApis.discovery.mock({ + getBaseUrl: async () => 'https://elsewhere.com', + }); const middleware = new PluginProtocolResolverFetchMiddleware(discoveryApi); const inner = jest.fn(); const outer = middleware.apply(inner); - resolve.mockResolvedValue('https://elsewhere.com'); - await outer('plugin://a', { method: 'POST', body: '123', diff --git a/packages/core-app-api/src/app/AppManager.test.tsx b/packages/core-app-api/src/app/AppManager.test.tsx index 1b7d2d28cb..d995edffdf 100644 --- a/packages/core-app-api/src/app/AppManager.test.tsx +++ b/packages/core-app-api/src/app/AppManager.test.tsx @@ -878,9 +878,9 @@ describe('Integration Test', () => { }), }), }; - const discoveryApiMock = { - getBaseUrl: jest.fn().mockResolvedValue('http://localhost:7007/app'), - }; + const discoveryApiMock = mockApis.discovery.mock({ + getBaseUrl: async () => 'http://localhost:7007/app', + }); const app = new AppManager({ icons, diff --git a/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.test.tsx b/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.test.tsx index e4e65b613f..ad7e650d24 100644 --- a/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.test.tsx +++ b/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.test.tsx @@ -20,6 +20,7 @@ import { rest } from 'msw'; import { setupServer } from 'msw/node'; import { TestApiProvider, + mockApis, registerMswTestHooks, wrapInTestApp, } from '@backstage/test-utils'; @@ -37,9 +38,7 @@ describe('ProxiedSignInPage', () => { apis={[ [ discoveryApiRef, - { - getBaseUrl: async () => 'http://example.com/api/auth', - }, + mockApis.discovery({ baseUrl: 'http://example.com' }), ], ]} > diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index 167494d4f6..cc09727d87 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -115,6 +115,25 @@ export namespace mockApis { const mock: (partialImpl?: Partial | undefined) => ApiMock; } // (undocumented) + export function discovery(options?: { baseUrl?: string }): jest.Mocked<{ + getBaseUrl(pluginId: string): Promise; + }>; + // (undocumented) + export namespace discovery { + const // (undocumented) + factory: ( + options?: + | { + baseUrl?: string | undefined; + } + | undefined, + ) => ApiFactory; + const // (undocumented) + mock: ( + partialImpl?: Partial | undefined, + ) => ApiMock; + } + // (undocumented) export function identity(options?: { userEntityRef?: string; ownershipEntityRefs?: string[]; @@ -421,20 +440,24 @@ export function wrapInTestApp( // src/testUtils/apis/mockApis.d.ts:48:5 - (ae-undocumented) Missing documentation for "analytics". // src/testUtils/apis/mockApis.d.ts:49:15 - (ae-undocumented) Missing documentation for "factory". // src/testUtils/apis/mockApis.d.ts:50:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:101:5 - (ae-undocumented) Missing documentation for "identity". -// src/testUtils/apis/mockApis.d.ts:109:5 - (ae-undocumented) Missing documentation for "identity". -// src/testUtils/apis/mockApis.d.ts:110:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:118:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:120:5 - (ae-undocumented) Missing documentation for "permission". -// src/testUtils/apis/mockApis.d.ts:123:5 - (ae-undocumented) Missing documentation for "permission". -// src/testUtils/apis/mockApis.d.ts:124:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:127:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:129:5 - (ae-undocumented) Missing documentation for "storage". -// src/testUtils/apis/mockApis.d.ts:132:5 - (ae-undocumented) Missing documentation for "storage". -// src/testUtils/apis/mockApis.d.ts:133:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:136:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:138:5 - (ae-undocumented) Missing documentation for "translation". -// src/testUtils/apis/mockApis.d.ts:139:5 - (ae-undocumented) Missing documentation for "translation". -// src/testUtils/apis/mockApis.d.ts:140:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:141:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:101:5 - (ae-undocumented) Missing documentation for "discovery". +// src/testUtils/apis/mockApis.d.ts:106:5 - (ae-undocumented) Missing documentation for "discovery". +// src/testUtils/apis/mockApis.d.ts:107:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:110:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:112:5 - (ae-undocumented) Missing documentation for "identity". +// src/testUtils/apis/mockApis.d.ts:120:5 - (ae-undocumented) Missing documentation for "identity". +// src/testUtils/apis/mockApis.d.ts:121:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:129:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:131:5 - (ae-undocumented) Missing documentation for "permission". +// src/testUtils/apis/mockApis.d.ts:134:5 - (ae-undocumented) Missing documentation for "permission". +// src/testUtils/apis/mockApis.d.ts:135:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:138:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:140:5 - (ae-undocumented) Missing documentation for "storage". +// src/testUtils/apis/mockApis.d.ts:143:5 - (ae-undocumented) Missing documentation for "storage". +// src/testUtils/apis/mockApis.d.ts:144:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:147:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:149:5 - (ae-undocumented) Missing documentation for "translation". +// src/testUtils/apis/mockApis.d.ts:150:5 - (ae-undocumented) Missing documentation for "translation". +// src/testUtils/apis/mockApis.d.ts:151:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:152:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx index 662567066c..af0bbaee72 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx +++ b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx @@ -79,6 +79,34 @@ describe('mockApis', () => { }); }); + describe('discovery', () => { + it('can create an instance and make assertions on it', async () => { + const empty = mockApis.discovery(); + await expect(empty.getBaseUrl('catalog')).resolves.toBe( + 'http://example.com/api/catalog', + ); + expect(empty.getBaseUrl).toHaveBeenCalledTimes(1); + + const notEmpty = mockApis.discovery({ baseUrl: 'https://other.net' }); + await expect(notEmpty.getBaseUrl('catalog')).resolves.toBe( + 'https://other.net/api/catalog', + ); + expect(notEmpty.getBaseUrl).toHaveBeenCalledTimes(1); + }); + + it('can create a mock and make assertions on it', async () => { + const empty = mockApis.discovery.mock(); + expect(empty.getBaseUrl('catalog')).toBeUndefined(); + expect(empty.getBaseUrl).toHaveBeenCalledTimes(1); + + const notEmpty = mockApis.discovery.mock({ + getBaseUrl: async () => 'replaced', + }); + await expect(notEmpty.getBaseUrl('catalog')).resolves.toBe('replaced'); + expect(notEmpty.getBaseUrl).toHaveBeenCalledTimes(1); + }); + }); + describe('identity', () => { it('can create an instance and make assertions on it', async () => { const empty = mockApis.identity(); diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index cfc174c5ad..1adf172893 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -20,14 +20,20 @@ import { ApiFactory, ApiRef, ConfigApi, + DiscoveryApi, IdentityApi, StorageApi, analyticsApiRef, configApiRef, createApiFactory, + discoveryApiRef, identityApiRef, storageApiRef, } from '@backstage/core-plugin-api'; +import { + TranslationApi, + translationApiRef, +} from '@backstage/core-plugin-api/alpha'; import { AuthorizeResult, EvaluatePermissionRequest, @@ -40,10 +46,6 @@ import { JsonObject } from '@backstage/types'; import { ApiMock } from './ApiMock'; import { MockPermissionApi } from './PermissionApi'; import { MockStorageApi } from './StorageApi'; -import { - TranslationApi, - translationApiRef, -} from '@backstage/core-plugin-api/alpha'; import { MockTranslationApi } from './TranslationApi'; /** @internal */ @@ -200,6 +202,26 @@ export namespace mockApis { })); } + const discoveryMockSkeleton = (): jest.Mocked => ({ + getBaseUrl: jest.fn(), + }); + export function discovery(options?: { baseUrl?: string }) { + const baseUrl = options?.baseUrl ?? 'http://example.com'; + return simpleInstance( + discoveryApiRef, + { + async getBaseUrl(pluginId: string) { + return `${baseUrl}/api/${pluginId}`; + }, + }, + discoveryMockSkeleton, + ); + } + export namespace discovery { + export const factory = simpleFactory(discoveryApiRef, discovery); + export const mock = simpleMock(discoveryApiRef, discoveryMockSkeleton); + } + const identityMockSkeleton = (): jest.Mocked => ({ getBackstageIdentity: jest.fn(), getCredentials: jest.fn(), diff --git a/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.test.tsx b/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.test.tsx index 6ff9d8a1c5..8b07abb163 100644 --- a/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.test.tsx +++ b/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.test.tsx @@ -30,11 +30,7 @@ import { } from '@backstage/core-plugin-api'; describe('CookieAuthRefreshProvider', () => { - const discoveryApiMock = { - getBaseUrl: jest - .fn() - .mockResolvedValue('http://localhost:7000/api/techdocs'), - }; + const discoveryApiMock = mockApis.discovery(); function getExpiresAtInFuture() { const tenMinutesInMilliseconds = 10 * 60 * 1000; @@ -118,7 +114,7 @@ describe('CookieAuthRefreshProvider', () => { await waitFor(() => expect(fetchApiMock.fetch).toHaveBeenCalledWith( - 'http://localhost:7000/api/techdocs/.backstage/auth/v1/cookie', + 'http://example.com/api/techdocs/.backstage/auth/v1/cookie', { credentials: 'include' }, ), ); diff --git a/plugins/auth-react/src/hooks/useCookieAuthRefresh/useCookieAuthRefresh.test.tsx b/plugins/auth-react/src/hooks/useCookieAuthRefresh/useCookieAuthRefresh.test.tsx index 422f392e93..6b59dbcb9e 100644 --- a/plugins/auth-react/src/hooks/useCookieAuthRefresh/useCookieAuthRefresh.test.tsx +++ b/plugins/auth-react/src/hooks/useCookieAuthRefresh/useCookieAuthRefresh.test.tsx @@ -17,15 +17,11 @@ import React from 'react'; import { renderHook, waitFor } from '@testing-library/react'; import { fetchApiRef, discoveryApiRef } from '@backstage/core-plugin-api'; -import { TestApiProvider } from '@backstage/test-utils'; +import { TestApiProvider, mockApis } from '@backstage/test-utils'; import { useCookieAuthRefresh } from './useCookieAuthRefresh'; describe('useCookieAuthRefresh', () => { - const discoveryApiMock = { - getBaseUrl: jest - .fn() - .mockResolvedValue('http://localhost:7000/api/techdocs'), - }; + const discoveryApiMock = mockApis.discovery(); const now = 1710316886171; const tenMinutesInMilliseconds = 10 * 60 * 1000; @@ -269,7 +265,7 @@ describe('useCookieAuthRefresh', () => { await waitFor(() => expect(fetchApiMock.fetch).toHaveBeenCalledWith( - 'http://localhost:7000/api/techdocs/.backstage/auth/v1/cookie', + 'http://example.com/api/techdocs/.backstage/auth/v1/cookie', { credentials: 'include' }, ), ); diff --git a/plugins/kubernetes-react/src/components/PodExecTerminal/PodExecTerminal.test.tsx b/plugins/kubernetes-react/src/components/PodExecTerminal/PodExecTerminal.test.tsx index 4aa6112436..0e56c9599a 100644 --- a/plugins/kubernetes-react/src/components/PodExecTerminal/PodExecTerminal.test.tsx +++ b/plugins/kubernetes-react/src/components/PodExecTerminal/PodExecTerminal.test.tsx @@ -14,8 +14,9 @@ * limitations under the License. */ -import { DiscoveryApi, discoveryApiRef } from '@backstage/core-plugin-api'; +import { discoveryApiRef } from '@backstage/core-plugin-api'; import { + mockApis, renderInTestApp, TestApiProvider, textContentMatcher, @@ -37,9 +38,7 @@ describe('PodExecTerminal', () => { const podName = 'pod1'; const podNamespace = 'podNamespace'; - const mockDiscoveryApi: Partial = { - getBaseUrl: () => Promise.resolve('http://localhost'), - }; + const mockDiscoveryApi = mockApis.discovery(); it('Should render an XTerm web terminal', async () => { await renderInTestApp( @@ -62,7 +61,7 @@ describe('PodExecTerminal', () => { it('Should connect to WebSocket server & render response', async () => { const server = new WS( - 'ws://localhost/proxy/api/v1/namespaces/podNamespace/pods/pod1/exec?container=container2&stdin=true&stdout=true&stderr=true&tty=true&command=%2Fbin%2Fsh', + 'ws://example.com/api/kubernetes/proxy/api/v1/namespaces/podNamespace/pods/pod1/exec?container=container2&stdin=true&stdout=true&stderr=true&tty=true&command=%2Fbin%2Fsh', ); await renderInTestApp( diff --git a/plugins/kubernetes-react/src/components/Pods/PodDrawer/PodDrawer.test.tsx b/plugins/kubernetes-react/src/components/Pods/PodDrawer/PodDrawer.test.tsx index 066fa0f874..4718f8f29f 100644 --- a/plugins/kubernetes-react/src/components/Pods/PodDrawer/PodDrawer.test.tsx +++ b/plugins/kubernetes-react/src/components/Pods/PodDrawer/PodDrawer.test.tsx @@ -17,19 +17,21 @@ import React from 'react'; import { screen } from '@testing-library/react'; -import { TestApiProvider, renderInTestApp } from '@backstage/test-utils'; +import { + TestApiProvider, + mockApis, + renderInTestApp, +} from '@backstage/test-utils'; import '@testing-library/jest-dom'; import { PodDrawer } from './PodDrawer'; -import { DiscoveryApi, discoveryApiRef } from '@backstage/core-plugin-api'; +import { discoveryApiRef } from '@backstage/core-plugin-api'; jest.mock('../../../hooks/useIsPodExecTerminalSupported'); describe('PodDrawer', () => { it('Should show title and container names', async () => { - const mockDiscoveryApi: Partial = { - getBaseUrl: () => Promise.resolve('http://localhost'), - }; + const mockDiscoveryApi = mockApis.discovery(); await renderInTestApp( diff --git a/plugins/signals/src/api/SignalsClient.test.ts b/plugins/signals/src/api/SignalsClient.test.ts index 057b1fb23f..b6944cfdc1 100644 --- a/plugins/signals/src/api/SignalsClient.test.ts +++ b/plugins/signals/src/api/SignalsClient.test.ts @@ -14,24 +14,21 @@ * limitations under the License. */ -import { DiscoveryApi } from '@backstage/core-plugin-api'; import { mockApis } from '@backstage/test-utils'; import WS from 'jest-websocket-mock'; import { SignalClient } from './SignalClient'; describe('SignalsClient', () => { - const baseUrlFunction = jest.fn(); const identity = mockApis.identity({ token: '12345' }); - const discoveryApi = { - getBaseUrl: baseUrlFunction, - } as unknown as DiscoveryApi; + const discoveryApi = mockApis.discovery({ baseUrl: 'http://localhost:1234' }); let server: WS; beforeEach(async () => { jest.clearAllMocks(); - baseUrlFunction.mockResolvedValue('http://localhost:1234'); - server = new WS('ws://localhost:1234', { jsonProtocol: true }); + server = new WS('ws://localhost:1234/api/signals', { + jsonProtocol: true, + }); }); afterEach(() => { diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.test.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.test.tsx index 5d08355ae4..afb57e22ba 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.test.tsx @@ -81,12 +81,6 @@ const techdocsStorageApiMock: jest.Mocked = { syncEntityDocs: jest.fn(), }; -const discoveryApiMock = { - getBaseUrl: jest - .fn() - .mockResolvedValue('https://localhost:7000/api/techdocs'), -}; - const fetchApiMock = { fetch: jest.fn().mockResolvedValue({ ok: true, @@ -116,7 +110,7 @@ const Wrapper = ({ children }: { children: React.ReactNode }) => { Date: Wed, 9 Oct 2024 16:52:06 +0200 Subject: [PATCH 090/268] docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- packages/test-utils/report.api.md | 48 +++-------- .../test-utils/src/testUtils/apis/mockApis.ts | 79 +++++++++++++++++-- 2 files changed, 85 insertions(+), 42 deletions(-) diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index cc09727d87..ad5528d507 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -92,9 +92,7 @@ export class MockAnalyticsApi implements AnalyticsApi { // @public export namespace mockApis { - // (undocumented) export function analytics(): jest.Mocked; - // (undocumented) export namespace analytics { const // (undocumented) factory: () => ApiFactory; @@ -114,11 +112,9 @@ export namespace mockApis { ) => ApiFactory; const mock: (partialImpl?: Partial | undefined) => ApiMock; } - // (undocumented) export function discovery(options?: { baseUrl?: string }): jest.Mocked<{ getBaseUrl(pluginId: string): Promise; }>; - // (undocumented) export namespace discovery { const // (undocumented) factory: ( @@ -133,7 +129,6 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } - // (undocumented) export function identity(options?: { userEntityRef?: string; ownershipEntityRefs?: string[]; @@ -142,7 +137,6 @@ export namespace mockApis { displayName?: string; picture?: string; }): jest.Mocked; - // (undocumented) export namespace identity { const // (undocumented) factory: ( @@ -162,7 +156,6 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } - // (undocumented) export function permission(options?: { authorize?: | AuthorizeResult.ALLOW @@ -171,7 +164,6 @@ export namespace mockApis { request: EvaluatePermissionRequest, ) => AuthorizeResult.ALLOW | AuthorizeResult.DENY); }): jest.Mocked; - // (undocumented) export namespace permission { const // (undocumented) factory: ( @@ -192,11 +184,9 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } - // (undocumented) export function storage(options?: { data?: JsonObject; }): jest.Mocked; - // (undocumented) export namespace storage { const // (undocumented) factory: ( @@ -211,9 +201,7 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } - // (undocumented) export function translation(): jest.Mocked; - // (undocumented) export namespace translation { const // (undocumented) factory: () => ApiFactory; @@ -436,28 +424,16 @@ export function wrapInTestApp( // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:24:5 - (ae-undocumented) Missing documentation for "set". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:25:5 - (ae-undocumented) Missing documentation for "remove". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:26:5 - (ae-undocumented) Missing documentation for "observe$". -// src/testUtils/apis/mockApis.d.ts:47:5 - (ae-undocumented) Missing documentation for "analytics". -// src/testUtils/apis/mockApis.d.ts:48:5 - (ae-undocumented) Missing documentation for "analytics". -// src/testUtils/apis/mockApis.d.ts:49:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:50:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:101:5 - (ae-undocumented) Missing documentation for "discovery". -// src/testUtils/apis/mockApis.d.ts:106:5 - (ae-undocumented) Missing documentation for "discovery". -// src/testUtils/apis/mockApis.d.ts:107:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:110:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:112:5 - (ae-undocumented) Missing documentation for "identity". -// src/testUtils/apis/mockApis.d.ts:120:5 - (ae-undocumented) Missing documentation for "identity". -// src/testUtils/apis/mockApis.d.ts:121:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:129:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:131:5 - (ae-undocumented) Missing documentation for "permission". -// src/testUtils/apis/mockApis.d.ts:134:5 - (ae-undocumented) Missing documentation for "permission". -// src/testUtils/apis/mockApis.d.ts:135:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:138:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:140:5 - (ae-undocumented) Missing documentation for "storage". -// src/testUtils/apis/mockApis.d.ts:143:5 - (ae-undocumented) Missing documentation for "storage". -// src/testUtils/apis/mockApis.d.ts:144:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:147:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:149:5 - (ae-undocumented) Missing documentation for "translation". -// src/testUtils/apis/mockApis.d.ts:150:5 - (ae-undocumented) Missing documentation for "translation". -// src/testUtils/apis/mockApis.d.ts:151:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:152:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:59:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:60:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:128:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:131:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:153:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:161:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:180:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:183:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:200:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:203:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:218:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:219:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index 1adf172893..21bf0626ba 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -129,16 +129,26 @@ export namespace mockApis { const analyticsMockSkeleton = (): jest.Mocked => ({ captureEvent: jest.fn(), }); + /** + * Mock implementation of {@link @backstage/core-plugin-api#AnalyticsApi}. + * + * @public + */ export function analytics() { return analyticsMockSkeleton(); } + /** + * Mock implementations of {@link @backstage/core-plugin-api#AnalyticsApi}. + * + * @public + */ export namespace analytics { export const factory = simpleFactory(analyticsApiRef, analytics); export const mock = simpleMock(analyticsApiRef, analyticsMockSkeleton); } /** - * Fake implementation of {@link @backstage/frontend-plugin-api#ConfigApi} + * Fake implementation of {@link @backstage/core-plugin-api#ConfigApi} * with optional data supplied. * * @public @@ -149,7 +159,7 @@ export namespace mockApis { * data: { app: { baseUrl: 'https://example.com' } }, * }); * - * const rendered = await renderInTestApp( + * await renderInTestApp( * * * , @@ -160,15 +170,15 @@ export namespace mockApis { return new ConfigReader(options?.data, 'mock-config'); } /** - * Mock helpers for {@link @backstage/frontend-plugin-api#ConfigApi}. + * Mock helpers for {@link @backstage/core-plugin-api#ConfigApi}. * - * @see {@link @backstage/frontend-plugin-api#mockApis.config} + * @see {@link @backstage/core-plugin-api#mockApis.config} * @public */ export namespace config { /** * Creates a factory for a fake implementation of - * {@link @backstage/frontend-plugin-api#ConfigApi} with optional + * {@link @backstage/core-plugin-api#ConfigApi} with optional * configuration data supplied. * * @public @@ -176,7 +186,7 @@ export namespace mockApis { export const factory = simpleFactory(configApiRef, config); /** * Creates a mock implementation of - * {@link @backstage/frontend-plugin-api#ConfigApi}. All methods are + * {@link @backstage/core-plugin-api#ConfigApi}. All methods are * replaced with jest mock functions, and you can optionally pass in a * subset of methods with an explicit implementation. * @@ -205,6 +215,12 @@ export namespace mockApis { const discoveryMockSkeleton = (): jest.Mocked => ({ getBaseUrl: jest.fn(), }); + /** + * Fake implementation of {@link @backstage/core-plugin-api#DiscoveryApi}. By + * default returns URLs on the form `http://example.com/api/`. + * + * @public + */ export function discovery(options?: { baseUrl?: string }) { const baseUrl = options?.baseUrl ?? 'http://example.com'; return simpleInstance( @@ -217,6 +233,11 @@ export namespace mockApis { discoveryMockSkeleton, ); } + /** + * Mock implementations of {@link @backstage/core-plugin-api#DiscoveryApi}. + * + * @public + */ export namespace discovery { export const factory = simpleFactory(discoveryApiRef, discovery); export const mock = simpleMock(discoveryApiRef, discoveryMockSkeleton); @@ -228,6 +249,12 @@ export namespace mockApis { getProfileInfo: jest.fn(), signOut: jest.fn(), }); + /** + * Fake implementation of {@link @backstage/core-plugin-api#IdentityApi}. By + * default returns no token or profile info, and the user `user:default/test`. + * + * @public + */ export function identity(options?: { userEntityRef?: string; ownershipEntityRefs?: string[]; @@ -257,6 +284,11 @@ export namespace mockApis { async signOut() {}, }; } + /** + * Mock implementations of {@link @backstage/core-plugin-api#IdentityApi}. + * + * @public + */ export namespace identity { export const factory = simpleFactory(identityApiRef, identity); export const mock = simpleMock(identityApiRef, identityMockSkeleton); @@ -265,6 +297,13 @@ export namespace mockApis { const permissionMockSkeleton = (): jest.Mocked => ({ authorize: jest.fn(), }); + /** + * Fake implementation of + * {@link @backstage/plugin-permission-react#PermissionApi}. By default allows + * all actions. + * + * @public + */ export function permission(options?: { authorize?: | AuthorizeResult.ALLOW @@ -286,6 +325,12 @@ export namespace mockApis { } return new MockPermissionApi(authorize); } + /** + * Mock implementation of + * {@link @backstage/plugin-permission-react#PermissionApi}. + * + * @public + */ export namespace permission { export const factory = simpleFactory(permissionApiRef, permission); export const mock = simpleMock(permissionApiRef, permissionMockSkeleton); @@ -298,9 +343,20 @@ export namespace mockApis { observe$: jest.fn(), snapshot: jest.fn(), }); + /** + * Fake implementation of {@link @backstage/core-plugin-api#StorageApi}. + * Stores data temporarily in memory. + * + * @public + */ export function storage(options?: { data?: JsonObject }) { return MockStorageApi.create(options?.data); } + /** + * Mock implementations of {@link @backstage/core-plugin-api#StorageApi}. + * + * @public + */ export namespace storage { export const factory = simpleFactory(storageApiRef, storage); export const mock = simpleMock(storageApiRef, storageMockSkeleton); @@ -310,9 +366,20 @@ export namespace mockApis { getTranslation: jest.fn(), translation$: jest.fn(), }); + /** + * Fake implementation of {@link @backstage/core-plugin-api/alpha#TranslationApi}. + * By default returns the default translation. + * + * @public + */ export function translation() { return MockTranslationApi.create(); } + /** + * Mock implementations of {@link @backstage/core-plugin-api/alpha#TranslationApi}. + * + * @public + */ export namespace translation { export const factory = simpleFactory(translationApiRef, translation); export const mock = simpleMock(translationApiRef, translationMockSkeleton); From bc8b624ead233b890b599eefc66d77201983efa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 10 Oct 2024 15:32:30 +0200 Subject: [PATCH 091/268] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../test-utils/src/testUtils/apis/mockApis.ts | 76 +++++++++---------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/packages/test-utils/src/testUtils/apis/mockApis.ts b/packages/test-utils/src/testUtils/apis/mockApis.ts index 21bf0626ba..00473679d2 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.ts +++ b/packages/test-utils/src/testUtils/apis/mockApis.ts @@ -134,7 +134,7 @@ export namespace mockApis { * * @public */ - export function analytics() { + export function analytics(): AnalyticsApi { return analyticsMockSkeleton(); } /** @@ -212,26 +212,19 @@ export namespace mockApis { })); } - const discoveryMockSkeleton = (): jest.Mocked => ({ - getBaseUrl: jest.fn(), - }); /** * Fake implementation of {@link @backstage/core-plugin-api#DiscoveryApi}. By * default returns URLs on the form `http://example.com/api/`. * * @public */ - export function discovery(options?: { baseUrl?: string }) { + export function discovery(options?: { baseUrl?: string }): DiscoveryApi { const baseUrl = options?.baseUrl ?? 'http://example.com'; - return simpleInstance( - discoveryApiRef, - { - async getBaseUrl(pluginId: string) { - return `${baseUrl}/api/${pluginId}`; - }, + return { + async getBaseUrl(pluginId: string) { + return `${baseUrl}/api/${pluginId}`; }, - discoveryMockSkeleton, - ); + }; } /** * Mock implementations of {@link @backstage/core-plugin-api#DiscoveryApi}. @@ -240,15 +233,11 @@ export namespace mockApis { */ export namespace discovery { export const factory = simpleFactory(discoveryApiRef, discovery); - export const mock = simpleMock(discoveryApiRef, discoveryMockSkeleton); + export const mock = simpleMock(discoveryApiRef, () => ({ + getBaseUrl: jest.fn(), + })); } - const identityMockSkeleton = (): jest.Mocked => ({ - getBackstageIdentity: jest.fn(), - getCredentials: jest.fn(), - getProfileInfo: jest.fn(), - signOut: jest.fn(), - }); /** * Fake implementation of {@link @backstage/core-plugin-api#IdentityApi}. By * default returns no token or profile info, and the user `user:default/test`. @@ -291,12 +280,17 @@ export namespace mockApis { */ export namespace identity { export const factory = simpleFactory(identityApiRef, identity); - export const mock = simpleMock(identityApiRef, identityMockSkeleton); + export const mock = simpleMock( + identityApiRef, + (): jest.Mocked => ({ + getBackstageIdentity: jest.fn(), + getCredentials: jest.fn(), + getProfileInfo: jest.fn(), + signOut: jest.fn(), + }), + ); } - const permissionMockSkeleton = (): jest.Mocked => ({ - authorize: jest.fn(), - }); /** * Fake implementation of * {@link @backstage/plugin-permission-react#PermissionApi}. By default allows @@ -311,7 +305,7 @@ export namespace mockApis { | (( request: EvaluatePermissionRequest, ) => AuthorizeResult.ALLOW | AuthorizeResult.DENY); - }) { + }): PermissionApi { const authorizeInput = options?.authorize; let authorize: ( request: EvaluatePermissionRequest, @@ -333,23 +327,18 @@ export namespace mockApis { */ export namespace permission { export const factory = simpleFactory(permissionApiRef, permission); - export const mock = simpleMock(permissionApiRef, permissionMockSkeleton); + export const mock = simpleMock(permissionApiRef, () => ({ + authorize: jest.fn(), + })); } - const storageMockSkeleton = (): jest.Mocked => ({ - forBucket: jest.fn(), - set: jest.fn(), - remove: jest.fn(), - observe$: jest.fn(), - snapshot: jest.fn(), - }); /** * Fake implementation of {@link @backstage/core-plugin-api#StorageApi}. * Stores data temporarily in memory. * * @public */ - export function storage(options?: { data?: JsonObject }) { + export function storage(options?: { data?: JsonObject }): StorageApi { return MockStorageApi.create(options?.data); } /** @@ -359,20 +348,22 @@ export namespace mockApis { */ export namespace storage { export const factory = simpleFactory(storageApiRef, storage); - export const mock = simpleMock(storageApiRef, storageMockSkeleton); + export const mock = simpleMock(storageApiRef, () => ({ + forBucket: jest.fn(), + set: jest.fn(), + remove: jest.fn(), + observe$: jest.fn(), + snapshot: jest.fn(), + })); } - const translationMockSkeleton = (): jest.Mocked => ({ - getTranslation: jest.fn(), - translation$: jest.fn(), - }); /** * Fake implementation of {@link @backstage/core-plugin-api/alpha#TranslationApi}. * By default returns the default translation. * * @public */ - export function translation() { + export function translation(): TranslationApi { return MockTranslationApi.create(); } /** @@ -382,6 +373,9 @@ export namespace mockApis { */ export namespace translation { export const factory = simpleFactory(translationApiRef, translation); - export const mock = simpleMock(translationApiRef, translationMockSkeleton); + export const mock = simpleMock(translationApiRef, () => ({ + getTranslation: jest.fn(), + translation$: jest.fn(), + })); } } From 34fcc9600495d8cbf262e011f6d26f24541711bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 10 Oct 2024 16:35:28 +0200 Subject: [PATCH 092/268] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- ...dentityAuthInjectorFetchMiddleware.test.ts | 2 +- ...ginProtocolResolverFetchMiddleware.test.ts | 2 +- packages/test-utils/report.api.md | 40 +++++++++---------- .../src/testUtils/apis/mockApis.test.tsx | 30 +++----------- .../UserListPicker/UserListPicker.test.tsx | 2 + .../useOwnedEntitiesCount.test.tsx | 1 + .../src/hooks/useEntity.test.tsx | 4 +- .../src/hooks/usePermission.test.tsx | 2 + plugins/techdocs/src/client.test.ts | 7 ---- 9 files changed, 33 insertions(+), 57 deletions(-) diff --git a/packages/core-app-api/src/apis/implementations/FetchApi/IdentityAuthInjectorFetchMiddleware.test.ts b/packages/core-app-api/src/apis/implementations/FetchApi/IdentityAuthInjectorFetchMiddleware.test.ts index f1daced2a1..50f93444ed 100644 --- a/packages/core-app-api/src/apis/implementations/FetchApi/IdentityAuthInjectorFetchMiddleware.test.ts +++ b/packages/core-app-api/src/apis/implementations/FetchApi/IdentityAuthInjectorFetchMiddleware.test.ts @@ -58,7 +58,7 @@ describe('IdentityAuthInjectorFetchMiddleware', () => { }); it('injects the header only when a token is available', async () => { - const identityApi = mockApis.identity(); + const identityApi = mockApis.identity.mock(); const middleware = new IdentityAuthInjectorFetchMiddleware( identityApi, diff --git a/packages/core-app-api/src/apis/implementations/FetchApi/PluginProtocolResolverFetchMiddleware.test.ts b/packages/core-app-api/src/apis/implementations/FetchApi/PluginProtocolResolverFetchMiddleware.test.ts index 7a9ebdc4f9..bd82d58736 100644 --- a/packages/core-app-api/src/apis/implementations/FetchApi/PluginProtocolResolverFetchMiddleware.test.ts +++ b/packages/core-app-api/src/apis/implementations/FetchApi/PluginProtocolResolverFetchMiddleware.test.ts @@ -21,7 +21,7 @@ describe('PluginProtocolResolverFetchMiddleware', () => { it.each([['https://passthrough.com/a']])( 'passes through regular URLs, %p', async url => { - const discoveryApi = mockApis.discovery(); + const discoveryApi = mockApis.discovery.mock(); const middleware = new PluginProtocolResolverFetchMiddleware( discoveryApi, ); diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index ad5528d507..11657ce534 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -92,7 +92,7 @@ export class MockAnalyticsApi implements AnalyticsApi { // @public export namespace mockApis { - export function analytics(): jest.Mocked; + export function analytics(): AnalyticsApi; export namespace analytics { const // (undocumented) factory: () => ApiFactory; @@ -112,9 +112,7 @@ export namespace mockApis { ) => ApiFactory; const mock: (partialImpl?: Partial | undefined) => ApiMock; } - export function discovery(options?: { baseUrl?: string }): jest.Mocked<{ - getBaseUrl(pluginId: string): Promise; - }>; + export function discovery(options?: { baseUrl?: string }): DiscoveryApi; export namespace discovery { const // (undocumented) factory: ( @@ -136,7 +134,7 @@ export namespace mockApis { email?: string; displayName?: string; picture?: string; - }): jest.Mocked; + }): IdentityApi; export namespace identity { const // (undocumented) factory: ( @@ -163,7 +161,7 @@ export namespace mockApis { | (( request: EvaluatePermissionRequest, ) => AuthorizeResult.ALLOW | AuthorizeResult.DENY); - }): jest.Mocked; + }): PermissionApi; export namespace permission { const // (undocumented) factory: ( @@ -184,9 +182,7 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } - export function storage(options?: { - data?: JsonObject; - }): jest.Mocked; + export function storage(options?: { data?: JsonObject }): StorageApi; export namespace storage { const // (undocumented) factory: ( @@ -201,7 +197,7 @@ export namespace mockApis { partialImpl?: Partial | undefined, ) => ApiMock; } - export function translation(): jest.Mocked; + export function translation(): TranslationApi; export namespace translation { const // (undocumented) factory: () => ApiFactory; @@ -424,16 +420,16 @@ export function wrapInTestApp( // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:24:5 - (ae-undocumented) Missing documentation for "set". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:25:5 - (ae-undocumented) Missing documentation for "remove". // src/testUtils/apis/StorageApi/MockStorageApi.d.ts:26:5 - (ae-undocumented) Missing documentation for "observe$". -// src/testUtils/apis/mockApis.d.ts:59:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:60:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:128:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:131:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:153:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:161:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:180:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:183:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:200:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:203:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:218:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:219:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:58:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:59:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:125:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:128:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:150:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:158:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:177:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:180:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:197:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:200:15 - (ae-undocumented) Missing documentation for "mock". +// src/testUtils/apis/mockApis.d.ts:215:15 - (ae-undocumented) Missing documentation for "factory". +// src/testUtils/apis/mockApis.d.ts:216:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx index af0bbaee72..31cb03e117 100644 --- a/packages/test-utils/src/testUtils/apis/mockApis.test.tsx +++ b/packages/test-utils/src/testUtils/apis/mockApis.test.tsx @@ -25,7 +25,7 @@ import { createTranslationRef } from '@backstage/core-plugin-api/alpha'; describe('mockApis', () => { describe('analytics', () => { - it('can create an instance and make assertions on it', () => { + it('can create an instance', () => { const analytics = mockApis.analytics(); expect( analytics.captureEvent({ @@ -34,7 +34,6 @@ describe('mockApis', () => { context: { pluginId: 'c', extension: 'd', routeRef: 'e' }, }), ).toBeUndefined(); - expect(analytics.captureEvent).toHaveBeenCalledTimes(1); }); it('can create a mock and make assertions on it', async () => { @@ -80,18 +79,16 @@ describe('mockApis', () => { }); describe('discovery', () => { - it('can create an instance and make assertions on it', async () => { + it('can create an instance', async () => { const empty = mockApis.discovery(); await expect(empty.getBaseUrl('catalog')).resolves.toBe( 'http://example.com/api/catalog', ); - expect(empty.getBaseUrl).toHaveBeenCalledTimes(1); const notEmpty = mockApis.discovery({ baseUrl: 'https://other.net' }); await expect(notEmpty.getBaseUrl('catalog')).resolves.toBe( 'https://other.net/api/catalog', ); - expect(notEmpty.getBaseUrl).toHaveBeenCalledTimes(1); }); it('can create a mock and make assertions on it', async () => { @@ -108,7 +105,7 @@ describe('mockApis', () => { }); describe('identity', () => { - it('can create an instance and make assertions on it', async () => { + it('can create an instance', async () => { const empty = mockApis.identity(); await expect(empty.getBackstageIdentity()).resolves.toEqual({ type: 'user', @@ -118,10 +115,6 @@ describe('mockApis', () => { await expect(empty.getCredentials()).resolves.toEqual({}); await expect(empty.getProfileInfo()).resolves.toEqual({}); await expect(empty.signOut()).resolves.toBeUndefined(); - expect(empty.getBackstageIdentity).toHaveBeenCalledTimes(1); - expect(empty.getCredentials).toHaveBeenCalledTimes(1); - expect(empty.getProfileInfo).toHaveBeenCalledTimes(1); - expect(empty.signOut).toHaveBeenCalledTimes(1); const notEmpty = mockApis.identity({ userEntityRef: 'a', @@ -143,10 +136,6 @@ describe('mockApis', () => { picture: 'f', }); await expect(notEmpty.signOut()).resolves.toBeUndefined(); - expect(notEmpty.getBackstageIdentity).toHaveBeenCalledTimes(1); - expect(notEmpty.getCredentials).toHaveBeenCalledTimes(1); - expect(notEmpty.getProfileInfo).toHaveBeenCalledTimes(1); - expect(notEmpty.signOut).toHaveBeenCalledTimes(1); }); it('can create a mock and make assertions on it', async () => { @@ -194,7 +183,7 @@ describe('mockApis', () => { }); describe('permission', () => { - it('can create an instance and make assertions on it', async () => { + it('can create an instance', async () => { // default allow const permission1 = mockApis.permission(); await expect( @@ -205,7 +194,6 @@ describe('mockApis', () => { }), }), ).resolves.toEqual({ result: AuthorizeResult.ALLOW }); - expect(permission1.authorize).toHaveBeenCalledTimes(1); // static value const permission2 = mockApis.permission({ @@ -219,7 +207,6 @@ describe('mockApis', () => { }), }), ).resolves.toEqual({ result: AuthorizeResult.DENY }); - expect(permission2.authorize).toHaveBeenCalledTimes(1); // callback form const permission3 = mockApis.permission({ @@ -244,7 +231,6 @@ describe('mockApis', () => { }), }), ).resolves.toEqual({ result: AuthorizeResult.DENY }); - expect(permission3.authorize).toHaveBeenCalledTimes(2); }); it('can create a mock and make assertions on it', async () => { @@ -548,10 +534,9 @@ describe('mockApis', () => { }); }); - it('can create an instance and make assertions on it', () => { + it('can create an instance', () => { const empty = mockApis.storage(); expect(empty.snapshot('a')).toEqual({ key: 'a', presence: 'absent' }); - expect(empty.snapshot).toHaveBeenCalledTimes(1); const notEmpty = mockApis.storage({ data: { a: 1, b: { c: 2 } } }); expect(notEmpty.snapshot('a')).toEqual({ @@ -564,8 +549,6 @@ describe('mockApis', () => { presence: 'present', value: 2, }); - expect(notEmpty.snapshot).toHaveBeenCalledTimes(1); // "inner" (forBucket returned) instances aren't mocked - expect(notEmpty.forBucket).toHaveBeenCalledTimes(1); }); it('can create a mock and make assertions on it', () => { @@ -750,7 +733,7 @@ describe('mockApis', () => { }); }); - it('can create an instance and make assertions on it', () => { + it('can create an instance', () => { const translation = mockApis.translation(); const ref = createTranslationRef({ id: 'test', @@ -761,7 +744,6 @@ describe('mockApis', () => { throw new Error('not ready'); } expect(result.t('a')).toEqual('b'); - expect(translation.getTranslation).toHaveBeenCalledTimes(1); }); it('can create a mock and make assertions on it', () => { diff --git a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx index 7ff30dbf5f..3ef5c242a1 100644 --- a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx @@ -66,11 +66,13 @@ const mockConfigApi = mockApis.config({ }); const mockCatalogApi = catalogApiMock.mock(); +jest.spyOn(mockCatalogApi, 'queryEntities'); const mockIdentityApi = mockApis.identity({ userEntityRef: ownershipEntityRefs[0], ownershipEntityRefs, }); +jest.spyOn(mockIdentityApi, 'getBackstageIdentity'); const mockStarredEntitiesApi = new MockStarredEntitiesApi(); diff --git a/plugins/catalog-react/src/components/UserListPicker/useOwnedEntitiesCount.test.tsx b/plugins/catalog-react/src/components/UserListPicker/useOwnedEntitiesCount.test.tsx index 99b746c80c..8ea9f63472 100644 --- a/plugins/catalog-react/src/components/UserListPicker/useOwnedEntitiesCount.test.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/useOwnedEntitiesCount.test.tsx @@ -39,6 +39,7 @@ const mockIdentityApi = mockApis.identity({ ownershipEntityRefs: ['user:default/spiderman', 'user:group/a-group'], userEntityRef: 'user:default/spiderman', }); +jest.spyOn(mockIdentityApi, 'getBackstageIdentity'); jest.mock('@backstage/core-plugin-api', () => { const actual = jest.requireActual('@backstage/core-plugin-api'); diff --git a/plugins/catalog-react/src/hooks/useEntity.test.tsx b/plugins/catalog-react/src/hooks/useEntity.test.tsx index c0ad3c2111..022584bd4c 100644 --- a/plugins/catalog-react/src/hooks/useEntity.test.tsx +++ b/plugins/catalog-react/src/hooks/useEntity.test.tsx @@ -131,7 +131,7 @@ describe('useAsyncEntity', () => { }); it('should provide entityRef analytics context', () => { - const analyticsSpy = mockApis.analytics(); + const analyticsSpy = mockApis.analytics.mock(); const apis = TestApiRegistry.from([analyticsApiRef, analyticsSpy]); const { result } = renderHook(() => useAnalytics(), { wrapper: ({ children }: React.PropsWithChildren<{}>) => ( @@ -154,7 +154,7 @@ describe('useAsyncEntity', () => { }); it('should omit entityRef analytics context', () => { - const analyticsSpy = mockApis.analytics(); + const analyticsSpy = mockApis.analytics.mock(); const apis = TestApiRegistry.from([analyticsApiRef, analyticsSpy]); const { result } = renderHook(() => useAnalytics(), { wrapper: ({ children }: PropsWithChildren<{}>) => ( diff --git a/plugins/permission-react/src/hooks/usePermission.test.tsx b/plugins/permission-react/src/hooks/usePermission.test.tsx index e4a0c82eab..4be9af3b32 100644 --- a/plugins/permission-react/src/hooks/usePermission.test.tsx +++ b/plugins/permission-react/src/hooks/usePermission.test.tsx @@ -67,6 +67,7 @@ describe('usePermission', () => { const permissionApi = mockApis.permission({ authorize: AuthorizeResult.ALLOW, }); + jest.spyOn(permissionApi, 'authorize'); const { findByText } = renderComponent(permissionApi); @@ -78,6 +79,7 @@ describe('usePermission', () => { const permissionApi = mockApis.permission({ authorize: AuthorizeResult.DENY, }); + jest.spyOn(permissionApi, 'authorize'); const { findByText } = renderComponent(permissionApi); diff --git a/plugins/techdocs/src/client.test.ts b/plugins/techdocs/src/client.test.ts index 8724e027f5..f66587a071 100644 --- a/plugins/techdocs/src/client.test.ts +++ b/plugins/techdocs/src/client.test.ts @@ -40,7 +40,6 @@ describe('TechDocsStorageClient', () => { beforeEach(() => { jest.resetAllMocks(); - identityApi.getCredentials.mockResolvedValue({ token: undefined }); }); it('should return correct base url based on defined storage', async () => { @@ -92,7 +91,6 @@ describe('TechDocsStorageClient', () => { await Promise.resolve(); onmessage?.({ id: '', event: 'finish', data: '{"updated": false}' }); }); - identityApi.getCredentials.mockResolvedValue({}); await storageApi.syncEntityDocs(mockEntity); expect(mockFetchEventSource).toHaveBeenCalledWith( @@ -123,7 +121,6 @@ describe('TechDocsStorageClient', () => { onmessage?.({ id: '', event: 'finish', data: '{"updated": false}' }); }); - identityApi.getCredentials.mockResolvedValue({}); await expect(storageApi.syncEntityDocs(mockEntity)).resolves.toEqual( 'cached', ); @@ -143,7 +140,6 @@ describe('TechDocsStorageClient', () => { onmessage?.({ id: '', event: 'finish', data: '{"updated": true}' }); }); - identityApi.getCredentials.mockResolvedValue({}); await expect(storageApi.syncEntityDocs(mockEntity)).resolves.toEqual( 'updated', ); @@ -166,7 +162,6 @@ describe('TechDocsStorageClient', () => { onmessage?.({ id: '', event: 'finish', data: '{"updated": false}' }); }); - identityApi.getCredentials.mockResolvedValue({}); const logHandler = jest.fn(); await expect( storageApi.syncEntityDocs(mockEntity, logHandler), @@ -189,7 +184,6 @@ describe('TechDocsStorageClient', () => { }); // we await later after we emitted the error - identityApi.getCredentials.mockResolvedValue({}); const promise = storageApi.syncEntityDocs(mockEntity).then(); await expect(promise).rejects.toThrow(NotFoundError); @@ -204,7 +198,6 @@ describe('TechDocsStorageClient', () => { }); // we await later after we emitted the error - identityApi.getCredentials.mockResolvedValue({}); const promise = storageApi.syncEntityDocs(mockEntity).then(); mockFetchEventSource.mockImplementation(async (_url, options) => { From 52e134283354fe42e290c4972968baac97b1bd73 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 10:05:50 +0200 Subject: [PATCH 093/268] yarn.lock: dedupe Signed-off-by: Patrik Oldsberg --- yarn.lock | 63 +++++-------------------------------------------------- 1 file changed, 5 insertions(+), 58 deletions(-) diff --git a/yarn.lock b/yarn.lock index f777946543..3b522f91e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18392,13 +18392,6 @@ __metadata: languageName: node linkType: hard -"@types/mime@npm:*": - version: 3.0.4 - resolution: "@types/mime@npm:3.0.4" - checksum: a6139c8e1f705ef2b064d072f6edc01f3c099023ad7c4fce2afc6c2bf0231888202adadbdb48643e8e20da0ce409481a49922e737eca52871b3dc08017455843 - languageName: node - linkType: hard - "@types/mime@npm:^1": version: 1.3.2 resolution: "@types/mime@npm:1.3.2" @@ -19004,18 +18997,7 @@ __metadata: languageName: node linkType: hard -"@types/serve-static@npm:*, @types/serve-static@npm:^1.15.5": - version: 1.15.5 - resolution: "@types/serve-static@npm:1.15.5" - dependencies: - "@types/http-errors": "*" - "@types/mime": "*" - "@types/node": "*" - checksum: 0ff4b3703cf20ba89c9f9e345bc38417860a88e85863c8d6fe274a543220ab7f5f647d307c60a71bb57dc9559f0890a661e8dc771a6ec5ef195d91c8afc4a893 - languageName: node - linkType: hard - -"@types/serve-static@npm:^1.13.10": +"@types/serve-static@npm:*, @types/serve-static@npm:^1.13.10, @types/serve-static@npm:^1.15.5": version: 1.15.7 resolution: "@types/serve-static@npm:1.15.7" dependencies: @@ -22891,14 +22873,7 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001646": - version: 1.0.30001653 - resolution: "caniuse-lite@npm:1.0.30001653" - checksum: 289cf06c26a46f3e6460ccd5feffa788ab0ab35d306898c48120c65cfb11959bfa560e9f739393769b4fd01150c69b0747ad3ad5ec3abf3dfafd66df3c59254e - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001616": +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001616, caniuse-lite@npm:^1.0.30001646": version: 1.0.30001668 resolution: "caniuse-lite@npm:1.0.30001668" checksum: ce6996901b5883454a8ddb3040f82342277b6a6275876dfefcdecb11f7e472e29877f34cae47c2b674f08f2e71971dd4a2acb9bc01adfe8421b7148a7e9e8297 @@ -30400,20 +30375,13 @@ __metadata: languageName: node linkType: hard -"ipaddr.js@npm:^2.0.1": +"ipaddr.js@npm:^2.0.1, ipaddr.js@npm:^2.1.0": version: 2.2.0 resolution: "ipaddr.js@npm:2.2.0" checksum: 770ba8451fd9bf78015e8edac0d5abd7a708cbf75f9429ca9147a9d2f3a2d60767cd5de2aab2b1e13ca6e4445bdeff42bf12ef6f151c07a5c6cf8a44328e2859 languageName: node linkType: hard -"ipaddr.js@npm:^2.1.0": - version: 2.1.0 - resolution: "ipaddr.js@npm:2.1.0" - checksum: 807a054f2bd720c4d97ee479d6c9e865c233bea21f139fb8dabd5a35c4226d2621c42e07b4ad94ff3f82add926a607d8d9d37c625ad0319f0e08f9f2bd1968e2 - languageName: node - linkType: hard - "is-absolute-url@npm:^3.0.3": version: 3.0.3 resolution: "is-absolute-url@npm:3.0.3" @@ -32887,7 +32855,7 @@ __metadata: languageName: node linkType: hard -"launch-editor@npm:^2.6.0": +"launch-editor@npm:^2.6.0, launch-editor@npm:^2.6.1": version: 2.9.1 resolution: "launch-editor@npm:2.9.1" dependencies: @@ -32897,16 +32865,6 @@ __metadata: languageName: node linkType: hard -"launch-editor@npm:^2.6.1": - version: 2.6.1 - resolution: "launch-editor@npm:2.6.1" - dependencies: - picocolors: ^1.0.0 - shell-quote: ^1.8.1 - checksum: e06d193075ac09f7f8109f10cabe464a211bf7ed4cbe75f83348d6f67bf4d9f162f06e7a1ab3e1cd7fc250b5342c3b57080618aff2e646dc34248fe499227601 - languageName: node - linkType: hard - "lazystream@npm:^1.0.0": version: 1.0.0 resolution: "lazystream@npm:1.0.0" @@ -36328,18 +36286,7 @@ __metadata: languageName: node linkType: hard -"open@npm:^8.0.0, open@npm:^8.4.0": - version: 8.4.0 - resolution: "open@npm:8.4.0" - dependencies: - define-lazy-prop: ^2.0.0 - is-docker: ^2.1.1 - is-wsl: ^2.2.0 - checksum: e9545bec64cdbf30a0c35c1bdc310344adf8428a117f7d8df3c0af0a0a24c513b304916a6d9b11db0190ff7225c2d578885080b761ed46a3d5f6f1eebb98b63c - languageName: node - linkType: hard - -"open@npm:^8.0.9": +"open@npm:^8.0.0, open@npm:^8.0.9, open@npm:^8.4.0": version: 8.4.2 resolution: "open@npm:8.4.2" dependencies: From bc71665cb12b04f17cfe59142e454104864803b1 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 10:09:42 +0200 Subject: [PATCH 094/268] cli: remove legacy backend start Signed-off-by: Patrik Oldsberg --- .changeset/violet-ears-dance.md | 5 + packages/cli/package.json | 2 - .../cli/src/commands/start/startBackend.ts | 99 +++-------- packages/cli/src/lib/bundler/backend.ts | 52 ------ packages/cli/src/lib/bundler/config.ts | 163 +----------------- packages/cli/src/lib/bundler/index.ts | 1 - yarn.lock | 16 -- 7 files changed, 29 insertions(+), 309 deletions(-) create mode 100644 .changeset/violet-ears-dance.md delete mode 100644 packages/cli/src/lib/bundler/backend.ts diff --git a/.changeset/violet-ears-dance.md b/.changeset/violet-ears-dance.md new file mode 100644 index 0000000000..dba3671338 --- /dev/null +++ b/.changeset/violet-ears-dance.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': minor +--- + +**BREAKING**: The `LEGACY_BACKEND_START` flag has been removed, along with support for `src/run.ts` as the development entry point. diff --git a/packages/cli/package.json b/packages/cli/package.json index 0ca580dd91..53f8e3f560 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -141,7 +141,6 @@ "rollup-plugin-esbuild": "^6.1.1", "rollup-plugin-postcss": "^4.0.0", "rollup-pluginutils": "^2.8.2", - "run-script-webpack-plugin": "^0.2.0", "semver": "^7.5.3", "style-loader": "^3.3.1", "sucrase": "^3.20.2", @@ -152,7 +151,6 @@ "util": "^0.12.3", "webpack": "^5.70.0", "webpack-dev-server": "^5.0.0", - "webpack-node-externals": "^3.0.0", "yaml": "^2.0.0", "yargs": "^16.2.0", "yml-loader": "^2.1.0", diff --git a/packages/cli/src/commands/start/startBackend.ts b/packages/cli/src/commands/start/startBackend.ts index 857e113b81..c9b6496bb0 100644 --- a/packages/cli/src/commands/start/startBackend.ts +++ b/packages/cli/src/commands/start/startBackend.ts @@ -16,7 +16,6 @@ import fs from 'fs-extra'; import { paths } from '../../lib/paths'; -import { serveBackend } from '../../lib/bundler'; import { startBackendExperimental } from '../../lib/experimental/startBackendExperimental'; interface StartBackendOptions { @@ -27,89 +26,35 @@ interface StartBackendOptions { } export async function startBackend(options: StartBackendOptions) { - if (!process.env.LEGACY_BACKEND_START) { - const waitForExit = await startBackendExperimental({ - entry: 'src/index', - checksEnabled: false, // not supported - inspectEnabled: options.inspectEnabled, - inspectBrkEnabled: options.inspectBrkEnabled, - require: options.require, - }); + const waitForExit = await startBackendExperimental({ + entry: 'src/index', + checksEnabled: false, // not supported + inspectEnabled: options.inspectEnabled, + inspectBrkEnabled: options.inspectBrkEnabled, + require: options.require, + }); - await waitForExit(); - } else { - console.warn( - 'LEGACY_BACKEND_START is deprecated and will be removed in a future release', - ); - - const waitForExit = await cleanDistAndServeBackend({ - entry: 'src/index', - checksEnabled: options.checksEnabled, - inspectEnabled: options.inspectEnabled, - inspectBrkEnabled: options.inspectBrkEnabled, - require: options.require, - }); - - await waitForExit(); - } + await waitForExit(); } export async function startBackendPlugin(options: StartBackendOptions) { - if (!process.env.LEGACY_BACKEND_START) { - const hasDevIndexEntry = await fs.pathExists( - paths.resolveTarget('dev', 'index.ts'), - ); - if (!hasDevIndexEntry) { - console.warn( - `The 'dev' directory is missing. Please create a proper dev/index.ts in order to start the plugin.`, - ); - return; - } - - const waitForExit = await startBackendExperimental({ - entry: 'dev/index', - checksEnabled: false, // not supported - inspectEnabled: options.inspectEnabled, - inspectBrkEnabled: options.inspectBrkEnabled, - require: options.require, - }); - - await waitForExit(); - } else { - const hasEntry = await fs.pathExists(paths.resolveTarget('src', 'run.ts')); - if (!hasEntry) { - console.warn( - `src/run.ts is missing. Please create the file or run the command without LEGACY_BACKEND_START`, - ); - return; - } + const hasDevIndexEntry = await fs.pathExists( + paths.resolveTarget('dev', 'index.ts'), + ); + if (!hasDevIndexEntry) { console.warn( - 'LEGACY_BACKEND_START is deprecated and will be removed in a future release', + `The 'dev' directory is missing. Please create a proper dev/index.ts in order to start the plugin.`, ); - - const waitForExit = await cleanDistAndServeBackend({ - entry: 'src/run', - checksEnabled: options.checksEnabled, - inspectEnabled: options.inspectEnabled, - inspectBrkEnabled: options.inspectBrkEnabled, - require: options.require, - }); - - await waitForExit(); + return; } -} -async function cleanDistAndServeBackend(options: { - entry: string; - checksEnabled: boolean; - inspectEnabled: boolean; - inspectBrkEnabled: boolean; - require?: string; -}) { - // Cleaning dist/ before we start the dev process helps work around an issue - // where we end up with the entrypoint executing multiple times, causing - // a port bind conflict among other things. - await fs.remove(paths.resolveTarget('dist')); + const waitForExit = await startBackendExperimental({ + entry: 'dev/index', + checksEnabled: false, // not supported + inspectEnabled: options.inspectEnabled, + inspectBrkEnabled: options.inspectBrkEnabled, + require: options.require, + }); - return serveBackend(options); + await waitForExit(); } diff --git a/packages/cli/src/lib/bundler/backend.ts b/packages/cli/src/lib/bundler/backend.ts deleted file mode 100644 index 598b77bc51..0000000000 --- a/packages/cli/src/lib/bundler/backend.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import webpack from 'webpack'; -import { createBackendConfig } from './config'; -import { resolveBundlingPaths } from './paths'; -import { BackendServeOptions } from './types'; - -export async function serveBackend(options: BackendServeOptions) { - const paths = resolveBundlingPaths(options); - const config = await createBackendConfig(paths, { - ...options, - isDev: true, - }); - - // Webpack only replaces occurrences of this in code it touches, which does - // not include dependencies in node_modules. So we set it here at runtime as well. - (process.env as { NODE_ENV: string }).NODE_ENV = 'development'; - - const compiler = webpack(config, (err: Error | null) => { - if (err) { - console.error(err); - } else console.log('Build succeeded'); - }); - - const waitForExit = async () => { - for (const signal of ['SIGINT', 'SIGTERM'] as const) { - process.on(signal, () => { - // exit instead of resolve. The process is shutting down and resolving a promise here logs an error - compiler.close(() => process.exit()); - }); - } - - // Block indefinitely and wait for the interrupt signal - return new Promise(() => {}); - }; - - return waitForExit; -} diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index cc8a467bc2..9bfd9628a2 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -14,16 +14,11 @@ * limitations under the License. */ -import { - BackendBundlingOptions, - BundlingOptions, - ModuleFederationOptions, -} from './types'; -import { posix as posixPath, resolve as resolvePath, dirname } from 'path'; +import { BundlingOptions, ModuleFederationOptions } from './types'; +import { resolve as resolvePath, dirname } from 'path'; import chalk from 'chalk'; import webpack, { ProvidePlugin } from 'webpack'; -import { BackstagePackage } from '@backstage/cli-node'; import { BundlingPaths } from './paths'; import { Config } from '@backstage/config'; import ESLintPlugin from 'eslint-webpack-plugin'; @@ -32,16 +27,13 @@ import HtmlWebpackPlugin from 'html-webpack-plugin'; import { ModuleFederationPlugin } from '@module-federation/enhanced/webpack'; import { LinkedPackageResolvePlugin } from './LinkedPackageResolvePlugin'; import ModuleScopePlugin from 'react-dev-utils/ModuleScopePlugin'; -import { RunScriptWebpackPlugin } from 'run-script-webpack-plugin'; import ReactRefreshPlugin from '@pmmmwh/react-refresh-webpack-plugin'; import { paths as cliPaths } from '../../lib/paths'; import fs from 'fs-extra'; import { getPackages } from '@manypkg/get-packages'; import { isChildPath } from '@backstage/cli-common'; -import nodeExternals from 'webpack-node-externals'; import { optimization as optimizationConfig } from './optimization'; import pickBy from 'lodash/pickBy'; -import { readEntryPoints } from '../entryPoints'; import { runPlain } from '../run'; import { transforms } from './transforms'; import { version } from '../../lib/version'; @@ -432,154 +424,3 @@ export async function createConfig( : {}), }; } - -export async function createBackendConfig( - paths: BundlingPaths, - options: BackendBundlingOptions, -): Promise { - const { checksEnabled, isDev } = options; - - // Find all local monorepo packages and their node_modules, and mark them as external. - const { packages } = await getPackages(cliPaths.targetDir); - const localPackageEntryPoints = packages.flatMap(p => { - const entryPoints = readEntryPoints((p as BackstagePackage).packageJson); - return entryPoints.map(e => posixPath.join(p.packageJson.name, e.mount)); - }); - const moduleDirs = packages.map(p => resolvePath(p.dir, 'node_modules')); - // See frontend config - const externalPkgs = packages.filter(p => !isChildPath(paths.root, p.dir)); - - const { loaders } = transforms({ ...options, isBackend: true }); - - const runScriptNodeArgs = new Array(); - if (options.inspectEnabled) { - const inspect = - typeof options.inspectEnabled === 'string' - ? `--inspect=${options.inspectEnabled}` - : '--inspect'; - runScriptNodeArgs.push(inspect); - } else if (options.inspectBrkEnabled) { - const inspect = - typeof options.inspectBrkEnabled === 'string' - ? `--inspect-brk=${options.inspectBrkEnabled}` - : '--inspect-brk'; - runScriptNodeArgs.push(inspect); - } - if (options.require) { - runScriptNodeArgs.push(`--require=${options.require}`); - } - - return { - mode: isDev ? 'development' : 'production', - profile: false, - ...(isDev - ? { - watch: true, - watchOptions: { - ignored: /node_modules\/(?!\@backstage)/, - }, - } - : {}), - externals: [ - nodeExternalsWithResolve({ - modulesDir: paths.rootNodeModules, - additionalModuleDirs: moduleDirs, - allowlist: ['webpack/hot/poll?100', ...localPackageEntryPoints], - }), - ], - target: 'node' as const, - node: { - /* eslint-disable-next-line no-restricted-syntax */ - __dirname: true, - __filename: true, - global: true, - }, - bail: false, - performance: { - hints: false, // we check the gzip size instead - }, - devtool: isDev ? 'eval-cheap-module-source-map' : 'source-map', - context: paths.targetPath, - entry: [ - 'webpack/hot/poll?100', - paths.targetRunFile ? paths.targetRunFile : paths.targetEntry, - ], - resolve: { - extensions: ['.ts', '.mjs', '.js', '.json'], - mainFields: ['main'], - modules: [paths.rootNodeModules, ...moduleDirs], - plugins: [ - new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), - new ModuleScopePlugin( - [paths.targetSrc, paths.targetDev], - [paths.targetPackageJson], - ), - ], - }, - module: { - rules: loaders, - }, - output: { - path: paths.targetDist, - filename: isDev ? '[name].js' : '[name].[hash:8].js', - chunkFilename: isDev - ? '[name].chunk.js' - : '[name].[chunkhash:8].chunk.js', - ...(isDev - ? { - devtoolModuleFilenameTemplate: (info: any) => - `file:///${resolvePath(info.absoluteResourcePath).replace( - /\\/g, - '/', - )}`, - } - : {}), - }, - plugins: [ - new RunScriptWebpackPlugin({ - name: 'main.js', - nodeArgs: runScriptNodeArgs.length > 0 ? runScriptNodeArgs : undefined, - args: process.argv.slice(3), // drop `node backstage-cli backend:dev` - }), - new webpack.HotModuleReplacementPlugin(), - ...(checksEnabled - ? [ - new ForkTsCheckerWebpackPlugin({ - typescript: { configFile: paths.targetTsConfig }, - }), - new ESLintPlugin({ - files: ['**/*.(ts|tsx|mts|cts|js|jsx|mjs|cjs)'], - }), - ] - : []), - ], - }; -} - -// This makes the module resolution happen from the context of each non-external module, rather -// than the main entrypoint. This fixes a bug where dependencies would be resolved from the backend -// package rather than each individual backend package and plugin. -// -// TODO(Rugvip): Feature suggestion/contribute this to webpack-externals -function nodeExternalsWithResolve( - options: Parameters[0], -) { - let currentContext: string; - const externals = nodeExternals({ - ...options, - importType(request) { - const resolved = require.resolve(request, { - paths: [currentContext], - }); - return `commonjs ${resolved}`; - }, - }); - - return ( - { context, request }: { context?: string; request?: string }, - callback: any, - ) => { - currentContext = context!; - return externals(context, request, callback); - }; -} diff --git a/packages/cli/src/lib/bundler/index.ts b/packages/cli/src/lib/bundler/index.ts index 2219784dc9..d8dd6ed0d6 100644 --- a/packages/cli/src/lib/bundler/index.ts +++ b/packages/cli/src/lib/bundler/index.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -export { serveBackend } from './backend'; export { buildBundle } from './bundle'; export { getModuleFederationOptions } from './moduleFederation'; export { serveBundle } from './server'; diff --git a/yarn.lock b/yarn.lock index 7d4e6a0452..25f7acd752 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4037,7 +4037,6 @@ __metadata: rollup-plugin-esbuild: ^6.1.1 rollup-plugin-postcss: ^4.0.0 rollup-pluginutils: ^2.8.2 - run-script-webpack-plugin: ^0.2.0 semver: ^7.5.3 style-loader: ^3.3.1 sucrase: ^3.20.2 @@ -4051,7 +4050,6 @@ __metadata: vite-plugin-node-polyfills: ^0.22.0 webpack: ^5.70.0 webpack-dev-server: ^5.0.0 - webpack-node-externals: ^3.0.0 yaml: ^2.0.0 yargs: ^16.2.0 yml-loader: ^2.1.0 @@ -40212,13 +40210,6 @@ __metadata: languageName: node linkType: hard -"run-script-webpack-plugin@npm:^0.2.0": - version: 0.2.0 - resolution: "run-script-webpack-plugin@npm:0.2.0" - checksum: 1f5df65b726e098d602b4cc27472d9e2cd88841862f7ca2112f702b01f3c4fc1cd89b54fa63780691d988c9ab36cc9adc08a6fa056cdb9c7b85b027b21ba6cdd - languageName: node - linkType: hard - "rxjs@npm:7.8.1, rxjs@npm:^7.2.0, rxjs@npm:^7.5.5": version: 7.8.1 resolution: "rxjs@npm:7.8.1" @@ -44521,13 +44512,6 @@ __metadata: languageName: node linkType: hard -"webpack-node-externals@npm:^3.0.0": - version: 3.0.0 - resolution: "webpack-node-externals@npm:3.0.0" - checksum: 355080c35c821115b97dda8c93d9d0565a90a6012a532324eb0d6a64f8f0d609431fd29504fc7ce414755841ac14f601f3eef99472c2c5dc00233b504ebe73f2 - languageName: node - linkType: hard - "webpack-sources@npm:^1.4.3": version: 1.4.3 resolution: "webpack-sources@npm:1.4.3" From 1e416370784b15d16254c03a8141d00208d659ea Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 10:20:43 +0200 Subject: [PATCH 095/268] cli: internal refactor of backend start implementation Signed-off-by: Patrik Oldsberg --- .../cli/src/commands/start/startBackend.ts | 8 +++----- packages/cli/src/lib/bundler/types.ts | 7 ------- .../src/lib/{experimental => ipc}/IpcServer.ts | 0 .../{experimental => ipc}/ServerDataStore.ts | 0 packages/cli/src/lib/ipc/index.ts | 18 ++++++++++++++++++ packages/cli/src/lib/runner/index.ts | 17 +++++++++++++++++ .../runBackend.ts} | 18 +++++++++++++----- 7 files changed, 51 insertions(+), 17 deletions(-) rename packages/cli/src/lib/{experimental => ipc}/IpcServer.ts (100%) rename packages/cli/src/lib/{experimental => ipc}/ServerDataStore.ts (100%) create mode 100644 packages/cli/src/lib/ipc/index.ts create mode 100644 packages/cli/src/lib/runner/index.ts rename packages/cli/src/lib/{experimental/startBackendExperimental.ts => runner/runBackend.ts} (90%) diff --git a/packages/cli/src/commands/start/startBackend.ts b/packages/cli/src/commands/start/startBackend.ts index c9b6496bb0..4f62044de7 100644 --- a/packages/cli/src/commands/start/startBackend.ts +++ b/packages/cli/src/commands/start/startBackend.ts @@ -16,7 +16,7 @@ import fs from 'fs-extra'; import { paths } from '../../lib/paths'; -import { startBackendExperimental } from '../../lib/experimental/startBackendExperimental'; +import { runBackend } from '../../lib/runner'; interface StartBackendOptions { checksEnabled: boolean; @@ -26,9 +26,8 @@ interface StartBackendOptions { } export async function startBackend(options: StartBackendOptions) { - const waitForExit = await startBackendExperimental({ + const waitForExit = await runBackend({ entry: 'src/index', - checksEnabled: false, // not supported inspectEnabled: options.inspectEnabled, inspectBrkEnabled: options.inspectBrkEnabled, require: options.require, @@ -48,9 +47,8 @@ export async function startBackendPlugin(options: StartBackendOptions) { return; } - const waitForExit = await startBackendExperimental({ + const waitForExit = await runBackend({ entry: 'dev/index', - checksEnabled: false, // not supported inspectEnabled: options.inspectEnabled, inspectBrkEnabled: options.inspectBrkEnabled, require: options.require, diff --git a/packages/cli/src/lib/bundler/types.ts b/packages/cli/src/lib/bundler/types.ts index f8e228c5c4..3f52e4f765 100644 --- a/packages/cli/src/lib/bundler/types.ts +++ b/packages/cli/src/lib/bundler/types.ts @@ -67,10 +67,3 @@ export type BackendBundlingOptions = { inspectBrkEnabled: boolean; require?: string; }; - -export type BackendServeOptions = BundlingPathsOptions & { - checksEnabled: boolean; - inspectEnabled: boolean; - inspectBrkEnabled: boolean; - require?: string; -}; diff --git a/packages/cli/src/lib/experimental/IpcServer.ts b/packages/cli/src/lib/ipc/IpcServer.ts similarity index 100% rename from packages/cli/src/lib/experimental/IpcServer.ts rename to packages/cli/src/lib/ipc/IpcServer.ts diff --git a/packages/cli/src/lib/experimental/ServerDataStore.ts b/packages/cli/src/lib/ipc/ServerDataStore.ts similarity index 100% rename from packages/cli/src/lib/experimental/ServerDataStore.ts rename to packages/cli/src/lib/ipc/ServerDataStore.ts diff --git a/packages/cli/src/lib/ipc/index.ts b/packages/cli/src/lib/ipc/index.ts new file mode 100644 index 0000000000..78ee98a942 --- /dev/null +++ b/packages/cli/src/lib/ipc/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { IpcServer } from './IpcServer'; +export { ServerDataStore } from './ServerDataStore'; diff --git a/packages/cli/src/lib/runner/index.ts b/packages/cli/src/lib/runner/index.ts new file mode 100644 index 0000000000..e00ffaa3e5 --- /dev/null +++ b/packages/cli/src/lib/runner/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { runBackend } from './runBackend'; diff --git a/packages/cli/src/lib/experimental/startBackendExperimental.ts b/packages/cli/src/lib/runner/runBackend.ts similarity index 90% rename from packages/cli/src/lib/experimental/startBackendExperimental.ts rename to packages/cli/src/lib/runner/runBackend.ts index bd4bb94b17..f0ce971fee 100644 --- a/packages/cli/src/lib/experimental/startBackendExperimental.ts +++ b/packages/cli/src/lib/runner/runBackend.ts @@ -15,12 +15,9 @@ */ import { FSWatcher, watch } from 'chokidar'; - -import { BackendServeOptions } from '../bundler/types'; import type { ChildProcess } from 'child_process'; import { ctrlc } from 'ctrlc-windows'; -import { IpcServer } from './IpcServer'; -import { ServerDataStore } from './ServerDataStore'; +import { IpcServer, ServerDataStore } from '../ipc'; import debounce from 'lodash/debounce'; import { fileURLToPath } from 'url'; import { isAbsolute as isAbsolutePath } from 'path'; @@ -34,7 +31,18 @@ const loaderArgs = [ // TODO: Support modules, although there's currently no way to load them since import() is transpiled tp require() ]; -export async function startBackendExperimental(options: BackendServeOptions) { +export type RunBackendOptions = { + /** relative entry point path without extension, e.g. 'src/index' */ + entry: string; + /** Whether to forward the --inspect flag to the node process */ + inspectEnabled: boolean; + /** Whether to forward the --inspect-brk flag to the node process */ + inspectBrkEnabled: boolean; + /** Additional module to require via the --require flag to the node process */ + require?: string; +}; + +export async function runBackend(options: RunBackendOptions) { const envEnv = process.env as { NODE_ENV: string }; if (!envEnv.NODE_ENV) { envEnv.NODE_ENV = 'development'; From 6d2899cdca906c8429f089467e5153c5bb678ad9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 11:05:17 +0200 Subject: [PATCH 096/268] docs/tooling: update backend dev bundling docs Signed-off-by: Patrik Oldsberg --- docs/tooling/cli/02-build-system.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/docs/tooling/cli/02-build-system.md b/docs/tooling/cli/02-build-system.md index dfd95ae6eb..96c46bed6a 100644 --- a/docs/tooling/cli/02-build-system.md +++ b/docs/tooling/cli/02-build-system.md @@ -364,22 +364,19 @@ load performance. ### Backend Development -The backend development bundling is also based on Webpack, but rather than -starting up a web server, the backend is started up using the -[`RunScriptWebpackPlugin`](https://www.npmjs.com/package/run-script-webpack-plugin). -The reason for using Webpack for development of the backend is both that it is a -convenient way to handle transpilation of a large set of packages, as well us -allowing us to use hot module replacement and maintaining state while reloading -individual backend modules. This is particularly useful when running the backend -with in-memory SQLite as the database choice. +The backend development setup does not use any bundling process. It runs a +Node.js process directly, with only-the-fly transpilation from TypeScript to +JavaScript. The transpilation is done with a custom transform based on +[SWC](https://swc.rs/). -Except for executing in Node.js rather than a web server, the backend -development bundling configuration is quite similar to the frontend one. It -shares most of the Webpack configuration, including the transpilation setup. -Some differences are that it does not inject any environment variables or node -module fallbacks, and it uses -[`webpack-node-externals`](https://www.npmjs.com/package/webpack-node-externals) -to avoid bundling in dependency modules. +During development the backend Node.js process will restart whenever there is a +change to the source code. This means that any in-memory data will be lost. In +order to store data between restarts, the backend process has an IPC channel +available to store and restore data from the parent CLI process. The primary +purpose of this, which is already built-in, is to restore the contents of +databases when using SQLite for development. You can also use it for your own +purposes too, with the `DevDataStore` utility exported from the +`@backstage/backend-dev-utils` package. If you want to inspect the running Node.js process, the `--inspect` and `--inspect-brk` flags can be used, as they will be passed through as options to From 321a994358323858ee4508a696f7c0f105438e02 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 11:44:36 +0200 Subject: [PATCH 097/268] backend-defaults: define token field on credentials as non-enumerable Signed-off-by: Patrik Oldsberg --- .changeset/clever-rats-rush.md | 5 ++ .../src/entrypoints/auth/helpers.test.ts | 67 +++++++++++++++++++ .../src/entrypoints/auth/helpers.ts | 50 +++++++++----- 3 files changed, 104 insertions(+), 18 deletions(-) create mode 100644 .changeset/clever-rats-rush.md create mode 100644 packages/backend-defaults/src/entrypoints/auth/helpers.test.ts diff --git a/.changeset/clever-rats-rush.md b/.changeset/clever-rats-rush.md new file mode 100644 index 0000000000..c34427f8f5 --- /dev/null +++ b/.changeset/clever-rats-rush.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-defaults': patch +--- + +Sensitive internal fields on `BackstageCredentials` objects are now defined as read-only properties in order to minimize risk of leakage. diff --git a/packages/backend-defaults/src/entrypoints/auth/helpers.test.ts b/packages/backend-defaults/src/entrypoints/auth/helpers.test.ts new file mode 100644 index 0000000000..8454aa3ecc --- /dev/null +++ b/packages/backend-defaults/src/entrypoints/auth/helpers.test.ts @@ -0,0 +1,67 @@ +/* + * Copyright 2024 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 { + createCredentialsWithNonePrincipal, + createCredentialsWithServicePrincipal, + createCredentialsWithUserPrincipal, +} from './helpers'; + +describe('credentials', () => { + it('should be created', () => { + expect(createCredentialsWithServicePrincipal('my-service')).toEqual({ + $$type: '@backstage/BackstageCredentials', + version: 'v1', + principal: { + type: 'service', + subject: 'my-service', + }, + }); + + expect( + createCredentialsWithUserPrincipal('user:default/mock', 'my-token'), + ).toEqual({ + $$type: '@backstage/BackstageCredentials', + version: 'v1', + principal: { + type: 'user', + userEntityRef: 'user:default/mock', + }, + }); + + expect(createCredentialsWithNonePrincipal()).toEqual({ + $$type: '@backstage/BackstageCredentials', + version: 'v1', + principal: { + type: 'none', + }, + }); + }); + + it('should not include tokens when serialized', () => { + expect( + JSON.stringify( + createCredentialsWithServicePrincipal('my-service', 'my-token'), + ), + ).not.toMatch(/my-token/); + + expect( + JSON.stringify( + createCredentialsWithUserPrincipal('user:default/mock', 'my-token'), + ), + ).not.toMatch(/my-token/); + }); +}); diff --git a/packages/backend-defaults/src/entrypoints/auth/helpers.ts b/packages/backend-defaults/src/entrypoints/auth/helpers.ts index eebe45eb76..dad36670b9 100644 --- a/packages/backend-defaults/src/entrypoints/auth/helpers.ts +++ b/packages/backend-defaults/src/entrypoints/auth/helpers.ts @@ -28,16 +28,23 @@ export function createCredentialsWithServicePrincipal( token?: string, accessRestrictions?: BackstagePrincipalAccessRestrictions, ): InternalBackstageCredentials { - return { - $$type: '@backstage/BackstageCredentials', - version: 'v1', - token, - principal: { - type: 'service', - subject: sub, - accessRestrictions, + return Object.defineProperty( + { + $$type: '@backstage/BackstageCredentials', + version: 'v1', + principal: { + type: 'service', + subject: sub, + accessRestrictions, + }, }, - }; + 'token', + { + enumerable: false, + configurable: true, + value: token, + }, + ); } export function createCredentialsWithUserPrincipal( @@ -45,16 +52,23 @@ export function createCredentialsWithUserPrincipal( token: string, expiresAt?: Date, ): InternalBackstageCredentials { - return { - $$type: '@backstage/BackstageCredentials', - version: 'v1', - token, - expiresAt, - principal: { - type: 'user', - userEntityRef: sub, + return Object.defineProperty( + { + $$type: '@backstage/BackstageCredentials', + version: 'v1', + expiresAt, + principal: { + type: 'user', + userEntityRef: sub, + }, }, - }; + 'token', + { + enumerable: false, + configurable: true, + value: token, + }, + ); } export function createCredentialsWithNonePrincipal(): InternalBackstageCredentials { From dea0d6cd11d95ab4f0d747d7513d02115daf8a52 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 12:00:17 +0200 Subject: [PATCH 098/268] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Patrik Oldsberg --- docs/tooling/cli/02-build-system.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tooling/cli/02-build-system.md b/docs/tooling/cli/02-build-system.md index 96c46bed6a..f1fb5f6c9e 100644 --- a/docs/tooling/cli/02-build-system.md +++ b/docs/tooling/cli/02-build-system.md @@ -365,7 +365,7 @@ load performance. ### Backend Development The backend development setup does not use any bundling process. It runs a -Node.js process directly, with only-the-fly transpilation from TypeScript to +Node.js process directly, with on-the-fly transpilation from TypeScript to JavaScript. The transpilation is done with a custom transform based on [SWC](https://swc.rs/). @@ -375,7 +375,7 @@ order to store data between restarts, the backend process has an IPC channel available to store and restore data from the parent CLI process. The primary purpose of this, which is already built-in, is to restore the contents of databases when using SQLite for development. You can also use it for your own -purposes too, with the `DevDataStore` utility exported from the +purposes, with the `DevDataStore` utility exported from the `@backstage/backend-dev-utils` package. If you want to inspect the running Node.js process, the `--inspect` and From 8fd7debe89d56c9cdffddf2d48d3b6ef559d2a49 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 12:44:08 +0200 Subject: [PATCH 099/268] backend-defaults: pretty-print JSON responses during development Signed-off-by: Patrik Oldsberg --- .changeset/slow-walls-report.md | 13 +++++++++++++ .../core-services/root-http-router.md | 9 ++++++++- .../rootHttpRouter/rootHttpRouterServiceFactory.ts | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .changeset/slow-walls-report.md diff --git a/.changeset/slow-walls-report.md b/.changeset/slow-walls-report.md new file mode 100644 index 0000000000..e5ab380006 --- /dev/null +++ b/.changeset/slow-walls-report.md @@ -0,0 +1,13 @@ +--- +'@backstage/backend-defaults': patch +--- + +The default root HTTP service implementation will now pretty-print JSON responses in development. + +If you are overriding the `rootHttpRouterServiceFactory` with a `configure` function that doesn't call `applyDefaults`, you can introduce this functionality by adding the following snippet inside `configure`: + +```ts +if (process.env.NODE_ENV === 'development') { + app.set('json spaces', 2); +} +``` diff --git a/docs/backend-system/core-services/root-http-router.md b/docs/backend-system/core-services/root-http-router.md index 88a10455f5..a2316b957b 100644 --- a/docs/backend-system/core-services/root-http-router.md +++ b/docs/backend-system/core-services/root-http-router.md @@ -59,7 +59,7 @@ const backend = createBackend(); backend.add( rootHttpRouterServiceFactory({ - configure: ({ app, middleware, routes, config, logger, lifecycle }) => { + configure: ({ app, middleware, routes, config, logger, healthRouter }) => { // Refer to https://expressjs.com/en/guide/writing-middleware.html on how to write express middleware const customMiddleware = { logging(): RequestHandler { @@ -88,11 +88,18 @@ backend.add( }, }; + // The default implementation pretty-prints JSON responses in development + if (process.env.NODE_ENV === 'development') { + app.set('json spaces', 2); + } + // the built in middleware is provided through an option in the configure function app.use(middleware.helmet()); app.use(middleware.cors()); app.use(middleware.compression()); + app.use(healthRouter); + // you can add you your own middleware in here app.use(customMiddleware.logging()); diff --git a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts index a18ddbe096..59811c15d4 100644 --- a/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts +++ b/packages/backend-defaults/src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.ts @@ -106,6 +106,9 @@ const rootHttpRouterServiceFactoryWithOptions = ( lifecycle, healthRouter, applyDefaults() { + if (process.env.NODE_ENV === 'development') { + app.set('json spaces', 2); + } app.use(middleware.helmet()); app.use(middleware.cors()); app.use(middleware.compression()); From a881f94e6387ea3920d205e650fbab5252237c39 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 15:05:44 +0200 Subject: [PATCH 100/268] docs/tooling: fix headers on profiling page Signed-off-by: Patrik Oldsberg --- docs/tooling/local-dev/profiling.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tooling/local-dev/profiling.md b/docs/tooling/local-dev/profiling.md index bbc263c3d5..b1c904d6d0 100644 --- a/docs/tooling/local-dev/profiling.md +++ b/docs/tooling/local-dev/profiling.md @@ -7,7 +7,7 @@ description: Finding performance bottlenecks in your Backstage application Profiling can help you find performance bottlenecks in your code. This guide will show you how to profile both the backend and frontend of your Backstage application. -# Backend +## Backend To profile the backend, start the backend with the `--inspect` flag: @@ -27,7 +27,7 @@ You can also use the `Memory` tab to profile the backend's memory usage and find It's recommended to start profiling with short periods of time to avoid too much data being collected. -## Stress testing +### Stress testing To get more out of profiling, you might want to introduce additional load to your application with some tooling. One such tool is called [AutoCannon](https://www.npmjs.com/package/autocannon) which can be used to stress test the @@ -55,7 +55,7 @@ autocannon -H "Authorization=Bearer autocannon12345" http://localhost:7007/api/c See more command options in the AutoCannon documentation. -# Frontend +## Frontend Profiling the frontend can be done by using the `React DevTools` extension for Chrome or Firefox. The extension is available for download from the Chrome Web Store or the Firefox Add-ons website. From 1ff1dbde197b10d69c4f1e6fa40508e1ab384373 Mon Sep 17 00:00:00 2001 From: Heikki Hellgren Date: Wed, 25 Sep 2024 15:11:57 +0300 Subject: [PATCH 101/268] feat: allow defining custom sign in error element this allows to customize what error is shown to the user if the sign in fails. especially with the `ProxiedSignInPage` users might want to get more information what went wrong and what to do next instead cryptic error panel. Signed-off-by: Heikki Hellgren --- .changeset/good-eels-drive.md | 5 ++ packages/core-components/report.api.md | 6 +- .../ProxiedSignInPage.test.tsx | 56 ++++++++++++++++++- .../ProxiedSignInPage/ProxiedSignInPage.tsx | 14 ++++- .../src/layout/SignInPage/SignInPage.tsx | 29 +++++++--- 5 files changed, 98 insertions(+), 12 deletions(-) create mode 100644 .changeset/good-eels-drive.md diff --git a/.changeset/good-eels-drive.md b/.changeset/good-eels-drive.md new file mode 100644 index 0000000000..c90a1263ec --- /dev/null +++ b/.changeset/good-eels-drive.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +It is possible to define a custom error element to be shown when sign in fails diff --git a/packages/core-components/report.api.md b/packages/core-components/report.api.md index 24c835f638..7ffb430c7f 100644 --- a/packages/core-components/report.api.md +++ b/packages/core-components/report.api.md @@ -15,6 +15,7 @@ import { CardHeaderProps } from '@material-ui/core/CardHeader'; import { Column } from '@material-table/core'; import { ComponentClass } from 'react'; import { ComponentProps } from 'react'; +import { ComponentType } from 'react'; import { default as CSS_2 } from 'csstype'; import { CSSProperties } from 'react'; import { ElementType } from 'react'; @@ -876,6 +877,9 @@ export const ProxiedSignInPage: ( export type ProxiedSignInPageProps = SignInPageProps & { provider: string; headers?: HeadersInit | (() => HeadersInit) | (() => Promise); + ErrorComponent?: ComponentType<{ + error?: Error; + }>; }; // Warning: (ae-missing-release-tag) "ResponseErrorPanel" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -1748,7 +1752,7 @@ export type WarningPanelClassKey = // src/layout/Sidebar/config.d.ts:8:1 - (ae-undocumented) Missing documentation for "SubmenuOptions". // src/layout/Sidebar/config.d.ts:12:22 - (ae-undocumented) Missing documentation for "sidebarConfig". // src/layout/Sidebar/config.d.ts:52:22 - (ae-undocumented) Missing documentation for "SIDEBAR_INTRO_LOCAL_STORAGE". -// src/layout/SignInPage/SignInPage.d.ts:17:1 - (ae-undocumented) Missing documentation for "SignInPage". +// src/layout/SignInPage/SignInPage.d.ts:26:1 - (ae-undocumented) Missing documentation for "SignInPage". // src/layout/SignInPage/customProvider.d.ts:3:1 - (ae-undocumented) Missing documentation for "CustomProviderClassKey". // src/layout/SignInPage/styles.d.ts:2:1 - (ae-undocumented) Missing documentation for "SignInPageClassKey". // src/layout/SignInPage/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "SignInProviderConfig". diff --git a/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.test.tsx b/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.test.tsx index ad7e650d24..d0cfbbbe31 100644 --- a/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.test.tsx +++ b/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.test.tsx @@ -19,9 +19,9 @@ import { render, screen } from '@testing-library/react'; import { rest } from 'msw'; import { setupServer } from 'msw/node'; import { - TestApiProvider, mockApis, registerMswTestHooks, + TestApiProvider, wrapInTestApp, } from '@backstage/test-utils'; import { ProxiedSignInPage } from './ProxiedSignInPage'; @@ -99,4 +99,58 @@ describe('ProxiedSignInPage', () => { screen.findByText('Request failed with 401 Unauthorized'), ).resolves.toBeInTheDocument(); }); + + it('should allow custom error component', async () => { + const ErrorComponent = ({ error }: { error?: Error }) => ( + <> +

Failed to authenticate

+
{error?.message}
+ + ); + + const CustomSubject = wrapInTestApp(
authenticated
, { + components: { + SignInPage: props => ( + 'http://example.com/api/auth', + }, + ], + ]} + > + + + ), + }, + }); + + worker.use( + rest.get('http://example.com/api/auth/test/refresh', (_, res, ctx) => + res( + ctx.status(401), + ctx.set('Content-Type', 'application/json'), + ctx.json({ + error: { name: 'Error', message: 'not-displayed' }, + }), + ), + ), + ); + + render(CustomSubject); + + await expect( + screen.findByText('Failed to authenticate'), + ).resolves.toBeInTheDocument(); + + await expect( + screen.findByText('Request failed with 401 Unauthorized'), + ).resolves.toBeInTheDocument(); + }); }); diff --git a/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.tsx b/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.tsx index df0d256312..01519ce0b3 100644 --- a/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.tsx +++ b/packages/core-components/src/layout/ProxiedSignInPage/ProxiedSignInPage.tsx @@ -19,7 +19,7 @@ import { SignInPageProps, useApi, } from '@backstage/core-plugin-api'; -import React from 'react'; +import React, { ComponentType } from 'react'; import { useAsync, useMountEffect } from '@react-hookz/web'; import { ErrorPanel } from '../../components/ErrorPanel'; import { Progress } from '../../components/Progress'; @@ -44,6 +44,12 @@ export type ProxiedSignInPageProps = SignInPageProps & { * underlying provider */ headers?: HeadersInit | (() => HeadersInit) | (() => Promise); + + /** + * Error component to be rendered instead of the default error panel in case + * sign in fails. + */ + ErrorComponent?: ComponentType<{ error?: Error }>; }; /** @@ -82,7 +88,11 @@ export const ProxiedSignInPage = (props: ProxiedSignInPageProps) => { if (status === 'loading') { return ; } else if (error) { - return ; + return props.ErrorComponent ? ( + + ) : ( + + ); } return null; diff --git a/packages/core-components/src/layout/SignInPage/SignInPage.tsx b/packages/core-components/src/layout/SignInPage/SignInPage.tsx index fb8f804d5e..3dcccb50df 100644 --- a/packages/core-components/src/layout/SignInPage/SignInPage.tsx +++ b/packages/core-components/src/layout/SignInPage/SignInPage.tsx @@ -24,7 +24,7 @@ import { UserIdentity } from './UserIdentity'; import Button from '@material-ui/core/Button'; import Grid from '@material-ui/core/Grid'; import Typography from '@material-ui/core/Typography'; -import React, { ReactNode, useState } from 'react'; +import React, { ComponentType, ReactNode, useState } from 'react'; import { useMountEffect } from '@react-hookz/web'; import { Progress } from '../../components/Progress'; import { Content } from '../Content/Content'; @@ -38,14 +38,22 @@ import { IdentityProviders, SignInProviderConfig } from './types'; import { coreComponentsTranslationRef } from '../../translation'; import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; -type MultiSignInPageProps = SignInPageProps & { +type CommonSignInPageProps = SignInPageProps & { + /** + * Error component to be rendered instead of the default error panel in case + * sign in fails. + */ + ErrorComponent?: ComponentType<{ error?: Error }>; +}; + +type MultiSignInPageProps = CommonSignInPageProps & { providers: IdentityProviders; title?: string; titleComponent?: ReactNode; align?: 'center' | 'left'; }; -type SingleSignInPageProps = SignInPageProps & { +type SingleSignInPageProps = CommonSignInPageProps & { provider: SignInProviderConfig; auto?: boolean; }; @@ -101,6 +109,7 @@ export const SingleSignInPage = ({ provider, auto, onSignInSuccess, + ErrorComponent, }: SingleSignInPageProps) => { const classes = useStyles(); const authApi = useApi(provider.apiRef); @@ -190,11 +199,15 @@ export const SingleSignInPage = ({ } > {provider.message} - {error && error.name !== 'PopupRejectedError' && ( - - {error.message} - - )} + {error && + error.name !== 'PopupRejectedError' && + (ErrorComponent ? ( + + ) : ( + + {error.message} + + ))} From 5ccf7a9521e087af25a101a19942f8e8f0f9325b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:23:05 +0000 Subject: [PATCH 102/268] Update browser-actions/setup-chrome digest to 1208fbf Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/verify_e2e-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify_e2e-windows.yml b/.github/workflows/verify_e2e-windows.yml index b6bfef51e5..0a25da3c5e 100644 --- a/.github/workflows/verify_e2e-windows.yml +++ b/.github/workflows/verify_e2e-windows.yml @@ -75,7 +75,7 @@ jobs: npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"} - name: setup chrome - uses: browser-actions/setup-chrome@803ef6dfb4fdf22089c9563225d95e4a515820a0 # latest + uses: browser-actions/setup-chrome@1208fbfeb50c2d4be7a87c2fa47d4cd7db1270e3 # latest - name: yarn install uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15 From 3109c24cb3753c2901a4084e679846986db5fc46 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 16:09:23 +0200 Subject: [PATCH 103/268] promote all backend feature exports to main entry point Signed-off-by: Patrik Oldsberg --- .changeset/lovely-jokes-breathe.md | 32 +++++++++++++++++++ packages/backend/src/index.ts | 24 +++++++------- plugins/app-backend/report.api.md | 6 ++++ plugins/app-backend/src/index.ts | 6 ++++ .../catalog-backend-module-aws/report.api.md | 9 ++++++ .../catalog-backend-module-aws/src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../catalog-backend-module-azure/src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ .../report.api.md | 6 ++++ .../src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ plugins/catalog-backend/report.api.md | 6 ++++ plugins/catalog-backend/src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ .../events-backend-module-azure/report.api.md | 9 ++++++ .../events-backend-module-azure/src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../events-backend-module-gerrit/src/index.ts | 6 ++++ plugins/events-backend/report.api.md | 6 ++++ plugins/events-backend/src/index.ts | 6 ++++ plugins/kubernetes-backend/report.api.md | 6 ++++ plugins/kubernetes-backend/src/index.ts | 6 ++++ plugins/permission-backend/report.api.md | 6 ++++ plugins/permission-backend/src/index.ts | 6 ++++ plugins/proxy-backend/report.api.md | 6 ++++ plugins/proxy-backend/src/index.ts | 6 ++++ plugins/scaffolder-backend/report.api.md | 6 ++++ plugins/scaffolder-backend/src/index.ts | 6 ++++ .../report.api.md | 6 ++++ .../src/index.ts | 6 ++++ .../report.api.md | 9 ++++++ .../src/index.ts | 6 ++++ .../report.api.md | 6 ++++ .../src/index.ts | 6 ++++ .../search-backend-module-pg/report.api.md | 9 ++++++ plugins/search-backend-module-pg/src/index.ts | 6 ++++ .../report.api.md | 6 ++++ .../src/index.ts | 6 ++++ plugins/search-backend/report.api.md | 6 ++++ plugins/search-backend/src/index.ts | 6 ++++ plugins/techdocs-backend/report.api.md | 12 +++++-- plugins/techdocs-backend/src/index.ts | 5 +++ plugins/user-settings-backend/report.api.md | 9 ++++++ plugins/user-settings-backend/src/index.ts | 6 ++++ 58 files changed, 427 insertions(+), 15 deletions(-) create mode 100644 .changeset/lovely-jokes-breathe.md diff --git a/.changeset/lovely-jokes-breathe.md b/.changeset/lovely-jokes-breathe.md new file mode 100644 index 0000000000..f5782832eb --- /dev/null +++ b/.changeset/lovely-jokes-breathe.md @@ -0,0 +1,32 @@ +--- +'@backstage/plugin-search-backend-module-elasticsearch': minor +'@backstage/plugin-scaffolder-backend': minor +'@backstage/plugin-techdocs-backend': minor +'@backstage/plugin-catalog-backend': minor +'@backstage/plugin-search-backend': minor +'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch +'@backstage/plugin-catalog-backend-module-bitbucket-server': patch +'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch +'@backstage/plugin-events-backend-module-bitbucket-cloud': patch +'@backstage/plugin-catalog-backend-module-msgraph': patch +'@backstage/plugin-search-backend-module-techdocs': patch +'@backstage/plugin-catalog-backend-module-gerrit': patch +'@backstage/plugin-catalog-backend-module-github': patch +'@backstage/plugin-catalog-backend-module-gitlab': patch +'@backstage/plugin-events-backend-module-aws-sqs': patch +'@backstage/plugin-search-backend-module-catalog': patch +'@backstage/plugin-search-backend-module-explore': patch +'@backstage/plugin-catalog-backend-module-azure': patch +'@backstage/plugin-events-backend-module-gerrit': patch +'@backstage/plugin-events-backend-module-azure': patch +'@backstage/plugin-catalog-backend-module-aws': patch +'@backstage/plugin-search-backend-module-pg': patch +'@backstage/plugin-user-settings-backend': patch +'@backstage/plugin-kubernetes-backend': patch +'@backstage/plugin-permission-backend': patch +'@backstage/plugin-events-backend': patch +'@backstage/plugin-proxy-backend': patch +'@backstage/plugin-app-backend': patch +--- + +The export for the new backend system at the `/alpha` export is now also available via the main entry point, which means that you can remove the `/alpha` suffix from the import. diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 3e8c2910b1..b9130d452f 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -23,37 +23,37 @@ const backend = createBackend(); // access root-scoped services by adding `deps`. const searchLoader = createBackendFeatureLoader({ *loader() { - yield import('@backstage/plugin-search-backend/alpha'); - yield import('@backstage/plugin-search-backend-module-catalog/alpha'); - yield import('@backstage/plugin-search-backend-module-explore/alpha'); - yield import('@backstage/plugin-search-backend-module-techdocs/alpha'); + yield import('@backstage/plugin-search-backend'); + yield import('@backstage/plugin-search-backend-module-catalog'); + yield import('@backstage/plugin-search-backend-module-explore'); + yield import('@backstage/plugin-search-backend-module-techdocs'); }, }); backend.add(import('@backstage/plugin-auth-backend')); backend.add(import('./authModuleGithubProvider')); backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); -backend.add(import('@backstage/plugin-app-backend/alpha')); +backend.add(import('@backstage/plugin-app-backend')); backend.add(import('@backstage/plugin-catalog-backend-module-unprocessed')); backend.add( import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'), ); -backend.add(import('@backstage/plugin-catalog-backend/alpha')); -backend.add(import('@backstage/plugin-events-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); +backend.add(import('@backstage/plugin-events-backend')); backend.add(import('@backstage/plugin-devtools-backend')); -backend.add(import('@backstage/plugin-kubernetes-backend/alpha')); +backend.add(import('@backstage/plugin-kubernetes-backend')); backend.add( import('@backstage/plugin-permission-backend-module-allow-all-policy'), ); -backend.add(import('@backstage/plugin-permission-backend/alpha')); -backend.add(import('@backstage/plugin-proxy-backend/alpha')); -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-permission-backend')); +backend.add(import('@backstage/plugin-proxy-backend')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.add(import('@backstage/plugin-scaffolder-backend-module-github')); backend.add( import('@backstage/plugin-catalog-backend-module-backstage-openapi'), ); backend.add(searchLoader); -backend.add(import('@backstage/plugin-techdocs-backend/alpha')); +backend.add(import('@backstage/plugin-techdocs-backend')); backend.add(import('@backstage/plugin-signals-backend')); backend.add(import('@backstage/plugin-notifications-backend')); diff --git a/plugins/app-backend/report.api.md b/plugins/app-backend/report.api.md index ab36eb95d3..b1a3eaa9a7 100644 --- a/plugins/app-backend/report.api.md +++ b/plugins/app-backend/report.api.md @@ -4,6 +4,7 @@ ```ts import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { ConfigSchema } from '@backstage/config-loader'; import { DatabaseService } from '@backstage/backend-plugin-api'; import express from 'express'; @@ -14,6 +15,10 @@ import { RootConfigService } from '@backstage/backend-plugin-api'; // @public @deprecated (undocumented) export function createRouter(options: RouterOptions): Promise; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public @deprecated (undocumented) export interface RouterOptions { appPackageName: string; @@ -33,6 +38,7 @@ export interface RouterOptions { // Warnings were encountered during analysis: // +// src/index.d.ts:8:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/router.d.ts:9:1 - (ae-undocumented) Missing documentation for "RouterOptions". // src/service/router.d.ts:10:5 - (ae-undocumented) Missing documentation for "config". // src/service/router.d.ts:11:5 - (ae-undocumented) Missing documentation for "logger". diff --git a/plugins/app-backend/src/index.ts b/plugins/app-backend/src/index.ts index c91416eac1..f59fcb7da5 100644 --- a/plugins/app-backend/src/index.ts +++ b/plugins/app-backend/src/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { appPlugin as feature } from './service/appPlugin'; + /** * A Backstage backend plugin that serves the Backstage frontend app * @@ -21,3 +23,7 @@ */ export * from './service/router'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/catalog-backend-module-aws/report.api.md b/plugins/catalog-backend-module-aws/report.api.md index 3d24c71035..ed0eac9864 100644 --- a/plugins/catalog-backend-module-aws/report.api.md +++ b/plugins/catalog-backend-module-aws/report.api.md @@ -5,6 +5,7 @@ ```ts import { AwsCredentialIdentity } from '@aws-sdk/types'; import { AwsCredentialsManager } from '@backstage/integration-aws-node'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogProcessor } from '@backstage/plugin-catalog-node'; import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node'; import { CatalogProcessorParser } from '@backstage/plugin-catalog-node'; @@ -113,8 +114,14 @@ export type EksClusterEntityTransformer = ( accountId: string, ) => Promise; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/processors/AwsEKSClusterProcessor.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/processors/AwsEKSClusterProcessor.d.ts:26:5 - (ae-undocumented) Missing documentation for "getProcessorName". // src/processors/AwsEKSClusterProcessor.d.ts:27:5 - (ae-undocumented) Missing documentation for "readLocation". @@ -125,4 +132,6 @@ export type EksClusterEntityTransformer = ( // src/processors/AwsS3DiscoveryProcessor.d.ts:16:5 - (ae-undocumented) Missing documentation for "readLocation". // src/providers/AwsS3EntityProvider.d.ts:20:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/AwsS3EntityProvider.d.ts:31:5 - (ae-undocumented) Missing documentation for "refresh". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-aws/src/index.ts b/plugins/catalog-backend-module-aws/src/index.ts index de8f9fd7b2..8fbc7e3b87 100644 --- a/plugins/catalog-backend-module-aws/src/index.ts +++ b/plugins/catalog-backend-module-aws/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A Backstage catalog backend module that helps integrate towards AWS * diff --git a/plugins/catalog-backend-module-azure/report.api.md b/plugins/catalog-backend-module-azure/report.api.md index f3121296a5..00a18ee604 100644 --- a/plugins/catalog-backend-module-azure/report.api.md +++ b/plugins/catalog-backend-module-azure/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogProcessor } from '@backstage/plugin-catalog-node'; import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node'; import { Config } from '@backstage/config'; @@ -54,11 +55,19 @@ export class AzureDevOpsEntityProvider implements EntityProvider { refresh(logger: LoggerService): Promise; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/processors/AzureDevOpsDiscoveryProcessor.d.ts:26:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/processors/AzureDevOpsDiscoveryProcessor.d.ts:33:5 - (ae-undocumented) Missing documentation for "getProcessorName". // src/processors/AzureDevOpsDiscoveryProcessor.d.ts:34:5 - (ae-undocumented) Missing documentation for "readLocation". // src/providers/AzureDevOpsEntityProvider.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/AzureDevOpsEntityProvider.d.ts:29:5 - (ae-undocumented) Missing documentation for "refresh". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-azure/src/index.ts b/plugins/catalog-backend-module-azure/src/index.ts index a71c40ee6c..f844d9a7b6 100644 --- a/plugins/catalog-backend-module-azure/src/index.ts +++ b/plugins/catalog-backend-module-azure/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A Backstage catalog backend module that helps integrate towards Azure * diff --git a/plugins/catalog-backend-module-bitbucket-cloud/report.api.md b/plugins/catalog-backend-module-bitbucket-cloud/report.api.md index d0248b3973..2ddf5f5401 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/report.api.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/report.api.md @@ -4,6 +4,7 @@ ```ts import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { EntityProvider } from '@backstage/plugin-catalog-node'; @@ -37,9 +38,17 @@ export class BitbucketCloudEntityProvider implements EntityProvider { refresh(logger: LoggerService): Promise; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/providers/BitbucketCloudEntityProvider.d.ts:26:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/BitbucketCloudEntityProvider.d.ts:42:5 - (ae-undocumented) Missing documentation for "refresh". // src/providers/BitbucketCloudEntityProvider.d.ts:44:5 - (ae-undocumented) Missing documentation for "onRepoPush". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-cloud/src/index.ts b/plugins/catalog-backend-module-bitbucket-cloud/src/index.ts index d730d8618d..ef693fedc3 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/src/index.ts +++ b/plugins/catalog-backend-module-bitbucket-cloud/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A Backstage catalog backend module that helps integrate towards Bitbucket Cloud * diff --git a/plugins/catalog-backend-module-bitbucket-server/report.api.md b/plugins/catalog-backend-module-bitbucket-server/report.api.md index a7febe8e7a..33acd9a926 100644 --- a/plugins/catalog-backend-module-bitbucket-server/report.api.md +++ b/plugins/catalog-backend-module-bitbucket-server/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { BitbucketServerIntegrationConfig } from '@backstage/integration'; import { Config } from '@backstage/config'; import { Entity } from '@backstage/catalog-model'; @@ -110,8 +111,14 @@ export type BitbucketServerRepository = { archived: boolean; }; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/lib/BitbucketServerClient.d.ts:11:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/lib/BitbucketServerClient.d.ts:17:5 - (ae-undocumented) Missing documentation for "listProjects". // src/lib/BitbucketServerClient.d.ts:20:5 - (ae-undocumented) Missing documentation for "listRepositories". @@ -124,4 +131,6 @@ export type BitbucketServerRepository = { // src/lib/types.d.ts:14:1 - (ae-undocumented) Missing documentation for "BitbucketServerProject". // src/providers/BitbucketServerEntityProvider.d.ts:20:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/BitbucketServerEntityProvider.d.ts:32:5 - (ae-undocumented) Missing documentation for "refresh". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-server/src/index.ts b/plugins/catalog-backend-module-bitbucket-server/src/index.ts index 34ac3a9966..7bc1737803 100644 --- a/plugins/catalog-backend-module-bitbucket-server/src/index.ts +++ b/plugins/catalog-backend-module-bitbucket-server/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A Backstage catalog backend module that helps integrate towards Bitbucket Server * diff --git a/plugins/catalog-backend-module-gerrit/report.api.md b/plugins/catalog-backend-module-gerrit/report.api.md index 56930f3357..5d78cba9aa 100644 --- a/plugins/catalog-backend-module-gerrit/report.api.md +++ b/plugins/catalog-backend-module-gerrit/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { EntityProvider } from '@backstage/plugin-catalog-node'; import { EntityProviderConnection } from '@backstage/plugin-catalog-node'; @@ -10,6 +11,10 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import { SchedulerService } from '@backstage/backend-plugin-api'; import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api'; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public (undocumented) export class GerritEntityProvider implements EntityProvider { // (undocumented) @@ -31,6 +36,7 @@ export class GerritEntityProvider implements EntityProvider { // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // src/providers/GerritEntityProvider.d.ts:5:1 - (ae-undocumented) Missing documentation for "GerritEntityProvider". // src/providers/GerritEntityProvider.d.ts:11:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/GerritEntityProvider.d.ts:17:5 - (ae-undocumented) Missing documentation for "getProviderName". diff --git a/plugins/catalog-backend-module-gerrit/src/index.ts b/plugins/catalog-backend-module-gerrit/src/index.ts index 133772d4b1..177932685e 100644 --- a/plugins/catalog-backend-module-gerrit/src/index.ts +++ b/plugins/catalog-backend-module-gerrit/src/index.ts @@ -14,4 +14,10 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + export { GerritEntityProvider } from './providers/GerritEntityProvider'; diff --git a/plugins/catalog-backend-module-github/report.api.md b/plugins/catalog-backend-module-github/report.api.md index 4ffe434615..52c061c8a5 100644 --- a/plugins/catalog-backend-module-github/report.api.md +++ b/plugins/catalog-backend-module-github/report.api.md @@ -5,6 +5,7 @@ ```ts import { AnalyzeOptions } from '@backstage/plugin-catalog-node'; import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { CatalogProcessor } from '@backstage/plugin-catalog-node'; import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node'; @@ -37,6 +38,10 @@ export const defaultUserTransformer: ( _ctx: TransformerContext, ) => Promise; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public export class GithubDiscoveryProcessor implements CatalogProcessor { constructor(options: { @@ -333,6 +338,8 @@ export type UserTransformer = ( // src/deprecated.d.ts:29:5 - (ae-undocumented) Missing documentation for "connect". // src/deprecated.d.ts:30:5 - (ae-undocumented) Missing documentation for "getProviderName". // src/deprecated.d.ts:31:5 - (ae-undocumented) Missing documentation for "refresh". +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/lib/defaultTransformers.d.ts:10:5 - (ae-undocumented) Missing documentation for "client". // src/lib/defaultTransformers.d.ts:11:5 - (ae-undocumented) Missing documentation for "query". // src/lib/defaultTransformers.d.ts:12:5 - (ae-undocumented) Missing documentation for "org". @@ -355,4 +362,6 @@ export type UserTransformer = ( // src/providers/GithubEntityProvider.d.ts:102:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration // src/providers/GithubMultiOrgEntityProvider.d.ts:84:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/GithubOrgEntityProvider.d.ts:71:5 - (ae-undocumented) Missing documentation for "fromConfig". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-github/src/index.ts b/plugins/catalog-backend-module-github/src/index.ts index ee6b061034..e7a96d8a3f 100644 --- a/plugins/catalog-backend-module-github/src/index.ts +++ b/plugins/catalog-backend-module-github/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A Backstage catalog backend module that helps integrate towards Github * diff --git a/plugins/catalog-backend-module-gitlab/report.api.md b/plugins/catalog-backend-module-gitlab/report.api.md index 0cc2f93ce1..ac7624986d 100644 --- a/plugins/catalog-backend-module-gitlab/report.api.md +++ b/plugins/catalog-backend-module-gitlab/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogProcessor } from '@backstage/plugin-catalog-node'; import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node'; import { Config } from '@backstage/config'; @@ -18,6 +19,10 @@ import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api'; import { SchedulerServiceTaskScheduleDefinition } from '@backstage/backend-plugin-api'; import { UserEntity } from '@backstage/catalog-model'; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public export class GitlabDiscoveryEntityProvider implements EntityProvider { // (undocumented) @@ -177,6 +182,8 @@ export interface UserTransformerOptions { // src/GitLabDiscoveryProcessor.d.ts:14:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/GitLabDiscoveryProcessor.d.ts:20:5 - (ae-undocumented) Missing documentation for "getProcessorName". // src/GitLabDiscoveryProcessor.d.ts:21:5 - (ae-undocumented) Missing documentation for "readLocation". +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/lib/types.d.ts:48:1 - (ae-undocumented) Missing documentation for "GitLabGroupSamlIdentity". // src/lib/types.d.ts:234:5 - (ae-undocumented) Missing documentation for "group". // src/lib/types.d.ts:235:5 - (ae-undocumented) Missing documentation for "providerConfig". @@ -196,4 +203,6 @@ export interface UserTransformerOptions { // src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:21:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:31:5 - (ae-undocumented) Missing documentation for "getProviderName". // src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:32:5 - (ae-undocumented) Missing documentation for "connect". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gitlab/src/index.ts b/plugins/catalog-backend-module-gitlab/src/index.ts index cedcb828d6..fa2de998b7 100644 --- a/plugins/catalog-backend-module-gitlab/src/index.ts +++ b/plugins/catalog-backend-module-gitlab/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A Backstage catalog backend module that helps integrate towards GitLab * diff --git a/plugins/catalog-backend-module-incremental-ingestion/report.api.md b/plugins/catalog-backend-module-incremental-ingestion/report.api.md index 7160ff504f..70a96ade80 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/report.api.md +++ b/plugins/catalog-backend-module-incremental-ingestion/report.api.md @@ -5,6 +5,7 @@ ```ts /// +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogBuilder } from '@backstage/plugin-catalog-backend'; import type { Config } from '@backstage/config'; import type { DeferredEntity } from '@backstage/plugin-catalog-node'; @@ -31,6 +32,10 @@ export type EntityIteratorResult = cursor?: T; }; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public (undocumented) export class IncrementalCatalogBuilder { // (undocumented) @@ -97,9 +102,13 @@ export type PluginEnvironment = { // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/service/IncrementalCatalogBuilder.d.ts:6:1 - (ae-undocumented) Missing documentation for "IncrementalCatalogBuilder". // src/service/IncrementalCatalogBuilder.d.ts:20:5 - (ae-undocumented) Missing documentation for "build". // src/service/IncrementalCatalogBuilder.d.ts:23:5 - (ae-undocumented) Missing documentation for "addIncrementalEntityProvider". // src/types.d.ts:106:1 - (ae-undocumented) Missing documentation for "IncrementalEntityProviderOptions". // src/types.d.ts:145:1 - (ae-undocumented) Missing documentation for "PluginEnvironment". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/index.ts b/plugins/catalog-backend-module-incremental-ingestion/src/index.ts index f381572149..fcd7670245 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/index.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * Provides efficient incremental ingestion of entities into the catalog. * diff --git a/plugins/catalog-backend-module-msgraph/report.api.md b/plugins/catalog-backend-module-msgraph/report.api.md index 3df99752db..3e29ed76df 100644 --- a/plugins/catalog-backend-module-msgraph/report.api.md +++ b/plugins/catalog-backend-module-msgraph/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogProcessor } from '@backstage/plugin-catalog-node'; import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node'; import { Config } from '@backstage/config'; @@ -36,6 +37,10 @@ export function defaultUserTransformer( userPhoto?: string, ): Promise; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public export type GroupMember = | (MicrosoftGraph.Group & { @@ -293,6 +298,8 @@ export type UserTransformer = ( // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/microsoftGraph/client.d.ts:109:5 - (ae-undocumented) Missing documentation for "getUserPhoto". // src/microsoftGraph/client.d.ts:129:5 - (ae-undocumented) Missing documentation for "getGroupPhoto". // src/microsoftGraph/client.d.ts:176:5 - (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-catalog-backend-module-msgraph" does not have an export "entityName" @@ -300,4 +307,6 @@ export type UserTransformer = ( // src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:31:5 - (ae-undocumented) Missing documentation for "getProcessorName". // src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:32:5 - (ae-undocumented) Missing documentation for "readLocation". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-msgraph/src/index.ts b/plugins/catalog-backend-module-msgraph/src/index.ts index f98cb907ec..4dd70d32e8 100644 --- a/plugins/catalog-backend-module-msgraph/src/index.ts +++ b/plugins/catalog-backend-module-msgraph/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A Backstage catalog backend module that helps integrate towards Microsoft Graph * diff --git a/plugins/catalog-backend/report.api.md b/plugins/catalog-backend/report.api.md index 6fff29f6f8..dcd0319c49 100644 --- a/plugins/catalog-backend/report.api.md +++ b/plugins/catalog-backend/report.api.md @@ -12,6 +12,7 @@ import { AnalyzeLocationRequest as AnalyzeLocationRequest_2 } from '@backstage/p import { AnalyzeLocationResponse as AnalyzeLocationResponse_2 } from '@backstage/plugin-catalog-common'; import { AnalyzeOptions as AnalyzeOptions_2 } from '@backstage/plugin-catalog-node'; import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { CatalogCollatorEntityTransformer as CatalogCollatorEntityTransformer_2 } from '@backstage/plugin-search-backend-module-catalog'; import { CatalogEntityDocument } from '@backstage/plugin-catalog-common'; @@ -349,6 +350,10 @@ export type EntityProviderMutation = EntityProviderMutation_2; // @public @deprecated (undocumented) export type EntityRelationSpec = EntityRelationSpec_2; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public (undocumented) export class FileReaderProcessor implements CatalogProcessor_2 { // (undocumented) @@ -516,6 +521,7 @@ export class UrlReaderProcessor implements CatalogProcessor_2 { // src/deprecated.d.ts:207:22 - (ae-undocumented) Missing documentation for "defaultCatalogCollatorEntityTransformer". // src/deprecated.d.ts:212:1 - (ae-undocumented) Missing documentation for "DefaultCatalogCollatorFactoryOptions". // src/deprecated.d.ts:217:1 - (ae-undocumented) Missing documentation for "CatalogCollatorEntityTransformer". +// src/index.d.ts:14:15 - (ae-undocumented) Missing documentation for "_feature". // src/processing/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "start". // src/processing/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "stop". // src/processors/AnnotateLocationEntityProcessor.d.ts:6:1 - (ae-undocumented) Missing documentation for "AnnotateLocationEntityProcessor". diff --git a/plugins/catalog-backend/src/index.ts b/plugins/catalog-backend/src/index.ts index e3374a6a8b..a55a5eb687 100644 --- a/plugins/catalog-backend/src/index.ts +++ b/plugins/catalog-backend/src/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { catalogPlugin as feature } from './service/CatalogPlugin'; + /** * The Backstage backend plugin that provides the Backstage catalog * @@ -27,3 +29,7 @@ export * from './service'; export * from './deprecated'; export * from './constants'; export * from './util'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/events-backend-module-aws-sqs/report.api.md b/plugins/events-backend-module-aws-sqs/report.api.md index eee183519d..6957a3036d 100644 --- a/plugins/events-backend-module-aws-sqs/report.api.md +++ b/plugins/events-backend-module-aws-sqs/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { EventsService } from '@backstage/plugin-events-node'; import { LoggerService } from '@backstage/backend-plugin-api'; @@ -21,8 +22,16 @@ export class AwsSqsConsumingEventPublisher { start(): Promise; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/publisher/AwsSqsConsumingEventPublisher.d.ts:21:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/publisher/AwsSqsConsumingEventPublisher.d.ts:28:5 - (ae-undocumented) Missing documentation for "start". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-aws-sqs/src/index.ts b/plugins/events-backend-module-aws-sqs/src/index.ts index 57f409c044..a16bc9be04 100644 --- a/plugins/events-backend-module-aws-sqs/src/index.ts +++ b/plugins/events-backend-module-aws-sqs/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * The module "sqs" for the Backstage backend plugin "events" * adding an AWS SQS-based publisher, diff --git a/plugins/events-backend-module-azure/report.api.md b/plugins/events-backend-module-azure/report.api.md index 0ad4d4e9fd..0109bad0e3 100644 --- a/plugins/events-backend-module-azure/report.api.md +++ b/plugins/events-backend-module-azure/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { EventParams } from '@backstage/plugin-events-node'; import { EventsService } from '@backstage/plugin-events-node'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; @@ -16,8 +17,16 @@ export class AzureDevOpsEventRouter extends SubTopicEventRouter { protected getSubscriberId(): string; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/router/AzureDevOpsEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". // src/router/AzureDevOpsEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-azure/src/index.ts b/plugins/events-backend-module-azure/src/index.ts index a1d56dc536..523673c562 100644 --- a/plugins/events-backend-module-azure/src/index.ts +++ b/plugins/events-backend-module-azure/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * The module "azure" for the Backstage backend plugin "events-backend" * adding an event router for Azure DevOps. diff --git a/plugins/events-backend-module-bitbucket-cloud/report.api.md b/plugins/events-backend-module-bitbucket-cloud/report.api.md index 51aa7f27cb..08c953f96b 100644 --- a/plugins/events-backend-module-bitbucket-cloud/report.api.md +++ b/plugins/events-backend-module-bitbucket-cloud/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { EventParams } from '@backstage/plugin-events-node'; import { EventsService } from '@backstage/plugin-events-node'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; @@ -16,8 +17,16 @@ export class BitbucketCloudEventRouter extends SubTopicEventRouter { protected getSubscriberId(): string; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/router/BitbucketCloudEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". // src/router/BitbucketCloudEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-bitbucket-cloud/src/index.ts b/plugins/events-backend-module-bitbucket-cloud/src/index.ts index 77aa9798ef..d7f0cfa4d7 100644 --- a/plugins/events-backend-module-bitbucket-cloud/src/index.ts +++ b/plugins/events-backend-module-bitbucket-cloud/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * The module "bitbucket-cloud" for the Backstage backend plugin "events-backend" * adding an event router for Bitbucket Cloud. diff --git a/plugins/events-backend-module-gerrit/report.api.md b/plugins/events-backend-module-gerrit/report.api.md index 7a3f75ca6f..58981896a9 100644 --- a/plugins/events-backend-module-gerrit/report.api.md +++ b/plugins/events-backend-module-gerrit/report.api.md @@ -3,10 +3,15 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { EventParams } from '@backstage/plugin-events-node'; import { EventsService } from '@backstage/plugin-events-node'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public export class GerritEventRouter extends SubTopicEventRouter { constructor(options: { events: EventsService }); @@ -18,6 +23,10 @@ export class GerritEventRouter extends SubTopicEventRouter { // Warnings were encountered during analysis: // +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/router/GerritEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". // src/router/GerritEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gerrit/src/index.ts b/plugins/events-backend-module-gerrit/src/index.ts index dfc314667f..4f2ba573ba 100644 --- a/plugins/events-backend-module-gerrit/src/index.ts +++ b/plugins/events-backend-module-gerrit/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * The module `gerrit` for the Backstage backend plugin "events-backend" * adding an event router for Gerrit. diff --git a/plugins/events-backend/report.api.md b/plugins/events-backend/report.api.md index 5511d8c410..8d39a28774 100644 --- a/plugins/events-backend/report.api.md +++ b/plugins/events-backend/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { EventBroker } from '@backstage/plugin-events-node'; import { EventParams } from '@backstage/plugin-events-node'; @@ -42,6 +43,10 @@ export class EventsBackend { start(): Promise; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public export class HttpPostIngressEventPublisher { // (undocumented) @@ -59,6 +64,7 @@ export class HttpPostIngressEventPublisher { // Warnings were encountered during analysis: // +// src/index.d.ts:9:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/DefaultEventBroker.d.ts:21:5 - (ae-undocumented) Missing documentation for "publish". // src/service/DefaultEventBroker.d.ts:22:5 - (ae-undocumented) Missing documentation for "subscribe". // src/service/EventsBackend.d.ts:14:5 - (ae-undocumented) Missing documentation for "setEventBroker". diff --git a/plugins/events-backend/src/index.ts b/plugins/events-backend/src/index.ts index 63dfa5d252..425de752fd 100644 --- a/plugins/events-backend/src/index.ts +++ b/plugins/events-backend/src/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { eventsPlugin as feature } from './service/EventsPlugin'; + /** * The Backstage backend plugin "events" that provides the event management. * @@ -22,3 +24,7 @@ export * from './deprecated'; export { HttpPostIngressEventPublisher } from './service/http'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/kubernetes-backend/report.api.md b/plugins/kubernetes-backend/report.api.md index e01ada7e1c..694d0b2695 100644 --- a/plugins/kubernetes-backend/report.api.md +++ b/plugins/kubernetes-backend/report.api.md @@ -6,6 +6,7 @@ import { AuthenticationStrategy as AuthenticationStrategy_2 } from '@backstage/plugin-kubernetes-node'; import { AuthMetadata as AuthMetadata_2 } from '@backstage/plugin-kubernetes-node'; import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { BackstageCredentials } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { ClusterDetails as ClusterDetails_2 } from '@backstage/plugin-kubernetes-node'; @@ -121,6 +122,10 @@ export type DispatchStrategyOptions = { }; }; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public @deprecated (undocumented) export type FetchResponseWrapper = k8sAuthTypes.FetchResponseWrapper; @@ -467,6 +472,7 @@ export type SigningCreds = { // src/auth/ServiceAccountStrategy.d.ts:9:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". // src/auth/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "AuthenticationStrategy". // src/auth/types.d.ts:9:1 - (ae-undocumented) Missing documentation for "KubernetesCredential". +// src/index.d.ts:10:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/KubernetesBuilder.d.ts:14:1 - (ae-undocumented) Missing documentation for "KubernetesEnvironment". // src/service/KubernetesBuilder.d.ts:15:5 - (ae-undocumented) Missing documentation for "logger". // src/service/KubernetesBuilder.d.ts:16:5 - (ae-undocumented) Missing documentation for "config". diff --git a/plugins/kubernetes-backend/src/index.ts b/plugins/kubernetes-backend/src/index.ts index d32dfc24be..186337cb81 100644 --- a/plugins/kubernetes-backend/src/index.ts +++ b/plugins/kubernetes-backend/src/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { kubernetesPlugin as feature } from './plugin'; + /** * A Backstage backend plugin that integrates towards Kubernetes * @@ -23,3 +25,7 @@ export * from './auth'; export * from './service'; export * from './types'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/permission-backend/report.api.md b/plugins/permission-backend/report.api.md index 11d5ca7d62..78e08d9873 100644 --- a/plugins/permission-backend/report.api.md +++ b/plugins/permission-backend/report.api.md @@ -4,6 +4,7 @@ ```ts import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import express from 'express'; import { HttpAuthService } from '@backstage/backend-plugin-api'; @@ -16,6 +17,10 @@ import { UserInfoService } from '@backstage/backend-plugin-api'; // @public @deprecated export function createRouter(options: RouterOptions): Promise; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public @deprecated export interface RouterOptions { // (undocumented) @@ -38,6 +43,7 @@ export interface RouterOptions { // Warnings were encountered during analysis: // +// src/index.d.ts:7:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "logger". // src/service/router.d.ts:14:5 - (ae-undocumented) Missing documentation for "discovery". // src/service/router.d.ts:15:5 - (ae-undocumented) Missing documentation for "policy". diff --git a/plugins/permission-backend/src/index.ts b/plugins/permission-backend/src/index.ts index 877b9070c3..29fca17cf3 100644 --- a/plugins/permission-backend/src/index.ts +++ b/plugins/permission-backend/src/index.ts @@ -14,8 +14,14 @@ * limitations under the License. */ +import { permissionPlugin as feature } from './plugin'; + /** * Backend for Backstage authorization and permissions. * @packageDocumentation */ export * from './service'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/proxy-backend/report.api.md b/plugins/proxy-backend/report.api.md index bf6ac6ae39..f299986239 100644 --- a/plugins/proxy-backend/report.api.md +++ b/plugins/proxy-backend/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import express from 'express'; import { Logger } from 'winston'; @@ -11,6 +12,10 @@ import { RootConfigService } from '@backstage/backend-plugin-api'; // @public @deprecated export function createRouter(options: RouterOptions): Promise; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public @deprecated (undocumented) export interface RouterOptions { // (undocumented) @@ -27,6 +32,7 @@ export interface RouterOptions { // Warnings were encountered during analysis: // +// src/index.d.ts:8:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/router.d.ts:9:1 - (ae-undocumented) Missing documentation for "RouterOptions". // src/service/router.d.ts:10:5 - (ae-undocumented) Missing documentation for "logger". // src/service/router.d.ts:11:5 - (ae-undocumented) Missing documentation for "config". diff --git a/plugins/proxy-backend/src/index.ts b/plugins/proxy-backend/src/index.ts index 8f5d5c79dc..4da38f069c 100644 --- a/plugins/proxy-backend/src/index.ts +++ b/plugins/proxy-backend/src/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + /** * A Backstage backend plugin that helps you set up proxy endpoints in the backend * @@ -21,3 +23,7 @@ */ export * from './service'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/scaffolder-backend/report.api.md b/plugins/scaffolder-backend/report.api.md index e791762416..979c8ddad3 100644 --- a/plugins/scaffolder-backend/report.api.md +++ b/plugins/scaffolder-backend/report.api.md @@ -9,6 +9,7 @@ import { ActionContext as ActionContext_2 } from '@backstage/plugin-scaffolder-n import { AuthService } from '@backstage/backend-plugin-api'; import { AutocompleteHandler } from '@backstage/plugin-scaffolder-node/alpha'; import * as azure from '@backstage/plugin-scaffolder-backend-module-azure'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { BackstageCredentials } from '@backstage/backend-plugin-api'; import * as bitbucket from '@backstage/plugin-scaffolder-backend-module-bitbucket'; import * as bitbucketCloud from '@backstage/plugin-scaffolder-backend-module-bitbucket-cloud'; @@ -504,6 +505,10 @@ export type DatabaseTaskStoreOptions = { // @public @deprecated export const executeShellCommand: typeof executeShellCommand_2; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public @deprecated export const fetchContents: typeof fetchContents_2; @@ -846,6 +851,7 @@ export type TemplatePermissionRuleInput< // src/deprecated.d.ts:13:22 - (ae-undocumented) Missing documentation for "createTemplateAction". // src/deprecated.d.ts:18:1 - (ae-undocumented) Missing documentation for "TaskSecrets". // src/deprecated.d.ts:23:1 - (ae-undocumented) Missing documentation for "TemplateAction". +// src/index.d.ts:10:15 - (ae-undocumented) Missing documentation for "_feature". // src/lib/templating/SecureTemplater.d.ts:6:1 - (ae-undocumented) Missing documentation for "TemplateFilter". // src/lib/templating/SecureTemplater.d.ts:11:1 - (ae-undocumented) Missing documentation for "TemplateGlobal". // src/scaffolder/actions/TemplateActionRegistry.d.ts:8:5 - (ae-undocumented) Missing documentation for "register". diff --git a/plugins/scaffolder-backend/src/index.ts b/plugins/scaffolder-backend/src/index.ts index 649a5df233..e53a9a9044 100644 --- a/plugins/scaffolder-backend/src/index.ts +++ b/plugins/scaffolder-backend/src/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { scaffolderPlugin as feature } from './ScaffolderPlugin'; + /** * The Backstage backend plugin that helps you create new things * @@ -24,4 +26,8 @@ export * from './scaffolder'; export * from './service/router'; export * from './lib'; +/** @public */ +const _feature = feature; +export default _feature; + export * from './deprecated'; diff --git a/plugins/search-backend-module-catalog/report.api.md b/plugins/search-backend-module-catalog/report.api.md index 9ab87b31fe..63ecce93e1 100644 --- a/plugins/search-backend-module-catalog/report.api.md +++ b/plugins/search-backend-module-catalog/report.api.md @@ -6,6 +6,7 @@ /// import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { CatalogEntityDocument } from '@backstage/plugin-catalog-common'; import { Config } from '@backstage/config'; @@ -52,6 +53,10 @@ export type DefaultCatalogCollatorFactoryOptions = { entityTransformer?: CatalogCollatorEntityTransformer; }; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // Warnings were encountered during analysis: // // src/collators/CatalogCollatorEntityTransformer.d.ts:4:1 - (ae-undocumented) Missing documentation for "CatalogCollatorEntityTransformer". @@ -61,4 +66,5 @@ export type DefaultCatalogCollatorFactoryOptions = { // src/collators/DefaultCatalogCollatorFactory.d.ts:51:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/collators/DefaultCatalogCollatorFactory.d.ts:53:5 - (ae-undocumented) Missing documentation for "getCollator". // src/collators/defaultCatalogCollatorEntityTransformer.d.ts:3:22 - (ae-undocumented) Missing documentation for "defaultCatalogCollatorEntityTransformer". +// src/index.d.ts:7:15 - (ae-undocumented) Missing documentation for "_feature". ``` diff --git a/plugins/search-backend-module-catalog/src/index.ts b/plugins/search-backend-module-catalog/src/index.ts index 7998562311..91726fb716 100644 --- a/plugins/search-backend-module-catalog/src/index.ts +++ b/plugins/search-backend-module-catalog/src/index.ts @@ -14,9 +14,15 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + /** * @packageDocumentation * A module for the search backend that exports Catalog modules. */ export * from './collators'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/search-backend-module-elasticsearch/report.api.md b/plugins/search-backend-module-elasticsearch/report.api.md index 5cb0671a54..9843582b13 100644 --- a/plugins/search-backend-module-elasticsearch/report.api.md +++ b/plugins/search-backend-module-elasticsearch/report.api.md @@ -7,6 +7,7 @@ import { ApiResponse } from '@opensearch-project/opensearch'; import { ApiResponse as ApiResponse_2 } from '@elastic/elasticsearch'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { BatchSearchEngineIndexer } from '@backstage/plugin-search-backend-node'; import { BulkHelper } from '@elastic/elasticsearch/lib/Helpers'; import { BulkStats } from '@elastic/elasticsearch/lib/Helpers'; @@ -391,6 +392,10 @@ export interface ElasticSearchTransportConstructor { }; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public export const isOpenSearchCompatible: ( opts: ElasticSearchClientOptions, @@ -552,4 +557,8 @@ export interface OpenSearchNodeOptions { // src/engines/ElasticSearchSearchEngineIndexer.d.ts:39:5 - (ae-undocumented) Missing documentation for "initialize". // src/engines/ElasticSearchSearchEngineIndexer.d.ts:40:5 - (ae-undocumented) Missing documentation for "index". // src/engines/ElasticSearchSearchEngineIndexer.d.ts:41:5 - (ae-undocumented) Missing documentation for "finalize". +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-elasticsearch/src/index.ts b/plugins/search-backend-module-elasticsearch/src/index.ts index e0b05014cc..a25ef80260 100644 --- a/plugins/search-backend-module-elasticsearch/src/index.ts +++ b/plugins/search-backend-module-elasticsearch/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A module for the search backend that implements search using ElasticSearch * diff --git a/plugins/search-backend-module-explore/report.api.md b/plugins/search-backend-module-explore/report.api.md index 8738ad2c86..2d8c907c00 100644 --- a/plugins/search-backend-module-explore/report.api.md +++ b/plugins/search-backend-module-explore/report.api.md @@ -6,6 +6,7 @@ /// import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; @@ -15,6 +16,10 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import { Readable } from 'stream'; import { TokenManager } from '@backstage/backend-common'; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public export interface ToolDocument extends IndexableDocument, ExploreTool {} @@ -48,4 +53,5 @@ export type ToolDocumentCollatorFactoryOptions = { // src/collators/ToolDocumentCollatorFactory.d.ts:37:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/collators/ToolDocumentCollatorFactory.d.ts:38:5 - (ae-undocumented) Missing documentation for "getCollator". // src/collators/ToolDocumentCollatorFactory.d.ts:39:5 - (ae-undocumented) Missing documentation for "execute". +// src/index.d.ts:7:15 - (ae-undocumented) Missing documentation for "_feature". ``` diff --git a/plugins/search-backend-module-explore/src/index.ts b/plugins/search-backend-module-explore/src/index.ts index ea94071984..520ae90e96 100644 --- a/plugins/search-backend-module-explore/src/index.ts +++ b/plugins/search-backend-module-explore/src/index.ts @@ -14,9 +14,15 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + /** * @packageDocumentation * A module for the search backend that exports Explore modules. */ export * from './collators'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/search-backend-module-pg/report.api.md b/plugins/search-backend-module-pg/report.api.md index 36346491fa..380d1cdb7b 100644 --- a/plugins/search-backend-module-pg/report.api.md +++ b/plugins/search-backend-module-pg/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { BatchSearchEngineIndexer } from '@backstage/plugin-search-backend-node'; import { Config } from '@backstage/config'; import { DatabaseService } from '@backstage/backend-plugin-api'; @@ -80,6 +81,10 @@ export interface DocumentResultRow { type: string; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public (undocumented) export class PgSearchEngine implements SearchEngine { // @deprecated @@ -235,4 +240,8 @@ export interface RawDocumentRow { // src/database/types.d.ts:30:5 - (ae-undocumented) Missing documentation for "document". // src/database/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "type". // src/database/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "highlight". +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file + +// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-pg/src/index.ts b/plugins/search-backend-module-pg/src/index.ts index fbc52735dd..eedb819593 100644 --- a/plugins/search-backend-module-pg/src/index.ts +++ b/plugins/search-backend-module-pg/src/index.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + /** * A module for the search backend that implements search using PostgreSQL * diff --git a/plugins/search-backend-module-techdocs/report.api.md b/plugins/search-backend-module-techdocs/report.api.md index ce9500a5f6..90a4fa9479 100644 --- a/plugins/search-backend-module-techdocs/report.api.md +++ b/plugins/search-backend-module-techdocs/report.api.md @@ -6,6 +6,7 @@ /// import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { DiscoveryService } from '@backstage/backend-plugin-api'; @@ -36,6 +37,10 @@ export class DefaultTechDocsCollatorFactory implements DocumentCollatorFactory { readonly visibilityPermission: Permission; } +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public (undocumented) export interface MkSearchIndexDoc { // (undocumented) @@ -98,4 +103,5 @@ export type TechDocsCollatorFactoryOptions = { // src/collators/TechDocsCollatorDocumentTransformer.d.ts:10:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorDocumentTransformer". // src/collators/TechDocsCollatorEntityTransformer.d.ts:4:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorEntityTransformer". // src/collators/defaultTechDocsCollatorEntityTransformer.d.ts:3:22 - (ae-undocumented) Missing documentation for "defaultTechDocsCollatorEntityTransformer". +// src/index.d.ts:7:15 - (ae-undocumented) Missing documentation for "_feature". ``` diff --git a/plugins/search-backend-module-techdocs/src/index.ts b/plugins/search-backend-module-techdocs/src/index.ts index c28175fd61..c8f9a93c6a 100644 --- a/plugins/search-backend-module-techdocs/src/index.ts +++ b/plugins/search-backend-module-techdocs/src/index.ts @@ -14,9 +14,15 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + /** * @packageDocumentation * A module for the search backend that exports TechDocs modules. */ export * from './collators'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/search-backend/report.api.md b/plugins/search-backend/report.api.md index 42714f5070..e770c0276e 100644 --- a/plugins/search-backend/report.api.md +++ b/plugins/search-backend/report.api.md @@ -4,6 +4,7 @@ ```ts import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import { DocumentTypeInfo } from '@backstage/plugin-search-common'; @@ -17,6 +18,10 @@ import { SearchEngine } from '@backstage/plugin-search-backend-node'; // @public @deprecated (undocumented) export function createRouter(options: RouterOptions): Promise; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public @deprecated (undocumented) export type RouterOptions = { engine: SearchEngine; @@ -31,6 +36,7 @@ export type RouterOptions = { // Warnings were encountered during analysis: // +// src/index.d.ts:8:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/router.d.ts:11:1 - (ae-undocumented) Missing documentation for "RouterOptions". // src/service/router.d.ts:25:1 - (ae-undocumented) Missing documentation for "createRouter". ``` diff --git a/plugins/search-backend/src/index.ts b/plugins/search-backend/src/index.ts index 851efd1875..69c2b1483d 100644 --- a/plugins/search-backend/src/index.ts +++ b/plugins/search-backend/src/index.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + /** * The Backstage backend plugin that provides your backstage app with search * @@ -21,3 +23,7 @@ */ export * from './service/router'; + +/** @public */ +const _feature = feature; +export default _feature; diff --git a/plugins/techdocs-backend/report.api.md b/plugins/techdocs-backend/report.api.md index 6b84666e50..f61518b587 100644 --- a/plugins/techdocs-backend/report.api.md +++ b/plugins/techdocs-backend/report.api.md @@ -4,6 +4,7 @@ ```ts import { AuthService } from '@backstage/backend-plugin-api'; +import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { DefaultTechDocsCollatorFactory as DefaultTechDocsCollatorFactory_2 } from '@backstage/plugin-search-backend-module-techdocs'; @@ -53,6 +54,10 @@ export const DefaultTechDocsCollatorFactory: typeof DefaultTechDocsCollatorFacto // @public @deprecated (undocumented) export type DocsBuildStrategy = DocsBuildStrategy_2; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public export type OutOfTheBoxDeploymentOptions = { preparers: PreparerBuilder; @@ -115,9 +120,10 @@ export * from '@backstage/plugin-techdocs-node'; // Warnings were encountered during analysis: // -// src/index.d.ts:16:1 - (ae-undocumented) Missing documentation for "DocsBuildStrategy". -// src/index.d.ts:21:1 - (ae-undocumented) Missing documentation for "ShouldBuildParameters". -// src/index.d.ts:28:1 - (ae-undocumented) Missing documentation for "TechDocsDocument". +// src/index.d.ts:13:15 - (ae-undocumented) Missing documentation for "_feature". +// src/index.d.ts:19:1 - (ae-undocumented) Missing documentation for "DocsBuildStrategy". +// src/index.d.ts:24:1 - (ae-undocumented) Missing documentation for "ShouldBuildParameters". +// src/index.d.ts:31:1 - (ae-undocumented) Missing documentation for "TechDocsDocument". // src/search/DefaultTechDocsCollator.d.ts:32:5 - (ae-undocumented) Missing documentation for "type". // src/search/DefaultTechDocsCollator.d.ts:33:5 - (ae-undocumented) Missing documentation for "visibilityPermission". // src/search/DefaultTechDocsCollator.d.ts:35:5 - (ae-undocumented) Missing documentation for "fromConfig". diff --git a/plugins/techdocs-backend/src/index.ts b/plugins/techdocs-backend/src/index.ts index 6dc68a4d44..eb047ec4f0 100644 --- a/plugins/techdocs-backend/src/index.ts +++ b/plugins/techdocs-backend/src/index.ts @@ -25,6 +25,7 @@ import { DocsBuildStrategy as _DocsBuildStrategy, TechDocsDocument as _TechDocsDocument, } from '@backstage/plugin-techdocs-node'; +import { techdocsPlugin as feature } from './plugin'; export { createRouter } from './service'; export type { @@ -42,6 +43,10 @@ export type { TechDocsCollatorOptions, } from './search'; +/** @public */ +const _feature = feature; +export default _feature; + /** * @public * @deprecated import from `@backstage/plugin-techdocs-node` instead diff --git a/plugins/user-settings-backend/report.api.md b/plugins/user-settings-backend/report.api.md index 04aecca574..df35f0cd82 100644 --- a/plugins/user-settings-backend/report.api.md +++ b/plugins/user-settings-backend/report.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; import { DatabaseService } from '@backstage/backend-plugin-api'; import express from 'express'; import { IdentityApi } from '@backstage/plugin-auth-node'; @@ -11,6 +12,10 @@ import { SignalsService } from '@backstage/plugin-signals-node'; // @public @deprecated export function createRouter(options: RouterOptions): Promise; +// @public (undocumented) +const _feature: BackendFeature; +export default _feature; + // @public @deprecated export type RouterOptions = { database: DatabaseService; @@ -18,5 +23,9 @@ export type RouterOptions = { signals?: SignalsService; }; +// Warnings were encountered during analysis: +// +// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". + // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/user-settings-backend/src/index.ts b/plugins/user-settings-backend/src/index.ts index 395a8570bf..3728c573ed 100644 --- a/plugins/user-settings-backend/src/index.ts +++ b/plugins/user-settings-backend/src/index.ts @@ -14,5 +14,11 @@ * limitations under the License. */ +import { default as feature } from './alpha'; + +/** @public */ +const _feature = feature; +export default _feature; + export * from './deprecated'; export * from './database'; From bc7171883452a8ee6febe629de1f3216b9afe108 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 11 Oct 2024 16:35:36 +0200 Subject: [PATCH 104/268] update docs to remove /alpha Signed-off-by: Patrik Oldsberg --- .changeset/lemon-pumpkins-lick.md | 11 +++ .../architecture/02-backends.md | 2 +- .../architecture/07-feature-loaders.md | 24 +++--- .../building-backends/01-index.md | 12 +-- .../building-backends/08-migrating.md | 78 +++++++++---------- docs/deployment/docker.md | 2 +- docs/features/kubernetes/installation.md | 4 +- docs/features/search/collators.md | 8 +- docs/features/search/getting-started.md | 8 +- docs/features/search/search-engines.md | 12 ++- .../software-catalog/configuration.md | 2 +- .../software-catalog/external-integrations.md | 6 +- ...authorizing-scaffolder-template-details.md | 2 +- .../software-templates/builtin-actions.md | 6 +- .../writing-custom-actions.md | 2 +- .../software-templates/writing-templates.md | 2 +- docs/features/techdocs/getting-started.md | 2 +- docs/features/techdocs/how-to-guides.md | 2 +- docs/integrations/aws-s3/discovery.md | 4 +- docs/integrations/azure/discovery.md | 4 +- docs/integrations/azure/org.md | 4 +- docs/integrations/bitbucketCloud/discovery.md | 12 +-- .../integrations/bitbucketServer/discovery.md | 4 +- docs/integrations/gerrit/discovery.md | 4 +- docs/integrations/github/discovery.md | 4 +- docs/integrations/github/org.md | 4 +- docs/integrations/gitlab/discovery.md | 6 +- docs/integrations/gitlab/org.md | 4 +- docs/integrations/ldap/org.md | 2 +- docs/permissions/custom-rules.md | 2 +- docs/permissions/getting-started.md | 4 +- docs/permissions/plugin-authors/01-setup.md | 2 +- .../integrating-search-into-plugins.md | 2 +- docs/plugins/proxying.md | 4 +- plugins/app-backend/README.md | 2 +- plugins/catalog-backend/README.md | 2 +- .../events-backend-module-aws-sqs/README.md | 2 +- plugins/events-backend-module-azure/README.md | 2 +- .../README.md | 4 +- .../events-backend-module-gerrit/README.md | 2 +- plugins/events-backend/README.md | 2 +- .../README.md | 2 +- .../README.md | 2 +- .../README.md | 2 +- .../scaffolder-backend-module-rails/README.md | 2 +- .../README.md | 2 +- .../README.md | 2 +- plugins/scaffolder-backend/README.md | 2 +- .../README.md | 2 +- plugins/user-settings-backend/README.md | 2 +- 50 files changed, 142 insertions(+), 143 deletions(-) create mode 100644 .changeset/lemon-pumpkins-lick.md diff --git a/.changeset/lemon-pumpkins-lick.md b/.changeset/lemon-pumpkins-lick.md new file mode 100644 index 0000000000..361c5769e3 --- /dev/null +++ b/.changeset/lemon-pumpkins-lick.md @@ -0,0 +1,11 @@ +--- +'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch +'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch +'@backstage/plugin-scaffolder-backend-module-gitlab': patch +'@backstage/plugin-scaffolder-backend-module-rails': patch +'@backstage/plugin-scaffolder-backend-module-sentry': patch +'@backstage/plugin-scaffolder-backend-module-yeoman': patch +'@backstage/plugin-search-backend-module-stack-overflow-collator': patch +--- + +Updated installation instructions in README to not include `/alpha`. diff --git a/docs/backend-system/architecture/02-backends.md b/docs/backend-system/architecture/02-backends.md index 4afdeea560..1310453a3f 100644 --- a/docs/backend-system/architecture/02-backends.md +++ b/docs/backend-system/architecture/02-backends.md @@ -21,7 +21,7 @@ import scaffolderPlugin from '@backstage/plugin-scaffolder-backend'; const backend = createBackend(); // Install desired features -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); // Features can also be installed using an explicit reference backend.add(scaffolderPlugin); diff --git a/docs/backend-system/architecture/07-feature-loaders.md b/docs/backend-system/architecture/07-feature-loaders.md index cf52a1feb3..43954ec443 100644 --- a/docs/backend-system/architecture/07-feature-loaders.md +++ b/docs/backend-system/architecture/07-feature-loaders.md @@ -24,10 +24,10 @@ A feature loader can simply return a list of features to be installed: export default createBackendFeatureLoader({ loader() { return [ - import('@backstage/plugin-search-backend/alpha'), - import('@backstage/plugin-search-backend-module-catalog/alpha'), - import('@backstage/plugin-search-backend-module-explore/alpha'), - import('@backstage/plugin-search-backend-module-techdocs/alpha'), + import('@backstage/plugin-search-backend'), + import('@backstage/plugin-search-backend-module-catalog'), + import('@backstage/plugin-search-backend-module-explore'), + import('@backstage/plugin-search-backend-module-techdocs'), ]; }, }); @@ -64,10 +64,10 @@ export default createBackendFeatureLoader({ *loader({ config }) { // Example of a custom config flag to enable search if (config.getOptionalString('customFeatureToggle.search')) { - yield import('@backstage/plugin-search-backend/alpha'); - yield import('@backstage/plugin-search-backend-module-catalog/alpha'); - yield import('@backstage/plugin-search-backend-module-explore/alpha'); - yield import('@backstage/plugin-search-backend-module-techdocs/alpha'); + yield import('@backstage/plugin-search-backend'); + yield import('@backstage/plugin-search-backend-module-catalog'); + yield import('@backstage/plugin-search-backend-module-explore'); + yield import('@backstage/plugin-search-backend-module-techdocs'); } }, }); @@ -84,16 +84,16 @@ export default createBackendFeatureLoader({ const localMetadata = await readMetadataFromDisk(); if (localMetadata.enableSearch) { - yield import('@backstage/plugin-search-backend/alpha'); - yield import('@backstage/plugin-search-backend-module-catalog/alpha'); + yield import('@backstage/plugin-search-backend'); + yield import('@backstage/plugin-search-backend-module-catalog'); const remoteMetadata = await fetchMetadata(); if (remoteMetadata.enableExplore) { - yield import('@backstage/plugin-search-backend-module-explore/alpha'); + yield import('@backstage/plugin-search-backend-module-explore'); } if (remoteMetadata.enableTechDocs) { - yield import('@backstage/plugin-search-backend-module-techdocs/alpha'); + yield import('@backstage/plugin-search-backend-module-techdocs'); } } }, diff --git a/docs/backend-system/building-backends/01-index.md b/docs/backend-system/building-backends/01-index.md index 2fb89e45af..ec95e57973 100644 --- a/docs/backend-system/building-backends/01-index.md +++ b/docs/backend-system/building-backends/01-index.md @@ -26,9 +26,9 @@ import { createBackend } from '@backstage/backend-defaults'; // Omitted in the e const backend = createBackend(); -backend.add(import('@backstage/plugin-app-backend/alpha')); -backend.add(import('@backstage/plugin-catalog-backend/alpha')); -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-app-backend')); +backend.add(import('@backstage/plugin-catalog-backend')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.add( import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'), ); @@ -126,8 +126,8 @@ You can now trim down the `src/index.ts` files to only include the plugins and m ```ts const backend = createBackend(); -backend.add(import('@backstage/plugin-app-backend/alpha')); -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-app-backend')); +backend.add(import('@backstage/plugin-catalog-backend')); backend.add( import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'), ); @@ -139,7 +139,7 @@ And `backend-b`, don't forget to clean up dependencies in `package.json` as well ```ts const backend = createBackend(); -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.start(); ``` diff --git a/docs/backend-system/building-backends/08-migrating.md b/docs/backend-system/building-backends/08-migrating.md index 2bc111b316..71cccab784 100644 --- a/docs/backend-system/building-backends/08-migrating.md +++ b/docs/backend-system/building-backends/08-migrating.md @@ -237,7 +237,7 @@ be used in its new form. ```ts title="packages/backend/src/index.ts" const backend = createBackend(); /* highlight-add-next-line */ -backend.add(import('@backstage/plugin-app-backend/alpha')); +backend.add(import('@backstage/plugin-app-backend')); ``` If you need to override the app package name, which otherwise defaults to `"app"`, @@ -252,7 +252,7 @@ A basic installation of the catalog plugin looks as follows. ```ts title="packages/backend/src/index.ts" const backend = createBackend(); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); backend.add( import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'), ); @@ -277,9 +277,9 @@ For `AwsS3DiscoveryProcessor`, first migrate to `AwsS3EntityProvider`. To migrate `AwsS3EntityProvider` to the new backend system, add a reference to the `@backstage/plugin-catalog-backend-module-aws` module. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-aws/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-aws')); /* highlight-add-end */ ``` @@ -306,9 +306,9 @@ For `AzureDevOpsDiscoveryProcessor`, first migrate to `AzureDevOpsEntityProvider To migrate `AzureDevOpsEntityProvider` to the new backend system, add a reference to the `@backstage/plugin-catalog-backend-module-azure` module. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-azure/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-azure')); /* highlight-add-end */ ``` @@ -340,11 +340,9 @@ For `BitbucketDiscoveryProcessor`, migrate to `BitbucketCloudEntityProvider` or To migrate `BitbucketCloudEntityProvider` to the new backend system, add a reference to the `@backstage/plugin-catalog-backend-module-bitbucket-cloud` module. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add( - import('@backstage/plugin-catalog-backend-module-bitbucket-cloud/alpha'), -); +backend.add(import('@backstage/plugin-catalog-backend-module-bitbucket-cloud')); /* highlight-add-end */ ``` @@ -367,10 +365,10 @@ catalog: To migrate `BitbucketServerEntityProvider` to the new backend system, add a reference to `@backstage/plugin-catalog-backend-module-bitbucket-server`. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ backend.add( - import('@backstage/plugin-catalog-backend-module-bitbucket-server/alpha'), + import('@backstage/plugin-catalog-backend-module-bitbucket-server'), ); /* highlight-add-end */ ``` @@ -396,7 +394,7 @@ catalog: To migrate `GkeEntityProvider` to the new backend system, add a reference to `@backstage/plugin-catalog-backend-module-gcp`. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ backend.add(import('@backstage/plugin-catalog-backend-module-gcp')); /* highlight-add-end */ @@ -409,9 +407,9 @@ Configuration in app-config.yaml remains the same. To migrate `GerritEntityProvider` to the new backend system, add a reference to `@backstage/plugin-catalog-backend-module-gerrit`. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-gerrit/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-gerrit')); /* highlight-add-end */ ``` @@ -438,9 +436,9 @@ For `GithubDiscoveryProcessor`, `GithubMultiOrgReaderProcessor` and `GithubOrgRe To migrate `GithubEntityProvider` to the new backend system, add a reference to `@backstage/plugin-catalog-backend-module-github`. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-github/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-github')); /* highlight-add-end */ ``` @@ -463,7 +461,7 @@ catalog: To migrate `GithubMultiOrgEntityProvider` or `GithubOrgEntityProvider` to the new backend system, add a reference to `@backstage/plugin-catalog-backend-module-github-org`. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ backend.add(import('@backstage/plugin-catalog-backend-module-github-org')); /* highlight-add-end */ @@ -581,9 +579,9 @@ For `MicrosoftGraphOrgReaderProcessor`, first migrate to `MicrosoftGraphOrgEntit To migrate `MicrosoftGraphOrgEntityProvider` to the new backend system, add a reference to `@backstage/plugin-catalog-backend-module-msgraph`. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-msgraph/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-msgraph')); /* highlight-add-end */ ``` @@ -670,7 +668,7 @@ const catalogModuleCustomExtensions = createBackendModule({ /* highlight-add-end */ const backend = createBackend(); -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); backend.add( import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'), ); @@ -699,7 +697,7 @@ A basic installation of the events plugin looks as follows. ```ts title="packages/backend/src/index.ts" const backend = createBackend(); /* highlight-add-next-line */ -backend.add(import('@backstage/plugin-events-backend/alpha')); +backend.add(import('@backstage/plugin-events-backend')); ``` If you have other customizations made to `plugins/events.ts`, such as adding @@ -760,7 +758,7 @@ const otherPluginModuleCustomExtensions = createBackendModule({ /* highlight-add-end */ const backend = createBackend(); -backend.add(import('@backstage/plugin-events-backend/alpha')); +backend.add(import('@backstage/plugin-events-backend')); /* highlight-add-next-line */ backend.add(eventsModuleCustomExtensions); /* highlight-add-next-line */ @@ -780,7 +778,7 @@ A basic installation of the scaffolder plugin looks as follows. ```ts title="packages/backend/src/index.ts" const backend = createBackend(); /* highlight-add-next-line */ -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); ``` With the new Backend System version of the Scaffolder plugin, any provider specific actions will need to be installed separately. @@ -788,7 +786,7 @@ For example - GitHub actions are now collected under the `@backstage/plugin-scaf ```ts title="packages/backend/src/index.ts" const backend = createBackend(); -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); /* highlight-add-next-line */ backend.add(import('@backstage/plugin-scaffolder-backend-module-github')); @@ -839,7 +837,7 @@ const scaffolderModuleCustomExtensions = createBackendModule({ /* highlight-add-end */ const backend = createBackend(); -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); /* highlight-add-next-line */ backend.add(scaffolderModuleCustomExtensions); ``` @@ -1143,7 +1141,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); /* highlight-add-end */ ``` @@ -1167,8 +1165,8 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend/alpha')); -backend.add(import('@backstage/plugin-search-backend-module-pg/alpha')); +backend.add(import('@backstage/plugin-search-backend')); +backend.add(import('@backstage/plugin-search-backend-module-pg')); /* highlight-add-end */ ``` @@ -1182,10 +1180,8 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend/alpha')); -backend.add( - import('@backstage/plugin-search-backend-module-elasticsearch/alpha'), -); +backend.add(import('@backstage/plugin-search-backend')); +backend.add(import('@backstage/plugin-search-backend-module-elasticsearch')); /* highlight-add-end */ ``` @@ -1203,8 +1199,8 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend/alpha')); -backend.add(import('@backstage/plugin-search-backend-module-catalog/alpha')); +backend.add(import('@backstage/plugin-search-backend')); +backend.add(import('@backstage/plugin-search-backend-module-catalog')); /* highlight-add-end */ ``` @@ -1218,8 +1214,8 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend/alpha')); -backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha')); +backend.add(import('@backstage/plugin-search-backend')); +backend.add(import('@backstage/plugin-search-backend-module-techdocs')); /* highlight-add-end */ ``` @@ -1233,7 +1229,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-permission-backend/alpha')); +backend.add(import('@backstage/plugin-permission-backend')); backend.add( import('@backstage/plugin-permission-backend-module-allow-all-policy'), ); @@ -1294,7 +1290,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-permission-backend/alpha')); +backend.add(import('@backstage/plugin-permission-backend')); backend.add(customPermissionBackendModule); /* highlight-add-end */ ``` @@ -1309,7 +1305,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-techdocs-backend/alpha')); +backend.add(import('@backstage/plugin-techdocs-backend')); /* highlight-add-end */ ``` @@ -1323,7 +1319,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-kubernetes-backend/alpha')); +backend.add(import('@backstage/plugin-kubernetes-backend')); /* highlight-add-end */ ``` diff --git a/docs/deployment/docker.md b/docs/deployment/docker.md index 1017684595..7a17f09ad6 100644 --- a/docs/deployment/docker.md +++ b/docs/deployment/docker.md @@ -349,7 +349,7 @@ package, which is done as follows: 2. Remove the following line from `packages/backend/src/index.ts`: ```ts - backend.add(import('@backstage/plugin-app-backend/alpha')); + backend.add(import('@backstage/plugin-app-backend')); ``` 3. Remove the `@backstage/plugin-app-backend` and the app package dependency diff --git a/docs/features/kubernetes/installation.md b/docs/features/kubernetes/installation.md index bd6a15a542..aca4c19ac1 100644 --- a/docs/features/kubernetes/installation.md +++ b/docs/features/kubernetes/installation.md @@ -120,7 +120,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-kubernetes-backend/alpha')); +backend.add(import('@backstage/plugin-kubernetes-backend')); /* highlight-add-end */ backend.start(); @@ -228,7 +228,7 @@ export const kubernetesModuleCustomClusterDiscovery = createBackendModule({ }); // Other plugins... -backend.add(import('@backstage/plugin-kubernetes-backend/alpha')); +backend.add(import('@backstage/plugin-kubernetes-backend')); backend.add(kubernetesModuleCustomClusterDiscovery); backend.start(); diff --git a/docs/features/search/collators.md b/docs/features/search/collators.md index 27860bfd64..0282bc845e 100644 --- a/docs/features/search/collators.md +++ b/docs/features/search/collators.md @@ -24,10 +24,10 @@ const backend = createBackend(); // Other plugins... // search plugin -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend-module-catalog/alpha')); +backend.add(import('@backstage/plugin-search-backend-module-catalog')); /* highlight-add-end */ backend.start(); @@ -68,10 +68,10 @@ const backend = createBackend(); // Other plugins... // search plugin -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha')); +backend.add(import('@backstage/plugin-search-backend-module-techdocs')); /* highlight-add-end */ backend.start(); diff --git a/docs/features/search/getting-started.md b/docs/features/search/getting-started.md index 362b7fc46d..a4b5348dbb 100644 --- a/docs/features/search/getting-started.md +++ b/docs/features/search/getting-started.md @@ -145,14 +145,14 @@ const backend = createBackend(); /* highlight-add-start */ // search plugin -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); // search engines -backend.add(import('@backstage/plugin-search-backend-module-pg/alpha')); +backend.add(import('@backstage/plugin-search-backend-module-pg')); // search collators -backend.add(import('@backstage/plugin-search-backend-module-catalog/alpha')); -backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha')); +backend.add(import('@backstage/plugin-search-backend-module-catalog')); +backend.add(import('@backstage/plugin-search-backend-module-techdocs')); /* highlight-add-end */ backend.start(); diff --git a/docs/features/search/search-engines.md b/docs/features/search/search-engines.md index f768a9bde8..8209ae951d 100644 --- a/docs/features/search/search-engines.md +++ b/docs/features/search/search-engines.md @@ -25,7 +25,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); /* highlight-add-end */ backend.start(); @@ -65,10 +65,10 @@ const backend = createBackend(); // Other plugins... // search plugin -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-search-backend-module-pg/alpha')); +backend.add(import('@backstage/plugin-search-backend-module-pg')); /* highlight-add-end */ backend.start(); @@ -124,12 +124,10 @@ const backend = createBackend(); // Other plugins... // search plugin -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); /* highlight-add-start */ -backend.add( - import('@backstage/plugin-search-backend-module-elasticsearch/alpha'), -); +backend.add(import('@backstage/plugin-search-backend-module-elasticsearch')); /* highlight-add-end */ backend.start(); diff --git a/docs/features/software-catalog/configuration.md b/docs/features/software-catalog/configuration.md index dff09a9397..78643420df 100644 --- a/docs/features/software-catalog/configuration.md +++ b/docs/features/software-catalog/configuration.md @@ -205,7 +205,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend Now you can install the events backend plugin in your backend. ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-events-backend/alpha')); +backend.add(import('@backstage/plugin-events-backend')); ``` ### Logging Errors diff --git a/docs/features/software-catalog/external-integrations.md b/docs/features/software-catalog/external-integrations.md index ff6853e1e7..f721c50ec2 100644 --- a/docs/features/software-catalog/external-integrations.md +++ b/docs/features/software-catalog/external-integrations.md @@ -326,7 +326,7 @@ export const catalogModuleFrobsProvider = createBackendModule({ const backend = createBackend(); -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); backend.add(catalogModuleFrobsProvider); // Other plugins ... @@ -764,7 +764,7 @@ export const catalogModuleSystemXReaderProcessor = createBackendModule({ const backend = createBackend(); -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); backend.add(catalogModuleSystemXReaderProcessor); // Other plugins ... @@ -1025,7 +1025,7 @@ export const catalogModuleCustomDataParser = createBackendModule({ const backend = createBackend(); -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); backend.add(catalogModuleCustomDataParser); // Other plugins ... diff --git a/docs/features/software-templates/authorizing-scaffolder-template-details.md b/docs/features/software-templates/authorizing-scaffolder-template-details.md index 942431c993..d4798b2540 100644 --- a/docs/features/software-templates/authorizing-scaffolder-template-details.md +++ b/docs/features/software-templates/authorizing-scaffolder-template-details.md @@ -281,7 +281,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-permission-backend/alpha')); +backend.add(import('@backstage/plugin-permission-backend')); backend.add(customPermissionBackendModule); /* highlight-add-end */ ``` diff --git a/docs/features/software-templates/builtin-actions.md b/docs/features/software-templates/builtin-actions.md index 5bfc038c1d..bf6875764e 100644 --- a/docs/features/software-templates/builtin-actions.md +++ b/docs/features/software-templates/builtin-actions.md @@ -35,16 +35,16 @@ import { createBackend } from '@backstage/backend-defaults'; const backend = createBackend(); -backend.add(import('@backstage/plugin-app-backend/alpha')); +backend.add(import('@backstage/plugin-app-backend')); // catalog plugin -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); backend.add( import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'), ); // scaffolder plugin -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); /* highlight-add-next-line */ backend.add(import('@backstage/plugin-scaffolder-backend-module-github')); diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index e5a82c09a9..00a171523c 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -195,7 +195,7 @@ const scaffolderModuleCustomExtensions = createBackendModule({ /* highlight-add-end */ const backend = createBackend(); -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); /* highlight-add-next-line */ backend.add(scaffolderModuleCustomExtensions); ``` diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 71ca0c56ae..6899bcb746 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -889,7 +889,7 @@ const scaffolderModuleCustomFilters = createBackendModule({ /* highlight-add-end */ const backend = createBackend(); -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); /* highlight-add-next-line */ backend.add(scaffolderModuleCustomFilters); ``` diff --git a/docs/features/techdocs/getting-started.md b/docs/features/techdocs/getting-started.md index a157d29c0d..66772c861d 100644 --- a/docs/features/techdocs/getting-started.md +++ b/docs/features/techdocs/getting-started.md @@ -209,7 +209,7 @@ const backend = createBackend(); // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-techdocs-backend/alpha')); +backend.add(import('@backstage/plugin-techdocs-backend')); /* highlight-add-end */ backend.start(); diff --git a/docs/features/techdocs/how-to-guides.md b/docs/features/techdocs/how-to-guides.md index 7712d675f5..fd4d208b74 100644 --- a/docs/features/techdocs/how-to-guides.md +++ b/docs/features/techdocs/how-to-guides.md @@ -799,7 +799,7 @@ const techdocsCustomBuildStrategy = createBackendModule({ // Other plugins... /* highlight-add-start */ -backend.add(import('@backstage/plugin-techdocs-backend/alpha')); +backend.add(import('@backstage/plugin-techdocs-backend')); backend.add(techdocsCustomBuildStrategy); /* highlight-add-end */ diff --git a/docs/integrations/aws-s3/discovery.md b/docs/integrations/aws-s3/discovery.md index 4cca448cf2..f4d18015a2 100644 --- a/docs/integrations/aws-s3/discovery.md +++ b/docs/integrations/aws-s3/discovery.md @@ -73,8 +73,8 @@ yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-aws Then update your backend by adding the following line: ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-aws/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-aws')); /* highlight-add-end */ ``` diff --git a/docs/integrations/azure/discovery.md b/docs/integrations/azure/discovery.md index 357df7d553..e64bf42636 100644 --- a/docs/integrations/azure/discovery.md +++ b/docs/integrations/azure/discovery.md @@ -109,8 +109,8 @@ yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-azure Then updated your backend by adding the following line: ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-azure/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-azure')); /* highlight-add-end */ ``` diff --git a/docs/integrations/azure/org.md b/docs/integrations/azure/org.md index 1868188cdf..e6fb69a520 100644 --- a/docs/integrations/azure/org.md +++ b/docs/integrations/azure/org.md @@ -49,9 +49,9 @@ For large organizations, this plugin can take a long time, so be careful setting Finally, updated your backend by adding the following line: ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-msgraph/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-msgraph')); /* highlight-add-end */ ``` diff --git a/docs/integrations/bitbucketCloud/discovery.md b/docs/integrations/bitbucketCloud/discovery.md index 102feb46d7..b000a45ccd 100644 --- a/docs/integrations/bitbucketCloud/discovery.md +++ b/docs/integrations/bitbucketCloud/discovery.md @@ -27,15 +27,11 @@ yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-bitbuck ```ts // optional if you want HTTP endpoints to receive external events -// backend.add(import('@backstage/plugin-events-backend/alpha')); +// backend.add(import('@backstage/plugin-events-backend')); // optional if you want to use AWS SQS instead of HTTP endpoints to receive external events -// backend.add(import('@backstage/plugin-events-backend-module-aws-sqs/alpha')); -backend.add( - import('@backstage/plugin-events-backend-module-bitbucket-cloud/alpha'), -); -backend.add( - import('@backstage/plugin-catalog-backend-module-bitbucket-cloud/alpha'), -); +// backend.add(import('@backstage/plugin-events-backend-module-aws-sqs')); +backend.add(import('@backstage/plugin-events-backend-module-bitbucket-cloud')); +backend.add(import('@backstage/plugin-catalog-backend-module-bitbucket-cloud')); ``` You need to decide how you want to receive events from external sources like diff --git a/docs/integrations/bitbucketServer/discovery.md b/docs/integrations/bitbucketServer/discovery.md index 3bc37e4cb5..9ba6c7a96d 100644 --- a/docs/integrations/bitbucketServer/discovery.md +++ b/docs/integrations/bitbucketServer/discovery.md @@ -29,10 +29,10 @@ yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-bitbuck And update your backend by adding the following line: ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ backend.add( - import('@backstage/plugin-catalog-backend-module-bitbucket-server/alpha'), + import('@backstage/plugin-catalog-backend-module-bitbucket-server'), ); /* highlight-add-end */ ``` diff --git a/docs/integrations/gerrit/discovery.md b/docs/integrations/gerrit/discovery.md index eca0417871..4ae1eb2344 100644 --- a/docs/integrations/gerrit/discovery.md +++ b/docs/integrations/gerrit/discovery.md @@ -27,9 +27,9 @@ yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-gerrit Then update your backend by adding the following line: ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-gerrit/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-gerrit')); /* highlight-add-end */ ``` diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index b2e998813d..4da7287383 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -31,9 +31,9 @@ yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-github And then update your backend by adding the following line: ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ -backend.add(import('@backstage/plugin-catalog-backend-module-github/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-github')); ``` ## Events Support diff --git a/docs/integrations/github/org.md b/docs/integrations/github/org.md index 22b55fee98..7f0ee1a71f 100644 --- a/docs/integrations/github/org.md +++ b/docs/integrations/github/org.md @@ -60,7 +60,7 @@ catalog: Finally, update your backend by adding the following line: ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ backend.add(import('@backstage/plugin-catalog-backend-module-github-org')); ``` @@ -167,7 +167,7 @@ const backend = createBackend(); // Other items -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); backend.add(githubOrgModule); diff --git a/docs/integrations/gitlab/discovery.md b/docs/integrations/gitlab/discovery.md index 10746aff88..eab590ff11 100644 --- a/docs/integrations/gitlab/discovery.md +++ b/docs/integrations/gitlab/discovery.md @@ -30,14 +30,14 @@ Then add the following to your backend initialization: ```ts title="packages/backend/src/index.ts // optional if you want HTTP endpoints to receive external events -// backend.add(import('@backstage/plugin-events-backend/alpha')); +// backend.add(import('@backstage/plugin-events-backend')); // optional if you want to use AWS SQS instead of HTTP endpoints to receive external events -// backend.add(import('@backstage/plugin-events-backend-module-aws-sqs/alpha')); +// backend.add(import('@backstage/plugin-events-backend-module-aws-sqs')); // optional - event router for gitlab. See.: https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-gitlab/README.md // backend.add(eventsModuleGitlabEventRouter); // optional - token validator for the gitlab topic // backend.add(eventsModuleGitlabWebhook); -backend.add(import('@backstage/plugin-catalog-backend-module-gitlab/alpha')); +backend.add(import('@backstage/plugin-catalog-backend-module-gitlab')); ``` You need to decide how you want to receive events from external sources like diff --git a/docs/integrations/gitlab/org.md b/docs/integrations/gitlab/org.md index c13db4401b..66ce117aa0 100644 --- a/docs/integrations/gitlab/org.md +++ b/docs/integrations/gitlab/org.md @@ -35,9 +35,9 @@ Then add the following to your backend initialization: ```ts title="packages/backend/src/index.ts // optional if you want HTTP endpoints to receive external events -// backend.add(import('@backstage/plugin-events-backend/alpha')); +// backend.add(import('@backstage/plugin-events-backend')); // optional if you want to use AWS SQS instead of HTTP endpoints to receive external events -// backend.add(import('@backstage/plugin-events-backend-module-aws-sqs/alpha')); +// backend.add(import('@backstage/plugin-events-backend-module-aws-sqs')); // optional - event router for gitlab. See.: https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-gitlab/README.md // backend.add(eventsModuleGitlabEventRouter); // optional - token validator for the gitlab topic diff --git a/docs/integrations/ldap/org.md b/docs/integrations/ldap/org.md index b1aa460bd6..50cf74ffb6 100644 --- a/docs/integrations/ldap/org.md +++ b/docs/integrations/ldap/org.md @@ -44,7 +44,7 @@ catalog: Finally, updated your backend by adding the following line: ```ts title="packages/backend/src/index.ts" -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); /* highlight-add-start */ backend.add(import('@backstage/plugin-catalog-backend-module-ldap')); /* highlight-add-end */ diff --git a/docs/permissions/custom-rules.md b/docs/permissions/custom-rules.md index 9642f80215..00f4d81939 100644 --- a/docs/permissions/custom-rules.md +++ b/docs/permissions/custom-rules.md @@ -173,7 +173,7 @@ The api for providing custom rules may differ between plugins, but there should ```ts title="packages/backend/src/index.ts" // catalog plugin - backend.add(import('@backstage/plugin-catalog-backend/alpha')); + backend.add(import('@backstage/plugin-catalog-backend')); backend.add( import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'), ); diff --git a/docs/permissions/getting-started.md b/docs/permissions/getting-started.md index 118282bbd4..14058bccb0 100644 --- a/docs/permissions/getting-started.md +++ b/docs/permissions/getting-started.md @@ -34,7 +34,7 @@ To help validate the permission framework is setup we'll create a Test Permissio ```ts title="packages/backend/src/index.ts" // permission plugin - backend.add(import('@backstage/plugin-permission-backend/alpha')); + backend.add(import('@backstage/plugin-permission-backend')); /* highlight-remove-start */ backend.add( import('@backstage/plugin-permission-backend-module-allow-all-policy'), @@ -85,7 +85,7 @@ To help validate the permission framework is setup we'll create a Test Permissio ```ts title="packages/backend/src/index.ts" // permission plugin - backend.add(import('@backstage/plugin-permission-backend/alpha')); + backend.add(import('@backstage/plugin-permission-backend')); /* highlight-add-next-line */ backend.add(import('./extensions/permissionsPolicyExtension')); ``` diff --git a/docs/permissions/plugin-authors/01-setup.md b/docs/permissions/plugin-authors/01-setup.md index f3c361e8b5..79740a7659 100644 --- a/docs/permissions/plugin-authors/01-setup.md +++ b/docs/permissions/plugin-authors/01-setup.md @@ -59,7 +59,7 @@ The source code is available here: //... /* highlight-add-start */ // Installing the permission plugin - backend.add(import('@backstage/plugin-permission-backend/alpha')); + backend.add(import('@backstage/plugin-permission-backend')); // Installing the allow all permission policy module backend.add( import('@backstage/plugin-permission-backend-module-allow-all-policy'), diff --git a/docs/plugins/integrating-search-into-plugins.md b/docs/plugins/integrating-search-into-plugins.md index 62b3942537..05d07feb08 100644 --- a/docs/plugins/integrating-search-into-plugins.md +++ b/docs/plugins/integrating-search-into-plugins.md @@ -227,7 +227,7 @@ import { createBackend } from '@backstage/backend-defaults'; //... const backend = createBackend(); // Installing the search backend plugin -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); // Installing the newly created faq snippets collator module backend.add( import( diff --git a/docs/plugins/proxying.md b/docs/plugins/proxying.md index 0b64c6eb37..09afa3f519 100644 --- a/docs/plugins/proxying.md +++ b/docs/plugins/proxying.md @@ -20,7 +20,7 @@ The plugin is already added to a default Backstage project. To add it to a project, add the following line in `packages/backend/src/index.ts`: ```ts -backend.add(import('@backstage/plugin-proxy-backend/alpha')); +backend.add(import('@backstage/plugin-proxy-backend')); ``` ### Old Backend @@ -28,7 +28,7 @@ backend.add(import('@backstage/plugin-proxy-backend/alpha')); In `packages/backend/src/index.ts`: ```ts -backend.add(import('@backstage/plugin-proxy-backend/alpha')); +backend.add(import('@backstage/plugin-proxy-backend')); ``` ## Configuration diff --git a/plugins/app-backend/README.md b/plugins/app-backend/README.md index 4e95b90566..64dc6fc2ba 100644 --- a/plugins/app-backend/README.md +++ b/plugins/app-backend/README.md @@ -21,7 +21,7 @@ Now add the plugin to your app, creating it for example like this: import { createBackend } from '@backstage/backend-defaults'; const backend = createBackend(); -backend.add(import('@backstage/plugin-app-backend/alpha')); +backend.add(import('@backstage/plugin-app-backend')); backend.start(); ``` diff --git a/plugins/catalog-backend/README.md b/plugins/catalog-backend/README.md index b0bd0328ab..3d42d90252 100644 --- a/plugins/catalog-backend/README.md +++ b/plugins/catalog-backend/README.md @@ -33,7 +33,7 @@ Then add the plugin to your backend, typically in `packages/backend/src/index.ts ```ts const backend = createBackend(); // ... -backend.add(import('@backstage/plugin-catalog-backend/alpha')); +backend.add(import('@backstage/plugin-catalog-backend')); ``` #### Old backend system diff --git a/plugins/events-backend-module-aws-sqs/README.md b/plugins/events-backend-module-aws-sqs/README.md index bd8e0c51d3..d08da3991d 100644 --- a/plugins/events-backend-module-aws-sqs/README.md +++ b/plugins/events-backend-module-aws-sqs/README.md @@ -42,7 +42,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend-module-aws-sqs ```ts // packages/backend/src/index.ts -backend.add(import('@backstage/plugin-events-backend-module-aws-sqs/alpha')); +backend.add(import('@backstage/plugin-events-backend-module-aws-sqs')); ``` ### Legacy Backend System diff --git a/plugins/events-backend-module-azure/README.md b/plugins/events-backend-module-azure/README.md index 7c3920d499..d294635b44 100644 --- a/plugins/events-backend-module-azure/README.md +++ b/plugins/events-backend-module-azure/README.md @@ -29,7 +29,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend-module-azure ```ts // packages/backend/src/index.ts -backend.add(import('@backstage/plugin-events-backend-module-azure/alpha')); +backend.add(import('@backstage/plugin-events-backend-module-azure')); ``` ### Legacy Backend System diff --git a/plugins/events-backend-module-bitbucket-cloud/README.md b/plugins/events-backend-module-bitbucket-cloud/README.md index 7ff743c06d..7f5630de8e 100644 --- a/plugins/events-backend-module-bitbucket-cloud/README.md +++ b/plugins/events-backend-module-bitbucket-cloud/README.md @@ -29,9 +29,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend-module-bitbucke ```ts // packages/backend/src/index.ts -backend.add( - import('@backstage/plugin-events-backend-module-bitbucket-cloud/alpha'), -); +backend.add(import('@backstage/plugin-events-backend-module-bitbucket-cloud')); ``` ### Legacy Backend System diff --git a/plugins/events-backend-module-gerrit/README.md b/plugins/events-backend-module-gerrit/README.md index d5b9f9683a..b45d12dbd7 100644 --- a/plugins/events-backend-module-gerrit/README.md +++ b/plugins/events-backend-module-gerrit/README.md @@ -28,7 +28,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend-module-gerrit ```ts // packages/backend/src/index.ts -backend.add(import('@backstage/plugin-events-backend-module-gerrit/alpha')); +backend.add(import('@backstage/plugin-events-backend-module-gerrit')); ``` ### Legacy Backend System diff --git a/plugins/events-backend/README.md b/plugins/events-backend/README.md index 2dba259986..7f88452ff6 100644 --- a/plugins/events-backend/README.md +++ b/plugins/events-backend/README.md @@ -23,7 +23,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend ```ts // packages/backend/src/index.ts -backend.add(import('@backstage/plugin-events-backend/alpha')); +backend.add(import('@backstage/plugin-events-backend')); ``` ### Legacy Backend System diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/README.md b/plugins/scaffolder-backend-module-confluence-to-markdown/README.md index aa7b9fee79..d3722f1227 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/README.md +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/README.md @@ -21,7 +21,7 @@ Then ensure that both the scaffolder and this module are added to your backend: // In packages/backend/src/index.ts const backend = createBackend(); // ... -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.add( import('@backstage/plugin-scaffolder-backend-module-confluence-to-markdown'), ); diff --git a/plugins/scaffolder-backend-module-cookiecutter/README.md b/plugins/scaffolder-backend-module-cookiecutter/README.md index ba2cd14cb2..19c7082a50 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/README.md +++ b/plugins/scaffolder-backend-module-cookiecutter/README.md @@ -19,7 +19,7 @@ Then ensure that both the scaffolder and this module are added to your backend: // In packages/backend/src/index.ts const backend = createBackend(); // ... -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.add(import('@backstage/plugin-scaffolder-backend-module-cookiecutter')); ``` diff --git a/plugins/scaffolder-backend-module-gitlab/README.md b/plugins/scaffolder-backend-module-gitlab/README.md index 3f991bf308..4542ec4198 100644 --- a/plugins/scaffolder-backend-module-gitlab/README.md +++ b/plugins/scaffolder-backend-module-gitlab/README.md @@ -19,7 +19,7 @@ Then ensure that both the scaffolder and this module are added to your backend: // In packages/backend/src/index.ts const backend = createBackend(); // ... -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.add(import('@backstage/plugin-scaffolder-backend-module-gitlab')); ``` diff --git a/plugins/scaffolder-backend-module-rails/README.md b/plugins/scaffolder-backend-module-rails/README.md index 27db5656c5..86b49d5e13 100644 --- a/plugins/scaffolder-backend-module-rails/README.md +++ b/plugins/scaffolder-backend-module-rails/README.md @@ -24,7 +24,7 @@ Then ensure that both the scaffolder and this module are added to your backend: // In packages/backend/src/index.ts const backend = createBackend(); // ... -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.add(import('@backstage/plugin-scaffolder-backend-module-rails')); ``` diff --git a/plugins/scaffolder-backend-module-sentry/README.md b/plugins/scaffolder-backend-module-sentry/README.md index d13f923a2a..252585d584 100644 --- a/plugins/scaffolder-backend-module-sentry/README.md +++ b/plugins/scaffolder-backend-module-sentry/README.md @@ -21,7 +21,7 @@ Then ensure that both the scaffolder and this module are added to your backend: // In packages/backend/src/index.ts const backend = createBackend(); // ... -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.add(import('@backstage/plugin-scaffolder-backend-module-sentry')); ``` diff --git a/plugins/scaffolder-backend-module-yeoman/README.md b/plugins/scaffolder-backend-module-yeoman/README.md index 3a32dd2124..f78fe8ecdd 100644 --- a/plugins/scaffolder-backend-module-yeoman/README.md +++ b/plugins/scaffolder-backend-module-yeoman/README.md @@ -19,7 +19,7 @@ Then ensure that both the scaffolder and this module are added to your backend: // In packages/backend/src/index.ts const backend = createBackend(); // ... -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); backend.add(import('@backstage/plugin-scaffolder-backend-module-yeoman')); ``` diff --git a/plugins/scaffolder-backend/README.md b/plugins/scaffolder-backend/README.md index d760b0fc2d..6f51f81117 100644 --- a/plugins/scaffolder-backend/README.md +++ b/plugins/scaffolder-backend/README.md @@ -27,7 +27,7 @@ Then add the plugin to your backend, typically in `packages/backend/src/index.ts ```ts const backend = createBackend(); // ... -backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); +backend.add(import('@backstage/plugin-scaffolder-backend')); ``` #### Old backend system diff --git a/plugins/search-backend-module-stack-overflow-collator/README.md b/plugins/search-backend-module-stack-overflow-collator/README.md index e2d516ace5..e14411cd52 100644 --- a/plugins/search-backend-module-stack-overflow-collator/README.md +++ b/plugins/search-backend-module-stack-overflow-collator/README.md @@ -83,7 +83,7 @@ Add the collator to your backend instance, along with the search plugin itself: import { createBackend } from '@backstage/backend-defaults'; const backend = createBackend(); -backend.add(import('@backstage/plugin-search-backend/alpha')); +backend.add(import('@backstage/plugin-search-backend')); backend.add( import('@backstage/plugin-search-backend-module-stack-overflow-collator'), ); diff --git a/plugins/user-settings-backend/README.md b/plugins/user-settings-backend/README.md index 249edec592..34156b3bfb 100644 --- a/plugins/user-settings-backend/README.md +++ b/plugins/user-settings-backend/README.md @@ -16,7 +16,7 @@ yarn --cwd packages/backend add @backstage/plugin-user-settings-backend @backsta Add the plugin to your backend in `packages/backend/src/index.ts`: ```ts -backend.add(import('@backstage/plugin-user-settings-backend/alpha')); +backend.add(import('@backstage/plugin-user-settings-backend')); // The signals backend is technically optional but enables real-time update of user // settings across different sessions backend.add(import('@backstage/plugin-signals-backend')); From 511651b1a705d75f6745104763dbe1c6ab82bf2a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 15:17:05 +0000 Subject: [PATCH 105/268] Update dependency @opentelemetry/auto-instrumentations-node to v0.50.2 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/yarn.lock b/yarn.lock index 75503208bb..88d3c30197 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13027,8 +13027,8 @@ __metadata: linkType: hard "@opentelemetry/auto-instrumentations-node@npm:^0.50.0": - version: 0.50.1 - resolution: "@opentelemetry/auto-instrumentations-node@npm:0.50.1" + version: 0.50.2 + resolution: "@opentelemetry/auto-instrumentations-node@npm:0.50.2" dependencies: "@opentelemetry/instrumentation": ^0.53.0 "@opentelemetry/instrumentation-amqplib": ^0.42.0 @@ -13060,7 +13060,7 @@ __metadata: "@opentelemetry/instrumentation-mysql2": ^0.41.0 "@opentelemetry/instrumentation-nestjs-core": ^0.40.0 "@opentelemetry/instrumentation-net": ^0.39.0 - "@opentelemetry/instrumentation-pg": ^0.45.0 + "@opentelemetry/instrumentation-pg": ^0.45.1 "@opentelemetry/instrumentation-pino": ^0.42.0 "@opentelemetry/instrumentation-redis": ^0.42.0 "@opentelemetry/instrumentation-redis-4": ^0.42.1 @@ -13070,16 +13070,16 @@ __metadata: "@opentelemetry/instrumentation-tedious": ^0.14.0 "@opentelemetry/instrumentation-undici": ^0.6.0 "@opentelemetry/instrumentation-winston": ^0.40.0 - "@opentelemetry/resource-detector-alibaba-cloud": ^0.29.2 + "@opentelemetry/resource-detector-alibaba-cloud": ^0.29.3 "@opentelemetry/resource-detector-aws": ^1.6.2 "@opentelemetry/resource-detector-azure": ^0.2.11 - "@opentelemetry/resource-detector-container": ^0.4.2 + "@opentelemetry/resource-detector-container": ^0.4.3 "@opentelemetry/resource-detector-gcp": ^0.29.12 "@opentelemetry/resources": ^1.24.0 "@opentelemetry/sdk-node": ^0.53.0 peerDependencies: "@opentelemetry/api": ^1.4.1 - checksum: 978c1abc6c61d0544fae8db30faa32d5400013edd3d57298031491e87d4bf6ec7bfea58d8020b76c01c87eac63496d3abd22f32f25e8cc00d20e31c72d81f4ee + checksum: b90b4962b90722c458a00cf9efeeb0fff53091230ffc15043b935dc81d862d9c3125b5cc71fda836cb8283a4fb51ecffa59fbd2f0f4a3359420384d5dd68e26b languageName: node linkType: hard @@ -13103,7 +13103,7 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/core@npm:1.26.0, @opentelemetry/core@npm:^1.0.0, @opentelemetry/core@npm:^1.1.0, @opentelemetry/core@npm:^1.25.0, @opentelemetry/core@npm:^1.25.1, @opentelemetry/core@npm:^1.8.0": +"@opentelemetry/core@npm:1.26.0, @opentelemetry/core@npm:^1.0.0, @opentelemetry/core@npm:^1.1.0, @opentelemetry/core@npm:^1.25.0, @opentelemetry/core@npm:^1.25.1, @opentelemetry/core@npm:^1.26.0, @opentelemetry/core@npm:^1.8.0": version: 1.26.0 resolution: "@opentelemetry/core@npm:1.26.0" dependencies: @@ -13599,18 +13599,19 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/instrumentation-pg@npm:^0.45.0": - version: 0.45.0 - resolution: "@opentelemetry/instrumentation-pg@npm:0.45.0" +"@opentelemetry/instrumentation-pg@npm:^0.45.1": + version: 0.45.1 + resolution: "@opentelemetry/instrumentation-pg@npm:0.45.1" dependencies: + "@opentelemetry/core": ^1.26.0 "@opentelemetry/instrumentation": ^0.53.0 - "@opentelemetry/semantic-conventions": ^1.27.0 + "@opentelemetry/semantic-conventions": 1.27.0 "@opentelemetry/sql-common": ^0.40.1 "@types/pg": 8.6.1 "@types/pg-pool": 2.0.6 peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 059f79eeca92e27e1eee06ab55659a4eeee389c004ee2d8542e6bcce2147faf7c0ea568a5f305b2ee8065df575c44f6de80effb5c76adc1d3f098cdb3c2e3bdf + checksum: 29e6641ca221fe1e7c1a659ac37f07573f86abfc7f2a6afafdb528d70677522c54a35ff4fd3243a965dc4a8fc27f2c17b422fbc32789c0ee8a27e67e1f47aff0 languageName: node linkType: hard @@ -13835,15 +13836,16 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/resource-detector-alibaba-cloud@npm:^0.29.2": - version: 0.29.2 - resolution: "@opentelemetry/resource-detector-alibaba-cloud@npm:0.29.2" +"@opentelemetry/resource-detector-alibaba-cloud@npm:^0.29.3": + version: 0.29.3 + resolution: "@opentelemetry/resource-detector-alibaba-cloud@npm:0.29.3" dependencies: + "@opentelemetry/core": ^1.26.0 "@opentelemetry/resources": ^1.10.0 "@opentelemetry/semantic-conventions": ^1.27.0 peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 817a024d28c5f3c79a65377115193ccf2171626e8d79e47210baea9db75c55c0a48d8f50fd19d9bf2ece422c3ae7c75d5d64879d4941e4a15c1757a2877be77e + checksum: e3cb36aa8b4ce7b6fc60fe15f51139493728f4c8e7af11f70cb567b5667680c16147bc382aa1a330b8bca26b392e7dddd5f66b6c393ca50aa315329baa0bea14 languageName: node linkType: hard @@ -13873,15 +13875,16 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/resource-detector-container@npm:^0.4.2": - version: 0.4.2 - resolution: "@opentelemetry/resource-detector-container@npm:0.4.2" +"@opentelemetry/resource-detector-container@npm:^0.4.3": + version: 0.4.3 + resolution: "@opentelemetry/resource-detector-container@npm:0.4.3" dependencies: + "@opentelemetry/core": ^1.26.0 "@opentelemetry/resources": ^1.10.0 "@opentelemetry/semantic-conventions": ^1.27.0 peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 69b7d105b8d58e92bd4d35b7eba7a8be97fa4c89ba8006a590c03d028f84150bc5360d176933b0aba03c81ee0613cf46c74213cb52e96c05dd1497e2b4512875 + checksum: 301a98524027442030cb6ea17c75988c29925586d86acde637d9129007d78e4dd27f7a3af30998000c475d2aae2a08d3269259e5d49973a7824f41ee144285e4 languageName: node linkType: hard From 159d87c7e86a50243e8df09f6ffaed8f839e607c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:00:56 +0000 Subject: [PATCH 106/268] Update dependency @types/react-dom to v18.3.1 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 88d3c30197..badd0f81f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18583,11 +18583,11 @@ __metadata: linkType: hard "@types/react-dom@npm:^18": - version: 18.3.0 - resolution: "@types/react-dom@npm:18.3.0" + version: 18.3.1 + resolution: "@types/react-dom@npm:18.3.1" dependencies: "@types/react": "*" - checksum: a0cd9b1b815a6abd2a367a9eabdd8df8dd8f13f95897b2f9e1359ea3ac6619f957c1432ece004af7d95e2a7caddbba19faa045f831f32d6263483fc5404a7596 + checksum: ad28ecce3915d30dc76adc2a1373fda1745ba429cea290e16c6628df9a05fd80b6403c8e87d78b45e6c60e51df7a67add389ab62b90070fbfdc9bda8307d9953 languageName: node linkType: hard From 62b147ebe243ca21a49b585227222e64dc42a022 Mon Sep 17 00:00:00 2001 From: JounQin Date: Fri, 11 Oct 2024 18:15:30 +0800 Subject: [PATCH 107/268] chore: upgrade rspack to v1.0 Signed-off-by: JounQin --- packages/cli/package.json | 12 +- yarn.lock | 560 +++++++++++++------------------------- 2 files changed, 189 insertions(+), 383 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 844594753b..36d5a4d538 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -170,9 +170,9 @@ "@backstage/dev-utils": "workspace:^", "@backstage/test-utils": "workspace:^", "@backstage/theme": "workspace:^", - "@rspack/core": "^0.7.5", - "@rspack/dev-server": "^0.7.5", - "@rspack/plugin-react-refresh": "^0.7.5", + "@rspack/core": "^1.0.10", + "@rspack/dev-server": "^1.0.9", + "@rspack/plugin-react-refresh": "^1.0.0", "@types/cross-spawn": "^6.0.2", "@types/ejs": "^3.1.3", "@types/express": "^4.17.6", @@ -199,9 +199,9 @@ }, "peerDependencies": { "@modyfi/vite-plugin-yaml": "^1.1.0", - "@rspack/core": "^0.7.5", - "@rspack/dev-server": "^0.7.5", - "@rspack/plugin-react-refresh": "^0.7.5", + "@rspack/core": "^1.0.10", + "@rspack/dev-server": "^1.0.9", + "@rspack/plugin-react-refresh": "^1.0.0", "@vitejs/plugin-react": "^4.0.4", "vite": "^4.4.9", "vite-plugin-html": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 3b522f91e1..6402cf8408 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3940,9 +3940,9 @@ __metadata: "@rollup/plugin-json": ^6.0.0 "@rollup/plugin-node-resolve": ^15.0.0 "@rollup/plugin-yaml": ^4.0.0 - "@rspack/core": ^0.7.5 - "@rspack/dev-server": ^0.7.5 - "@rspack/plugin-react-refresh": ^0.7.5 + "@rspack/core": ^1.0.10 + "@rspack/dev-server": ^1.0.9 + "@rspack/plugin-react-refresh": ^1.0.0 "@spotify/eslint-config-base": ^15.0.0 "@spotify/eslint-config-react": ^15.0.0 "@spotify/eslint-config-typescript": ^15.0.0 @@ -4063,9 +4063,9 @@ __metadata: zod: ^3.22.4 peerDependencies: "@modyfi/vite-plugin-yaml": ^1.1.0 - "@rspack/core": ^0.7.5 - "@rspack/dev-server": ^0.7.5 - "@rspack/plugin-react-refresh": ^0.7.5 + "@rspack/core": ^1.0.10 + "@rspack/dev-server": ^1.0.9 + "@rspack/plugin-react-refresh": ^1.0.0 "@vitejs/plugin-react": ^4.0.4 vite: ^4.4.9 vite-plugin-html: ^3.2.0 @@ -11557,13 +11557,13 @@ __metadata: languageName: node linkType: hard -"@module-federation/runtime-tools@npm:0.1.6": - version: 0.1.6 - resolution: "@module-federation/runtime-tools@npm:0.1.6" +"@module-federation/runtime-tools@npm:0.5.1": + version: 0.5.1 + resolution: "@module-federation/runtime-tools@npm:0.5.1" dependencies: - "@module-federation/runtime": 0.1.6 - "@module-federation/webpack-bundler-runtime": 0.1.6 - checksum: a902fe7fd07707be566fec6620c71d597311cee02cc2c2605b9b796f9aad07fcc3c60939efb2e139b01b28ac599d610f5dbc054c555915cd9e5fcc9324598413 + "@module-federation/runtime": 0.5.1 + "@module-federation/webpack-bundler-runtime": 0.5.1 + checksum: 651051fb6e2e63915b408547b7d6bdea06338857e293e293b088e330dbb78e147df1b74c5e1f9d1e93ea6e61706f2d4511b8a0dc487703b5615db9695ee9e8ad languageName: node linkType: hard @@ -11577,12 +11577,12 @@ __metadata: languageName: node linkType: hard -"@module-federation/runtime@npm:0.1.6": - version: 0.1.6 - resolution: "@module-federation/runtime@npm:0.1.6" +"@module-federation/runtime@npm:0.5.1": + version: 0.5.1 + resolution: "@module-federation/runtime@npm:0.5.1" dependencies: - "@module-federation/sdk": 0.1.6 - checksum: c564636edd5c1abf5ddf54a6d0dde8fcad1a72d2561163a841f08c354fb1a6e2c69e89d0ec3e5412d55556ea19057ad1980962fbd571aca5a0fb7945e60c0822 + "@module-federation/sdk": 0.5.1 + checksum: 810e350dbd12a7f4bffb860375fd28a26a560669128f5339d729bc40810ae9b503b4034cbbb90e7105fd1df5544c3bc9cf11dfd2a47e2eaa2c50d00ad759b1e2 languageName: node linkType: hard @@ -11595,10 +11595,10 @@ __metadata: languageName: node linkType: hard -"@module-federation/sdk@npm:0.1.6": - version: 0.1.6 - resolution: "@module-federation/sdk@npm:0.1.6" - checksum: 99442f2269e916af78f9f77f7fc71a40e83e4dec5408d6ea8b1f053662005e5717340f91c666cce178e0d9ab92b13826f7cba5e00417bce2a3ee67c0face6ac5 +"@module-federation/sdk@npm:0.5.1": + version: 0.5.1 + resolution: "@module-federation/sdk@npm:0.5.1" + checksum: 75f225926564779db3113aae9cd1b89d303b753026c84945a5225b496554db9e3a2fe2e1d594af4357708853337f161235f46ed5e6320592ac1e8b07756bf918 languageName: node linkType: hard @@ -11620,13 +11620,13 @@ __metadata: languageName: node linkType: hard -"@module-federation/webpack-bundler-runtime@npm:0.1.6": - version: 0.1.6 - resolution: "@module-federation/webpack-bundler-runtime@npm:0.1.6" +"@module-federation/webpack-bundler-runtime@npm:0.5.1": + version: 0.5.1 + resolution: "@module-federation/webpack-bundler-runtime@npm:0.5.1" dependencies: - "@module-federation/runtime": 0.1.6 - "@module-federation/sdk": 0.1.6 - checksum: 7dd6478cdd34881e974f67c8fe3cf668dbd881722416e214981eb423a67a7a1743564d60e652c6819445b1ab8d13fef823ea309c9c75c189001e75e81bd34fb3 + "@module-federation/runtime": 0.5.1 + "@module-federation/sdk": 0.5.1 + checksum: a84a7b9482f133eba0fb8fd77ea87310a1028b7d5fc3da4a17b2bb5fc3fc9fc440cb32ed927f74e1bfe61925eec361512884d84b236b3cdab74276c0dcfff840 languageName: node linkType: hard @@ -15121,82 +15121,82 @@ __metadata: languageName: node linkType: hard -"@rspack/binding-darwin-arm64@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-darwin-arm64@npm:0.7.5" +"@rspack/binding-darwin-arm64@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-darwin-arm64@npm:1.0.10" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rspack/binding-darwin-x64@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-darwin-x64@npm:0.7.5" +"@rspack/binding-darwin-x64@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-darwin-x64@npm:1.0.10" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rspack/binding-linux-arm64-gnu@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-linux-arm64-gnu@npm:0.7.5" +"@rspack/binding-linux-arm64-gnu@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-linux-arm64-gnu@npm:1.0.10" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rspack/binding-linux-arm64-musl@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-linux-arm64-musl@npm:0.7.5" +"@rspack/binding-linux-arm64-musl@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-linux-arm64-musl@npm:1.0.10" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rspack/binding-linux-x64-gnu@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-linux-x64-gnu@npm:0.7.5" +"@rspack/binding-linux-x64-gnu@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-linux-x64-gnu@npm:1.0.10" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rspack/binding-linux-x64-musl@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-linux-x64-musl@npm:0.7.5" +"@rspack/binding-linux-x64-musl@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-linux-x64-musl@npm:1.0.10" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rspack/binding-win32-arm64-msvc@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-win32-arm64-msvc@npm:0.7.5" +"@rspack/binding-win32-arm64-msvc@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-win32-arm64-msvc@npm:1.0.10" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rspack/binding-win32-ia32-msvc@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-win32-ia32-msvc@npm:0.7.5" +"@rspack/binding-win32-ia32-msvc@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-win32-ia32-msvc@npm:1.0.10" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rspack/binding-win32-x64-msvc@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding-win32-x64-msvc@npm:0.7.5" +"@rspack/binding-win32-x64-msvc@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding-win32-x64-msvc@npm:1.0.10" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@rspack/binding@npm:0.7.5": - version: 0.7.5 - resolution: "@rspack/binding@npm:0.7.5" +"@rspack/binding@npm:1.0.10": + version: 1.0.10 + resolution: "@rspack/binding@npm:1.0.10" dependencies: - "@rspack/binding-darwin-arm64": 0.7.5 - "@rspack/binding-darwin-x64": 0.7.5 - "@rspack/binding-linux-arm64-gnu": 0.7.5 - "@rspack/binding-linux-arm64-musl": 0.7.5 - "@rspack/binding-linux-x64-gnu": 0.7.5 - "@rspack/binding-linux-x64-musl": 0.7.5 - "@rspack/binding-win32-arm64-msvc": 0.7.5 - "@rspack/binding-win32-ia32-msvc": 0.7.5 - "@rspack/binding-win32-x64-msvc": 0.7.5 + "@rspack/binding-darwin-arm64": 1.0.10 + "@rspack/binding-darwin-x64": 1.0.10 + "@rspack/binding-linux-arm64-gnu": 1.0.10 + "@rspack/binding-linux-arm64-musl": 1.0.10 + "@rspack/binding-linux-x64-gnu": 1.0.10 + "@rspack/binding-linux-x64-musl": 1.0.10 + "@rspack/binding-win32-arm64-msvc": 1.0.10 + "@rspack/binding-win32-ia32-msvc": 1.0.10 + "@rspack/binding-win32-x64-msvc": 1.0.10 dependenciesMeta: "@rspack/binding-darwin-arm64": optional: true @@ -15216,55 +15216,65 @@ __metadata: optional: true "@rspack/binding-win32-x64-msvc": optional: true - checksum: de25c44cc9c3a240c6f59a657d19d7170c3af1c99097fe2aa5118e2af7b0d606935ad45640102888ce1806bc67fb207189f562cfbcfe4c1628116f5b06f7c6b6 + checksum: a7add6fe37706dfc7dd937da36590b0d6b6b1c5d2acd97b8c2e773769ef128012e6d797b1b30a2ea0f12a284ef3cd131e4b0158eb33ce50717c04ac2cd220e70 languageName: node linkType: hard -"@rspack/core@npm:^0.7.5": - version: 0.7.5 - resolution: "@rspack/core@npm:0.7.5" +"@rspack/core@npm:^1.0.10": + version: 1.0.10 + resolution: "@rspack/core@npm:1.0.10" dependencies: - "@module-federation/runtime-tools": 0.1.6 - "@rspack/binding": 0.7.5 + "@module-federation/runtime-tools": 0.5.1 + "@rspack/binding": 1.0.10 + "@rspack/lite-tapable": 1.0.1 caniuse-lite: ^1.0.30001616 - tapable: 2.2.1 - webpack-sources: 3.2.3 peerDependencies: "@swc/helpers": ">=0.5.1" peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 9e41005231d7a58888cb349ee26737752087f13847f6178308f04e99169187996e40cdaf8987e656a81fe1fb91aeb2e8ca2f1fa32fed46b04fe2709325e5a387 + checksum: 7e65516c613a1694e3a4585ddaaae4c3e4ac48eb104598fb41c56a22d198152b1384c87f56b36e2589d90353b1e5fd8575a28352ff235bbaa6746972d37f04b8 languageName: node linkType: hard -"@rspack/dev-server@npm:^0.7.5": - version: 0.7.5 - resolution: "@rspack/dev-server@npm:0.7.5" +"@rspack/dev-server@npm:^1.0.9": + version: 1.0.9 + resolution: "@rspack/dev-server@npm:1.0.9" dependencies: - chokidar: 3.5.3 - connect-history-api-fallback: 2.0.0 - express: 4.19.2 - http-proxy-middleware: 2.0.6 - mime-types: 2.1.35 - webpack-dev-middleware: 6.1.2 - webpack-dev-server: 4.13.1 - ws: 8.8.1 + chokidar: ^3.6.0 + connect-history-api-fallback: ^2.0.0 + express: ^4.19.2 + http-proxy-middleware: ^2.0.6 + mime-types: ^2.1.35 + p-retry: 4.6.2 + webpack-dev-middleware: ^7.4.2 + webpack-dev-server: 5.0.4 + ws: ^8.16.0 peerDependencies: "@rspack/core": "*" - checksum: d5c767726b1083797cdcc852cb0603fc81ae0225341b5cf52d15e847ced0f1672b83a42bd3237fd047ba63ebe5a9032f5de9ca8c47f318e6ac68425c91ff46d7 + checksum: 46b6ad1e8f52a44c178042b6b9306fe54ad28ab24b86015f118d03a69628b04bf9563201686e0738b8c06ee8c5dedbc0bb4d6705c7f2d7d3959f2a449ff95cd6 languageName: node linkType: hard -"@rspack/plugin-react-refresh@npm:^0.7.5": - version: 0.7.5 - resolution: "@rspack/plugin-react-refresh@npm:0.7.5" +"@rspack/lite-tapable@npm:1.0.1": + version: 1.0.1 + resolution: "@rspack/lite-tapable@npm:1.0.1" + checksum: a490aa7868178e7277573293a2b81191513d451c72f4118173f080b5c65a19618e1d37083cffa049b563433a3f772ab2f4424c0a920b04b1347ddb12fe3bcbf8 + languageName: node + linkType: hard + +"@rspack/plugin-react-refresh@npm:^1.0.0": + version: 1.0.0 + resolution: "@rspack/plugin-react-refresh@npm:1.0.0" + dependencies: + error-stack-parser: ^2.0.6 + html-entities: ^2.1.0 peerDependencies: react-refresh: ">=0.10.0 <1.0.0" peerDependenciesMeta: react-refresh: optional: true - checksum: ab5f480c44563799bd5d837a608223e57ac41d535adcd22fb8f40625f6bda83e2ece28d40dce4c290249e7c9a8657781b5dfa864b14fae86017e41925d026655 + checksum: 88212e66da7e51d99228c7d77b683ef020ba2f70ea7ed546158167eaa4d6e3fa228da2f7d660c3f7a74ad69a47bc98c67a2d11e4a403f3e1ff8523cded67c6c0 languageName: node linkType: hard @@ -17641,7 +17651,7 @@ __metadata: languageName: node linkType: hard -"@types/bonjour@npm:^3.5.13, @types/bonjour@npm:^3.5.9": +"@types/bonjour@npm:^3.5.13": version: 3.5.13 resolution: "@types/bonjour@npm:3.5.13" dependencies: @@ -17746,7 +17756,7 @@ __metadata: languageName: node linkType: hard -"@types/connect-history-api-fallback@npm:^1.3.5, @types/connect-history-api-fallback@npm:^1.5.4": +"@types/connect-history-api-fallback@npm:^1.5.4": version: 1.5.4 resolution: "@types/connect-history-api-fallback@npm:1.5.4" dependencies: @@ -18011,7 +18021,7 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.21, @types/express@npm:^4.17.6": +"@types/express@npm:*, @types/express@npm:^4.17.21, @types/express@npm:^4.17.6": version: 4.17.21 resolution: "@types/express@npm:4.17.21" dependencies: @@ -18988,7 +18998,7 @@ __metadata: languageName: node linkType: hard -"@types/serve-index@npm:^1.9.1, @types/serve-index@npm:^1.9.4": +"@types/serve-index@npm:^1.9.4": version: 1.9.4 resolution: "@types/serve-index@npm:1.9.4" dependencies: @@ -18997,7 +19007,7 @@ __metadata: languageName: node linkType: hard -"@types/serve-static@npm:*, @types/serve-static@npm:^1.13.10, @types/serve-static@npm:^1.15.5": +"@types/serve-static@npm:*, @types/serve-static@npm:^1.15.5": version: 1.15.7 resolution: "@types/serve-static@npm:1.15.7" dependencies: @@ -19047,7 +19057,7 @@ __metadata: languageName: node linkType: hard -"@types/sockjs@npm:^0.3.33, @types/sockjs@npm:^0.3.36": +"@types/sockjs@npm:^0.3.36": version: 0.3.36 resolution: "@types/sockjs@npm:0.3.36" dependencies: @@ -19299,7 +19309,7 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:*, @types/ws@npm:^8.0.0, @types/ws@npm:^8.5.1, @types/ws@npm:^8.5.10, @types/ws@npm:^8.5.3": +"@types/ws@npm:*, @types/ws@npm:^8.0.0, @types/ws@npm:^8.5.10, @types/ws@npm:^8.5.3": version: 8.5.12 resolution: "@types/ws@npm:8.5.12" dependencies: @@ -22249,26 +22259,6 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:1.20.2": - version: 1.20.2 - resolution: "body-parser@npm:1.20.2" - dependencies: - bytes: 3.1.2 - content-type: ~1.0.5 - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - on-finished: 2.4.1 - qs: 6.11.0 - raw-body: 2.5.2 - type-is: ~1.6.18 - unpipe: 1.0.0 - checksum: 14d37ec638ab5c93f6099ecaed7f28f890d222c650c69306872e00b9efa081ff6c596cd9afb9930656aae4d6c4e1c17537bea12bb73c87a217cb3cfea8896737 - languageName: node - linkType: hard - "body-parser@npm:1.20.3, body-parser@npm:^1.15.2": version: 1.20.3 resolution: "body-parser@npm:1.20.3" @@ -22289,7 +22279,7 @@ __metadata: languageName: node linkType: hard -"bonjour-service@npm:^1.0.11, bonjour-service@npm:^1.2.1": +"bonjour-service@npm:^1.2.1": version: 1.2.1 resolution: "bonjour-service@npm:1.2.1" dependencies: @@ -23014,25 +23004,6 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:3.5.3": - version: 3.5.3 - resolution: "chokidar@npm:3.5.3" - dependencies: - anymatch: ~3.1.2 - braces: ~3.0.2 - fsevents: ~2.3.2 - glob-parent: ~5.1.2 - is-binary-path: ~2.1.0 - is-glob: ~4.0.1 - normalize-path: ~3.0.0 - readdirp: ~3.6.0 - dependenciesMeta: - fsevents: - optional: true - checksum: b49fcde40176ba007ff361b198a2d35df60d9bb2a5aab228279eb810feae9294a6b4649ab15981304447afe1e6ffbf4788ad5db77235dc770ab777c6e771980c - languageName: node - linkType: hard - "chokidar@npm:^3.3.1, chokidar@npm:^3.4.2, chokidar@npm:^3.5.2, chokidar@npm:^3.5.3, chokidar@npm:^3.6.0": version: 3.6.0 resolution: "chokidar@npm:3.6.0" @@ -23852,13 +23823,6 @@ __metadata: languageName: node linkType: hard -"connect-history-api-fallback@npm:2.0.0, connect-history-api-fallback@npm:^2.0.0": - version: 2.0.0 - resolution: "connect-history-api-fallback@npm:2.0.0" - checksum: dc5368690f4a5c413889792f8df70d5941ca9da44523cde3f87af0745faee5ee16afb8195434550f0504726642734f2683d6c07f8b460f828a12c45fbd4c9a68 - languageName: node - linkType: hard - "connect-history-api-fallback@npm:^1.6.0": version: 1.6.0 resolution: "connect-history-api-fallback@npm:1.6.0" @@ -23866,6 +23830,13 @@ __metadata: languageName: node linkType: hard +"connect-history-api-fallback@npm:^2.0.0": + version: 2.0.0 + resolution: "connect-history-api-fallback@npm:2.0.0" + checksum: dc5368690f4a5c413889792f8df70d5941ca9da44523cde3f87af0745faee5ee16afb8195434550f0504726642734f2683d6c07f8b460f828a12c45fbd4c9a68 + languageName: node + linkType: hard + "connect-session-knex@npm:^4.0.0": version: 4.0.0 resolution: "connect-session-knex@npm:4.0.0" @@ -23993,13 +23964,6 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.6.0, cookie@npm:~0.6.0": - version: 0.6.0 - resolution: "cookie@npm:0.6.0" - checksum: f56a7d32a07db5458e79c726b77e3c2eff655c36792f2b6c58d351fb5f61531e5b1ab7f46987150136e366c65213cbe31729e02a3eaed630c3bf7334635fb410 - languageName: node - linkType: hard - "cookie@npm:0.7.1": version: 0.7.1 resolution: "cookie@npm:0.7.1" @@ -24028,6 +23992,13 @@ __metadata: languageName: node linkType: hard +"cookie@npm:~0.6.0": + version: 0.6.0 + resolution: "cookie@npm:0.6.0" + checksum: f56a7d32a07db5458e79c726b77e3c2eff655c36792f2b6c58d351fb5f61531e5b1ab7f46987150136e366c65213cbe31729e02a3eaed630c3bf7334635fb410 + languageName: node + linkType: hard + "cookiejar@npm:^2.1.4": version: 2.1.4 resolution: "cookiejar@npm:2.1.4" @@ -27449,45 +27420,6 @@ __metadata: languageName: node linkType: hard -"express@npm:4.19.2": - version: 4.19.2 - resolution: "express@npm:4.19.2" - dependencies: - accepts: ~1.3.8 - array-flatten: 1.1.1 - body-parser: 1.20.2 - content-disposition: 0.5.4 - content-type: ~1.0.4 - cookie: 0.6.0 - cookie-signature: 1.0.6 - debug: 2.6.9 - depd: 2.0.0 - encodeurl: ~1.0.2 - escape-html: ~1.0.3 - etag: ~1.8.1 - finalhandler: 1.2.0 - fresh: 0.5.2 - http-errors: 2.0.0 - merge-descriptors: 1.0.1 - methods: ~1.1.2 - on-finished: 2.4.1 - parseurl: ~1.3.3 - path-to-regexp: 0.1.7 - proxy-addr: ~2.0.7 - qs: 6.11.0 - range-parser: ~1.2.1 - safe-buffer: 5.2.1 - send: 0.18.0 - serve-static: 1.15.0 - setprototypeof: 1.2.0 - statuses: 2.0.1 - type-is: ~1.6.18 - utils-merge: 1.0.1 - vary: ~1.1.2 - checksum: 212dbd6c2c222a96a61bc927639c95970a53b06257080bb9e2838adb3bffdb966856551fdad1ab5dd654a217c35db94f987d0aa88d48fb04d306340f5f34dca5 - languageName: node - linkType: hard - "express@npm:^4.14.0, express@npm:^4.17.1, express@npm:^4.17.3, express@npm:^4.18.1, express@npm:^4.18.2, express@npm:^4.19.2": version: 4.21.1 resolution: "express@npm:4.21.1" @@ -27893,21 +27825,6 @@ __metadata: languageName: node linkType: hard -"finalhandler@npm:1.2.0": - version: 1.2.0 - resolution: "finalhandler@npm:1.2.0" - dependencies: - debug: 2.6.9 - encodeurl: ~1.0.2 - escape-html: ~1.0.3 - on-finished: 2.4.1 - parseurl: ~1.3.3 - statuses: 2.0.1 - unpipe: ~1.0.0 - checksum: 92effbfd32e22a7dff2994acedbd9bcc3aa646a3e919ea6a53238090e87097f8ef07cced90aa2cc421abdf993aefbdd5b00104d55c7c5479a8d00ed105b45716 - languageName: node - linkType: hard - "finalhandler@npm:1.3.1": version: 1.3.1 resolution: "finalhandler@npm:1.3.1" @@ -28789,7 +28706,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.0.0, glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.4.1": +"glob@npm:^10.0.0, glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7, glob@npm:^10.4.1": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -29573,7 +29490,7 @@ __metadata: languageName: node linkType: hard -"html-entities@npm:^2.1.0, html-entities@npm:^2.3.2, html-entities@npm:^2.4.0, html-entities@npm:^2.5.2": +"html-entities@npm:^2.1.0, html-entities@npm:^2.4.0, html-entities@npm:^2.5.2": version: 2.5.2 resolution: "html-entities@npm:2.5.2" checksum: b23f4a07d33d49ade1994069af4e13d31650e3fb62621e92ae10ecdf01d1a98065c78fd20fdc92b4c7881612210b37c275f2c9fba9777650ab0d6f2ceb3b99b6 @@ -29774,24 +29691,6 @@ __metadata: languageName: node linkType: hard -"http-proxy-middleware@npm:2.0.6": - version: 2.0.6 - resolution: "http-proxy-middleware@npm:2.0.6" - dependencies: - "@types/http-proxy": ^1.17.8 - http-proxy: ^1.18.1 - is-glob: ^4.0.1 - is-plain-obj: ^3.0.0 - micromatch: ^4.0.2 - peerDependencies: - "@types/express": ^4.17.13 - peerDependenciesMeta: - "@types/express": - optional: true - checksum: 2ee85bc878afa6cbf34491e972ece0f5be0a3e5c98a60850cf40d2a9a5356e1fc57aab6cff33c1fc37691b0121c3a42602d2b1956c52577e87a5b77b62ae1c3a - languageName: node - linkType: hard - "http-proxy-middleware@npm:^2.0.0, http-proxy-middleware@npm:^2.0.3, http-proxy-middleware@npm:^2.0.6": version: 2.0.7 resolution: "http-proxy-middleware@npm:2.0.7" @@ -30375,7 +30274,7 @@ __metadata: languageName: node linkType: hard -"ipaddr.js@npm:^2.0.1, ipaddr.js@npm:^2.1.0": +"ipaddr.js@npm:^2.1.0": version: 2.2.0 resolution: "ipaddr.js@npm:2.2.0" checksum: 770ba8451fd9bf78015e8edac0d5abd7a708cbf75f9429ca9147a9d2f3a2d60767cd5de2aab2b1e13ca6e4445bdeff42bf12ef6f151c07a5c6cf8a44328e2859 @@ -32855,7 +32754,7 @@ __metadata: languageName: node linkType: hard -"launch-editor@npm:^2.6.0, launch-editor@npm:^2.6.1": +"launch-editor@npm:^2.6.1": version: 2.9.1 resolution: "launch-editor@npm:2.9.1" dependencies: @@ -34072,7 +33971,7 @@ __metadata: languageName: node linkType: hard -"memfs@npm:^3.1.2, memfs@npm:^3.4.1, memfs@npm:^3.4.12, memfs@npm:^3.4.3": +"memfs@npm:^3.1.2, memfs@npm:^3.4.1": version: 3.5.3 resolution: "memfs@npm:3.5.3" dependencies: @@ -34120,13 +34019,6 @@ __metadata: languageName: node linkType: hard -"merge-descriptors@npm:1.0.1": - version: 1.0.1 - resolution: "merge-descriptors@npm:1.0.1" - checksum: 5abc259d2ae25bb06d19ce2b94a21632583c74e2a9109ee1ba7fd147aa7362b380d971e0251069f8b3eb7d48c21ac839e21fa177b335e82c76ec172e30c31a26 - languageName: node - linkType: hard - "merge-descriptors@npm:1.0.3, merge-descriptors@npm:^1.0.1": version: 1.0.3 resolution: "merge-descriptors@npm:1.0.3" @@ -34549,7 +34441,7 @@ __metadata: languageName: node linkType: hard -"mime-types@npm:2.1.35, mime-types@npm:^2.1.12, mime-types@npm:^2.1.18, mime-types@npm:^2.1.27, mime-types@npm:^2.1.31, mime-types@npm:~2.1.17, mime-types@npm:~2.1.19, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": +"mime-types@npm:2.1.35, mime-types@npm:^2.1.12, mime-types@npm:^2.1.18, mime-types@npm:^2.1.27, mime-types@npm:^2.1.31, mime-types@npm:^2.1.35, mime-types@npm:~2.1.17, mime-types@npm:~2.1.19, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": version: 2.1.35 resolution: "mime-types@npm:2.1.35" dependencies: @@ -36286,7 +36178,7 @@ __metadata: languageName: node linkType: hard -"open@npm:^8.0.0, open@npm:^8.0.9, open@npm:^8.4.0": +"open@npm:^8.0.0, open@npm:^8.4.0": version: 8.4.2 resolution: "open@npm:8.4.2" dependencies: @@ -36592,7 +36484,7 @@ __metadata: languageName: node linkType: hard -"p-retry@npm:^4.5.0": +"p-retry@npm:4.6.2": version: 4.6.2 resolution: "p-retry@npm:4.6.2" dependencies: @@ -37120,13 +37012,6 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:0.1.7": - version: 0.1.7 - resolution: "path-to-regexp@npm:0.1.7" - checksum: 69a14ea24db543e8b0f4353305c5eac6907917031340e5a8b37df688e52accd09e3cebfe1660b70d76b6bd89152f52183f28c74813dbf454ba1a01c82a38abce - languageName: node - linkType: hard - "path-to-regexp@npm:2.2.1": version: 2.2.1 resolution: "path-to-regexp@npm:2.2.1" @@ -38554,15 +38439,6 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.11.0": - version: 6.11.0 - resolution: "qs@npm:6.11.0" - dependencies: - side-channel: ^1.0.4 - checksum: 6e1f29dd5385f7488ec74ac7b6c92f4d09a90408882d0c208414a34dd33badc1a621019d4c799a3df15ab9b1d0292f97c1dd71dc7c045e69f81a8064e5af7297 - languageName: node - linkType: hard - "qs@npm:6.13.0, qs@npm:^6.10.1, qs@npm:^6.10.2, qs@npm:^6.10.3, qs@npm:^6.11.0, qs@npm:^6.11.2, qs@npm:^6.12.2, qs@npm:^6.9.4": version: 6.13.0 resolution: "qs@npm:6.13.0" @@ -40294,6 +40170,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^5.0.5": + version: 5.0.10 + resolution: "rimraf@npm:5.0.10" + dependencies: + glob: ^10.3.7 + bin: + rimraf: dist/esm/bin.mjs + checksum: 50e27388dd2b3fa6677385fc1e2966e9157c89c86853b96d02e6915663a96b7ff4d590e14f6f70e90f9b554093aa5dbc05ac3012876be558c06a65437337bc05 + languageName: node + linkType: hard + "rimraf@npm:~2.6.2": version: 2.6.3 resolution: "rimraf@npm:2.6.3" @@ -40812,7 +40699,7 @@ __metadata: languageName: node linkType: hard -"selfsigned@npm:^2.0.0, selfsigned@npm:^2.1.1, selfsigned@npm:^2.4.1": +"selfsigned@npm:^2.0.0, selfsigned@npm:^2.4.1": version: 2.4.1 resolution: "selfsigned@npm:2.4.1" dependencies: @@ -40883,27 +40770,6 @@ __metadata: languageName: node linkType: hard -"send@npm:0.18.0": - version: 0.18.0 - resolution: "send@npm:0.18.0" - dependencies: - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - encodeurl: ~1.0.2 - escape-html: ~1.0.3 - etag: ~1.8.1 - fresh: 0.5.2 - http-errors: 2.0.0 - mime: 1.6.0 - ms: 2.1.3 - on-finished: 2.4.1 - range-parser: ~1.2.1 - statuses: 2.0.1 - checksum: 74fc07ebb58566b87b078ec63e5a3e41ecd987e4272ba67b7467e86c6ad51bc6b0b0154133b6d8b08a2ddda360464f71382f7ef864700f34844a76c8027817a8 - languageName: node - linkType: hard - "send@npm:0.19.0": version: 0.19.0 resolution: "send@npm:0.19.0" @@ -40990,18 +40856,6 @@ __metadata: languageName: node linkType: hard -"serve-static@npm:1.15.0": - version: 1.15.0 - resolution: "serve-static@npm:1.15.0" - dependencies: - encodeurl: ~1.0.2 - escape-html: ~1.0.3 - parseurl: ~1.3.3 - send: 0.18.0 - checksum: af57fc13be40d90a12562e98c0b7855cf6e8bd4c107fe9a45c212bf023058d54a1871b1c89511c3958f70626fff47faeb795f5d83f8cf88514dbaeb2b724464d - languageName: node - linkType: hard - "serve-static@npm:1.16.2": version: 1.16.2 resolution: "serve-static@npm:1.16.2" @@ -42634,13 +42488,6 @@ __metadata: languageName: node linkType: hard -"tapable@npm:2.2.1, tapable@npm:^2.0.0, tapable@npm:^2.1.1, tapable@npm:^2.2.0, tapable@npm:^2.2.1": - version: 2.2.1 - resolution: "tapable@npm:2.2.1" - checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 - languageName: node - linkType: hard - "tapable@npm:^1.0.0": version: 1.1.3 resolution: "tapable@npm:1.1.3" @@ -42648,6 +42495,13 @@ __metadata: languageName: node linkType: hard +"tapable@npm:^2.0.0, tapable@npm:^2.1.1, tapable@npm:^2.2.0, tapable@npm:^2.2.1": + version: 2.2.1 + resolution: "tapable@npm:2.2.1" + checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 + languageName: node + linkType: hard + "tar-fs@npm:^2.0.0": version: 2.1.1 resolution: "tar-fs@npm:2.1.1" @@ -44857,40 +44711,7 @@ __metadata: languageName: node linkType: hard -"webpack-dev-middleware@npm:6.1.2": - version: 6.1.2 - resolution: "webpack-dev-middleware@npm:6.1.2" - dependencies: - colorette: ^2.0.10 - memfs: ^3.4.12 - mime-types: ^2.1.31 - range-parser: ^1.2.1 - schema-utils: ^4.0.0 - peerDependencies: - webpack: ^5.0.0 - peerDependenciesMeta: - webpack: - optional: true - checksum: 6e962341db5b3ac8526cd678fc6b128adcb92c288aab767948ab7d01591d7837d2d97cf9329d307831b1d51c831fcea4d8f2eb514efe8c8654ae2a4ae9d9f1fb - languageName: node - linkType: hard - -"webpack-dev-middleware@npm:^5.3.1": - version: 5.3.4 - resolution: "webpack-dev-middleware@npm:5.3.4" - dependencies: - colorette: ^2.0.10 - memfs: ^3.4.3 - mime-types: ^2.1.31 - range-parser: ^1.2.1 - schema-utils: ^4.0.0 - peerDependencies: - webpack: ^4.0.0 || ^5.0.0 - checksum: 90cf3e27d0714c1a745454a1794f491b7076434939340605b9ee8718ba2b85385b120939754e9fdbd6569811e749dee53eec319e0d600e70e0b0baffd8e3fb13 - languageName: node - linkType: hard - -"webpack-dev-middleware@npm:^7.4.2": +"webpack-dev-middleware@npm:^7.1.0, webpack-dev-middleware@npm:^7.4.2": version: 7.4.2 resolution: "webpack-dev-middleware@npm:7.4.2" dependencies: @@ -44909,42 +44730,42 @@ __metadata: languageName: node linkType: hard -"webpack-dev-server@npm:4.13.1": - version: 4.13.1 - resolution: "webpack-dev-server@npm:4.13.1" +"webpack-dev-server@npm:5.0.4": + version: 5.0.4 + resolution: "webpack-dev-server@npm:5.0.4" dependencies: - "@types/bonjour": ^3.5.9 - "@types/connect-history-api-fallback": ^1.3.5 - "@types/express": ^4.17.13 - "@types/serve-index": ^1.9.1 - "@types/serve-static": ^1.13.10 - "@types/sockjs": ^0.3.33 - "@types/ws": ^8.5.1 + "@types/bonjour": ^3.5.13 + "@types/connect-history-api-fallback": ^1.5.4 + "@types/express": ^4.17.21 + "@types/serve-index": ^1.9.4 + "@types/serve-static": ^1.15.5 + "@types/sockjs": ^0.3.36 + "@types/ws": ^8.5.10 ansi-html-community: ^0.0.8 - bonjour-service: ^1.0.11 - chokidar: ^3.5.3 + bonjour-service: ^1.2.1 + chokidar: ^3.6.0 colorette: ^2.0.10 compression: ^1.7.4 connect-history-api-fallback: ^2.0.0 default-gateway: ^6.0.3 express: ^4.17.3 graceful-fs: ^4.2.6 - html-entities: ^2.3.2 + html-entities: ^2.4.0 http-proxy-middleware: ^2.0.3 - ipaddr.js: ^2.0.1 - launch-editor: ^2.6.0 - open: ^8.0.9 - p-retry: ^4.5.0 - rimraf: ^3.0.2 - schema-utils: ^4.0.0 - selfsigned: ^2.1.1 + ipaddr.js: ^2.1.0 + launch-editor: ^2.6.1 + open: ^10.0.3 + p-retry: ^6.2.0 + rimraf: ^5.0.5 + schema-utils: ^4.2.0 + selfsigned: ^2.4.1 serve-index: ^1.9.1 sockjs: ^0.3.24 spdy: ^4.0.2 - webpack-dev-middleware: ^5.3.1 - ws: ^8.13.0 + webpack-dev-middleware: ^7.1.0 + ws: ^8.16.0 peerDependencies: - webpack: ^4.37.0 || ^5.0.0 + webpack: ^5.0.0 peerDependenciesMeta: webpack: optional: true @@ -44952,7 +44773,7 @@ __metadata: optional: true bin: webpack-dev-server: bin/webpack-dev-server.js - checksum: f70611544b7d964a31eb3d934d7c2b376b97e6927a89e03b2e21cfa5812bb639625cd18fd350de1604ba6c455b324135523a894032f28c69d90d90682e4f3b7d + checksum: b3535d01e8d895f4ce6d74b5f76e29398b712476216cd6d459365e5cc2f2fb1e49240aef6c23b2b943b04dbf768d7d18301af3eb064038bde4e11d03c241202d languageName: node linkType: hard @@ -45008,13 +44829,6 @@ __metadata: languageName: node linkType: hard -"webpack-sources@npm:3.2.3, webpack-sources@npm:^3.2.3": - version: 3.2.3 - resolution: "webpack-sources@npm:3.2.3" - checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 - languageName: node - linkType: hard - "webpack-sources@npm:^1.4.3": version: 1.4.3 resolution: "webpack-sources@npm:1.4.3" @@ -45025,6 +44839,13 @@ __metadata: languageName: node linkType: hard +"webpack-sources@npm:^3.2.3": + version: 3.2.3 + resolution: "webpack-sources@npm:3.2.3" + checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 + languageName: node + linkType: hard + "webpack@npm:^5, webpack@npm:^5.70.0": version: 5.94.0 resolution: "webpack@npm:5.94.0" @@ -45388,7 +45209,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:*, ws@npm:^8.11.0, ws@npm:^8.12.0, ws@npm:^8.13.0, ws@npm:^8.17.1, ws@npm:^8.18.0, ws@npm:^8.8.0": +"ws@npm:*, ws@npm:^8.11.0, ws@npm:^8.12.0, ws@npm:^8.13.0, ws@npm:^8.16.0, ws@npm:^8.17.1, ws@npm:^8.18.0, ws@npm:^8.8.0": version: 8.18.0 resolution: "ws@npm:8.18.0" peerDependencies: @@ -45418,21 +45239,6 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.8.1": - version: 8.8.1 - resolution: "ws@npm:8.8.1" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 2152cf862cae0693f3775bc688a6afb2e989d19d626d215e70f5fcd8eb55b1c3b0d3a6a4052905ec320e2d7734e20aeedbf9744496d62f15a26ad79cf4cf7dae - languageName: node - linkType: hard - "ws@npm:^7, ws@npm:^7.4.6, ws@npm:^7.5.5": version: 7.5.10 resolution: "ws@npm:7.5.10" From b6a01a8bdb6598f85216b3ee29506695083b060b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 11:29:19 +0200 Subject: [PATCH 108/268] new "modern" plugin as base for the new backend plugin template Signed-off-by: Patrik Oldsberg --- plugins/modern-backend/.eslintrc.js | 1 + plugins/modern-backend/README.md | 14 +++ plugins/modern-backend/catalog-info.yaml | 9 ++ plugins/modern-backend/dev/index.ts | 74 ++++++++++++ plugins/modern-backend/package.json | 48 ++++++++ plugins/modern-backend/src/index.ts | 17 +++ plugins/modern-backend/src/plugin.test.ts | 101 ++++++++++++++++ plugins/modern-backend/src/plugin.ts | 57 +++++++++ plugins/modern-backend/src/router.test.ts | 83 +++++++++++++ plugins/modern-backend/src/router.ts | 67 ++++++++++ .../TodoListService/createTodoListService.ts | 114 ++++++++++++++++++ .../src/services/TodoListService/index.ts | 17 +++ .../src/services/TodoListService/types.ts | 43 +++++++ plugins/modern-backend/src/setupTests.ts | 17 +++ 14 files changed, 662 insertions(+) create mode 100644 plugins/modern-backend/.eslintrc.js create mode 100644 plugins/modern-backend/README.md create mode 100644 plugins/modern-backend/catalog-info.yaml create mode 100644 plugins/modern-backend/dev/index.ts create mode 100644 plugins/modern-backend/package.json create mode 100644 plugins/modern-backend/src/index.ts create mode 100644 plugins/modern-backend/src/plugin.test.ts create mode 100644 plugins/modern-backend/src/plugin.ts create mode 100644 plugins/modern-backend/src/router.test.ts create mode 100644 plugins/modern-backend/src/router.ts create mode 100644 plugins/modern-backend/src/services/TodoListService/createTodoListService.ts create mode 100644 plugins/modern-backend/src/services/TodoListService/index.ts create mode 100644 plugins/modern-backend/src/services/TodoListService/types.ts create mode 100644 plugins/modern-backend/src/setupTests.ts diff --git a/plugins/modern-backend/.eslintrc.js b/plugins/modern-backend/.eslintrc.js new file mode 100644 index 0000000000..e2a53a6ad2 --- /dev/null +++ b/plugins/modern-backend/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/modern-backend/README.md b/plugins/modern-backend/README.md new file mode 100644 index 0000000000..929b0a189f --- /dev/null +++ b/plugins/modern-backend/README.md @@ -0,0 +1,14 @@ +# modern + +Welcome to the modern backend plugin! + +_This plugin was created through the Backstage CLI_ + +## Getting started + +Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn +start` in the root directory, and then navigating to [/modern/health](http://localhost:7007/api/modern/health). + +You can also serve the plugin in isolation by running `yarn start` in the plugin directory. +This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. +It is only meant for local development, and the setup for it can be found inside the [/dev](./dev) directory. diff --git a/plugins/modern-backend/catalog-info.yaml b/plugins/modern-backend/catalog-info.yaml new file mode 100644 index 0000000000..fd4b9dc0ba --- /dev/null +++ b/plugins/modern-backend/catalog-info.yaml @@ -0,0 +1,9 @@ +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: backstage-plugin-modern-backend + title: '@backstage/plugin-modern-backend' +spec: + lifecycle: experimental + type: backstage-backend-plugin + owner: maintainers diff --git a/plugins/modern-backend/dev/index.ts b/plugins/modern-backend/dev/index.ts new file mode 100644 index 0000000000..393f979bed --- /dev/null +++ b/plugins/modern-backend/dev/index.ts @@ -0,0 +1,74 @@ +/* + * Copyright 2024 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 { createBackend } from '@backstage/backend-defaults'; +import { mockServices } from '@backstage/backend-test-utils'; +import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; + +// TEMPLATE NOTE: +// This is the development setup for your plugin that wires up a +// minimal backend that can use both real and mocked plugins and services. +// +// Start up the backend by running `yarn start` in the package directory. +// It's it's up and running, try out the following requests: +// +// Create a new todo item: +// +// curl http://localhost:7007/api/modern/todos -H 'Content-Type: application/json' -d '{"title": "My Todo"}' +// +// List TODOs: +// +// curl http://localhost:7007/api/modern/todos +// +// Explicitly make an unauthenticated request, or with service auth: +// +// curl http://localhost:7007/api/modern/todos -H 'Authorization: Bearer mock-none-token' +// curl http://localhost:7007/api/modern/todos -H 'Authorization: Bearer mock-service-token' + +const backend = createBackend(); + +// TEMPLATE NOTE: +// Mocking the auth and httpAuth service allows you to call your plugin API without +// having to authenticate. +// +// If you want to use real auth, you can install the following instead: +// backend.add(import('@backstage/plugin-auth-backend')); +// backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); +backend.add(mockServices.auth.factory()); +backend.add(mockServices.httpAuth.factory()); + +// TEMPLATE NOTE: +// Rather than using a real catalog you can use a mock with a fixed set of entities. +backend.add( + catalogServiceMock.factory({ + entities: [ + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Component', + metadata: { + name: 'sample', + title: 'Sample Component', + }, + spec: { + type: 'service', + }, + }, + ], + }), +); + +backend.add(import('../src')); + +backend.start(); diff --git a/plugins/modern-backend/package.json b/plugins/modern-backend/package.json new file mode 100644 index 0000000000..def56e6ce3 --- /dev/null +++ b/plugins/modern-backend/package.json @@ -0,0 +1,48 @@ +{ + "name": "@backstage/plugin-modern-backend", + "version": "0.0.0", + "backstage": { + "role": "backend-plugin" + }, + "publishConfig": { + "access": "public", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts" + }, + "license": "Apache-2.0", + "main": "src/index.ts", + "types": "src/index.ts", + "files": [ + "dist" + ], + "scripts": { + "build": "backstage-cli package build", + "clean": "backstage-cli package clean", + "lint": "backstage-cli package lint", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack", + "start": "backstage-cli package start", + "test": "backstage-cli package test" + }, + "dependencies": { + "@backstage/backend-defaults": "workspace:^", + "@backstage/backend-plugin-api": "workspace:^", + "@backstage/catalog-client": "workspace:^", + "@backstage/errors": "workspace:^", + "@backstage/plugin-catalog-node": "workspace:^", + "express": "^4.17.1", + "express-promise-router": "^4.1.0", + "node-fetch": "^2.6.7", + "zod": "^3.22.4" + }, + "devDependencies": { + "@backstage/backend-test-utils": "workspace:^", + "@backstage/cli": "workspace:^", + "@backstage/plugin-auth-backend": "workspace:^", + "@backstage/plugin-auth-backend-module-guest-provider": "workspace:^", + "@types/express": "*", + "@types/supertest": "^2.0.8", + "msw": "^2.0.8", + "supertest": "^6.2.4" + } +} diff --git a/plugins/modern-backend/src/index.ts b/plugins/modern-backend/src/index.ts new file mode 100644 index 0000000000..33e742ca76 --- /dev/null +++ b/plugins/modern-backend/src/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { modernPlugin as default } from './plugin'; diff --git a/plugins/modern-backend/src/plugin.test.ts b/plugins/modern-backend/src/plugin.test.ts new file mode 100644 index 0000000000..975fb1ae70 --- /dev/null +++ b/plugins/modern-backend/src/plugin.test.ts @@ -0,0 +1,101 @@ +/* + * Copyright 2024 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 { + mockCredentials, + startTestBackend, +} from '@backstage/backend-test-utils'; +import { modernPlugin } from './plugin'; +import request from 'supertest'; +import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; + +// TEMPLATE NOTE: +// Plugin tests are integration tests for your plugin, ensuring that all pieces +// work together end-to-end. You can still mock injected backend services +// however, just like anyway that installs your plugin might replace the +// services with their own implementations. +describe('plugin', () => { + it('should create and read TODO items', async () => { + const { server } = await startTestBackend({ + features: [modernPlugin], + }); + + await request(server).get('/api/modern/todos').expect(200, { + items: [], + }); + + const createRes = await request(server) + .post('/api/modern/todos') + .send({ title: 'My Todo' }); + + expect(createRes.status).toBe(201); + expect(createRes.body).toEqual({ + id: expect.any(String), + title: 'My Todo', + createdBy: mockCredentials.user().principal.userEntityRef, + createdAt: expect.any(String), + }); + + const createdTodoItem = createRes.body; + + await request(server) + .get('/api/modern/todos') + .expect(200, { + items: [createdTodoItem], + }); + + await request(server) + .get(`/api/modern/todos/${createdTodoItem.id}`) + .expect(200, createdTodoItem); + }); + + it('should create TODO item with catalog information', async () => { + const { server } = await startTestBackend({ + features: [ + modernPlugin, + catalogServiceMock.factory({ + entities: [ + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Component', + metadata: { + name: 'my-component', + namespace: 'default', + title: 'My Component', + }, + spec: { + type: 'service', + owner: 'me', + }, + }, + ], + }), + ], + }); + + const createRes = await request(server) + .post('/api/modern/todos') + .send({ title: 'My Todo', entityRef: 'component:default/my-component' }); + + expect(createRes.status).toBe(201); + expect(createRes.body).toEqual({ + id: expect.any(String), + title: '[My Component] My Todo', + createdBy: mockCredentials.user().principal.userEntityRef, + createdAt: expect.any(String), + }); + }); +}); diff --git a/plugins/modern-backend/src/plugin.ts b/plugins/modern-backend/src/plugin.ts new file mode 100644 index 0000000000..6db9427f2d --- /dev/null +++ b/plugins/modern-backend/src/plugin.ts @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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 { + coreServices, + createBackendPlugin, +} from '@backstage/backend-plugin-api'; +import { createRouter } from './router'; +import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; +import { createTodoListService } from './services/TodoListService'; + +/** + * modernPlugin backend plugin + * + * @public + */ +export const modernPlugin = createBackendPlugin({ + pluginId: 'modern', + register(env) { + env.registerInit({ + deps: { + logger: coreServices.logger, + auth: coreServices.auth, + httpAuth: coreServices.httpAuth, + httpRouter: coreServices.httpRouter, + catalog: catalogServiceRef, + }, + async init({ logger, auth, httpAuth, httpRouter, catalog }) { + const todoListService = await createTodoListService({ + logger, + auth, + catalog, + }); + + httpRouter.use( + await createRouter({ + httpAuth, + todoListService, + }), + ); + }, + }); + }, +}); diff --git a/plugins/modern-backend/src/router.test.ts b/plugins/modern-backend/src/router.test.ts new file mode 100644 index 0000000000..70534703b4 --- /dev/null +++ b/plugins/modern-backend/src/router.test.ts @@ -0,0 +1,83 @@ +/* + * Copyright 2024 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 { + mockCredentials, + mockErrorHandler, + mockServices, +} from '@backstage/backend-test-utils'; +import express from 'express'; +import request from 'supertest'; + +import { createRouter } from './router'; +import { TodoListService } from './services/TodoListService/types'; + +const mockTodoItem = { + title: 'Do the thing', + id: '123', + createdBy: mockCredentials.user().principal.userEntityRef, + createdAt: new Date().toISOString(), +}; + +// TEMPLATE NOTE: +// Testing the router directly allows you to write a unit test that mocks the provided options. +describe('createRouter', () => { + let app: express.Express; + let todoListService: jest.Mocked; + + beforeEach(async () => { + todoListService = { + createTodo: jest.fn(), + listTodos: jest.fn(), + getTodo: jest.fn(), + }; + const router = await createRouter({ + httpAuth: mockServices.httpAuth(), + todoListService, + }); + app = express(); + app.use(router); + app.use(mockErrorHandler()); + }); + + it('should create a TODO', async () => { + todoListService.createTodo.mockResolvedValue(mockTodoItem); + + const response = await request(app).post('/todos').send({ + title: 'Do the thing', + }); + + expect(response.status).toBe(200); + expect(response.body).toEqual(mockTodoItem); + }); + + it('should not allow unauthenticated requests to create a TODO', async () => { + todoListService.createTodo.mockResolvedValue(mockTodoItem); + + // TEMPLATE NOTE: + // The HttpAuth mock service considers all requests to be authenticated as a + // mock user by default. In order to test other cases we need to explicitly + // pass an authorization header with mock credentials. + const response = await request(app) + .post('/todos') + .set('Authorization', mockCredentials.none.header()) + .send({ + title: 'Do the thing', + }); + + expect(response.status).toBe(401); + }); +}); diff --git a/plugins/modern-backend/src/router.ts b/plugins/modern-backend/src/router.ts new file mode 100644 index 0000000000..f4abbe7383 --- /dev/null +++ b/plugins/modern-backend/src/router.ts @@ -0,0 +1,67 @@ +/* + * Copyright 2024 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 { HttpAuthService } from '@backstage/backend-plugin-api'; +import { InputError } from '@backstage/errors'; +import { z } from 'zod'; +import express from 'express'; +import Router from 'express-promise-router'; +import { TodoListService } from './services/TodoListService/types'; + +export async function createRouter({ + httpAuth, + todoListService, +}: { + httpAuth: HttpAuthService; + todoListService: TodoListService; +}): Promise { + const router = Router(); + router.use(express.json()); + + // TEMPLATE NOTE: + // Zod is a powerful library for data validation and recommended in particular + // for user-defined schemas. In this case we use it for input validation too. + // + // If you want to define a schema for your API we recommend using Backstage's + // OpenAPI tooling: https://backstage.io/docs/next/openapi/01-getting-started + const todoSchema = z.object({ + title: z.string(), + entityRef: z.string().optional(), + }); + + router.post('/todos', async (req, res) => { + const parsed = todoSchema.safeParse(req.body); + if (!parsed.success) { + throw new InputError(parsed.error.toString()); + } + + const result = await todoListService.createTodo(parsed.data, { + credentials: await httpAuth.credentials(req, { allow: ['user'] }), + }); + + res.status(201).json(result); + }); + + router.get('/todos', async (_req, res) => { + res.json(await todoListService.listTodos()); + }); + + router.get('/todos/:id', async (req, res) => { + res.json(await todoListService.getTodo({ id: req.params.id })); + }); + + return router; +} diff --git a/plugins/modern-backend/src/services/TodoListService/createTodoListService.ts b/plugins/modern-backend/src/services/TodoListService/createTodoListService.ts new file mode 100644 index 0000000000..a1b25b027f --- /dev/null +++ b/plugins/modern-backend/src/services/TodoListService/createTodoListService.ts @@ -0,0 +1,114 @@ +/* + * Copyright 2024 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 { AuthService, LoggerService } from '@backstage/backend-plugin-api'; +import { NotFoundError } from '@backstage/errors'; +import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; +import crypto from 'node:crypto'; +import { TodoItem, TodoListService } from './types'; + +// TEMPLATE NOTE: +// This is a simple in-memory todo list store. It is recommended to use a +// database to store data in a real application. See the database service +// documentation for more information on how to do this: +// https://backstage.io/docs/backend-system/core-services/database +export async function createTodoListService({ + auth, + logger, + catalog, +}: { + auth: AuthService; + logger: LoggerService; + catalog: typeof catalogServiceRef.T; +}): Promise { + logger.info('Initializing TodoListService'); + + const storedTodos = new Array(); + + return { + async createTodo(input, options) { + let title = input.title; + + // TEMPLATE NOTE: + // A common pattern for Backstage plugins is to pass an entity reference + // from the frontend to then fetch the entire entity from the catalog in the + // backend plugin. + if (input.entityRef) { + // TEMPLATE NOTE: + // Cross-plugin communication uses service-to-service authentication. The + // `AuthService` lets you generate a token that is valid for communication + // with the target plugin only. You must also provide credentials for the + // identity that you are making the request on behalf of. + // + // If you want to make a request using the plugin backend's own identity, + // you can access it via the `auth.getOwnServiceCredentials()` method. + // Beware that this bypasses any user permission checks. + const { token } = await auth.getPluginRequestToken({ + onBehalfOf: options.credentials, + targetPluginId: 'catalog', + }); + const entity = await catalog.getEntityByRef(input.entityRef, { + token, + }); + if (!entity) { + throw new NotFoundError( + `No entity found for ref '${input.entityRef}'`, + ); + } + + // TEMPLATE NOTE: + // Here you could read any form of data from the entity. A common use case + // is to read the value of a custom annotation for your plugin. You can + // read more about how to add custom annotations here: + // https://backstage.io/docs/features/software-catalog/extending-the-model#adding-a-new-annotation + // + // In this example we just use the entity title to decorate the todo item. + + const entityDisplay = entity.metadata.title ?? input.entityRef; + title = `[${entityDisplay}] ${input.title}`; + } + + const id = crypto.randomUUID(); + const createdBy = options.credentials.principal.userEntityRef; + const newTodo = { + title, + id, + createdBy, + createdAt: new Date().toISOString(), + }; + + storedTodos.push(newTodo); + + // TEMPLATE NOTE: + // The second argument of the logger methods can be used to pass structured metadata + logger.info('Created new todo item', { id, title, createdBy }); + + return newTodo; + }, + + async listTodos() { + return { items: Array.from(storedTodos) }; + }, + + async getTodo(request: { id: string }) { + const todo = storedTodos.find(item => item.id === request.id); + if (!todo) { + throw new NotFoundError(`No todo found with id '${request.id}'`); + } + return todo; + }, + }; +} diff --git a/plugins/modern-backend/src/services/TodoListService/index.ts b/plugins/modern-backend/src/services/TodoListService/index.ts new file mode 100644 index 0000000000..8f2547209b --- /dev/null +++ b/plugins/modern-backend/src/services/TodoListService/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { createTodoListService } from './createTodoListService'; diff --git a/plugins/modern-backend/src/services/TodoListService/types.ts b/plugins/modern-backend/src/services/TodoListService/types.ts new file mode 100644 index 0000000000..07ff7cdc48 --- /dev/null +++ b/plugins/modern-backend/src/services/TodoListService/types.ts @@ -0,0 +1,43 @@ +/* + * Copyright 2024 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 { + BackstageCredentials, + BackstageUserPrincipal, +} from '@backstage/backend-plugin-api'; + +export interface TodoItem { + title: string; + id: string; + createdBy: string; + createdAt: string; +} + +export interface TodoListService { + createTodo( + input: { + title: string; + entityRef?: string; + }, + options: { + credentials: BackstageCredentials; + }, + ): Promise; + + listTodos(): Promise<{ items: TodoItem[] }>; + + getTodo(request: { id: string }): Promise; +} diff --git a/plugins/modern-backend/src/setupTests.ts b/plugins/modern-backend/src/setupTests.ts new file mode 100644 index 0000000000..b0f602d2d8 --- /dev/null +++ b/plugins/modern-backend/src/setupTests.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {}; From 029f9c1b4a9a60418e415d81e00437500425a649 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 11:55:06 +0000 Subject: [PATCH 109/268] fix(deps): update dependency @module-federation/enhanced to v0.6.10 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 172 +++++++++++++++++++++++++++--------------------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/yarn.lock b/yarn.lock index f8618cba94..59b73c9538 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11446,24 +11446,38 @@ __metadata: languageName: node linkType: hard -"@module-federation/bridge-react-webpack-plugin@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/bridge-react-webpack-plugin@npm:0.6.4" +"@module-federation/bridge-react-webpack-plugin@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/bridge-react-webpack-plugin@npm:0.6.10" dependencies: - "@module-federation/sdk": 0.6.4 + "@module-federation/sdk": 0.6.10 "@types/semver": 7.5.8 semver: 7.6.3 - checksum: aa5a8362501eb0f132cc9a730f6ae782f19df116a101737642460feeade3f2197f8e12adb10900568e7f02ba630ea4598e15438a8eabac8df7d4a04bc563142e + checksum: 842df6adee140b42e6bee2504668a8c392e219c534f3cfc68910cf4fd3d82f64640eda45e3e235c2936986f004b1cfeaf3304c4cf7235cec19863435bd45071a languageName: node linkType: hard -"@module-federation/dts-plugin@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/dts-plugin@npm:0.6.4" +"@module-federation/data-prefetch@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/data-prefetch@npm:0.6.10" dependencies: - "@module-federation/managers": 0.6.4 - "@module-federation/sdk": 0.6.4 - "@module-federation/third-party-dts-extractor": 0.6.4 + "@module-federation/runtime": 0.6.10 + "@module-federation/sdk": 0.6.10 + fs-extra: 9.1.0 + peerDependencies: + react: ">=16.9.0" + react-dom: ">=16.9.0" + checksum: bc8205385913f3cb4afa5988a9a506c2488ed265ecce4c94176ebfcec8d62edbccc3be5e1c45c6ad5c2b00ee90b7f8f87d02e3d67f194df2cab7eecaa0f1f4c7 + languageName: node + linkType: hard + +"@module-federation/dts-plugin@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/dts-plugin@npm:0.6.10" + dependencies: + "@module-federation/managers": 0.6.10 + "@module-federation/sdk": 0.6.10 + "@module-federation/third-party-dts-extractor": 0.6.10 adm-zip: ^0.5.10 ansi-colors: ^4.1.3 axios: ^1.7.4 @@ -11475,28 +11489,29 @@ __metadata: log4js: 6.9.1 node-schedule: 2.1.1 rambda: ^9.1.0 - ws: 8.17.1 + ws: 8.18.0 peerDependencies: typescript: ^4.9.0 || ^5.0.0 vue-tsc: ">=1.0.24" peerDependenciesMeta: vue-tsc: optional: true - checksum: 9c96301c256e88bab8c7188542927aa5ec20d2c4fcc0dfa896a6c582fb0450c1ec75ec6e7b63bd91cee1cb8e163c8a736d174f29db8ec5c401e8608d684ca94f + checksum: 75044e4f34a6c9b36dbe9365efd99317740dbec75a53ddffcf44376767aa4fa17af7864f370433eb20664f5b1d64db6d5b4096a7164f7a492aa0a06c6398d4dd languageName: node linkType: hard "@module-federation/enhanced@npm:^0.6.0": - version: 0.6.4 - resolution: "@module-federation/enhanced@npm:0.6.4" + version: 0.6.10 + resolution: "@module-federation/enhanced@npm:0.6.10" dependencies: - "@module-federation/bridge-react-webpack-plugin": 0.6.4 - "@module-federation/dts-plugin": 0.6.4 - "@module-federation/managers": 0.6.4 - "@module-federation/manifest": 0.6.4 - "@module-federation/rspack": 0.6.4 - "@module-federation/runtime-tools": 0.6.4 - "@module-federation/sdk": 0.6.4 + "@module-federation/bridge-react-webpack-plugin": 0.6.10 + "@module-federation/data-prefetch": 0.6.10 + "@module-federation/dts-plugin": 0.6.10 + "@module-federation/managers": 0.6.10 + "@module-federation/manifest": 0.6.10 + "@module-federation/rspack": 0.6.10 + "@module-federation/runtime-tools": 0.6.10 + "@module-federation/sdk": 0.6.10 btoa: ^1.2.1 upath: 2.0.1 peerDependencies: @@ -11510,44 +11525,44 @@ __metadata: optional: true webpack: optional: true - checksum: 457787b3a6bfddace6c2aa9555eecad830118b1a5b9165007935f8103fb40ca3e2fc9982b22142c323aba79c71d2d62d9b267f17f70fbaef80a22ed7753b23d1 + checksum: 0134678862d825ba74cb90283fbf8567d7c1804a30a18e93ab4def384aeba2d5cc946b8353788e898c2283f9d5788ce5a869383732b6e41e11686798d957b70f languageName: node linkType: hard -"@module-federation/managers@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/managers@npm:0.6.4" +"@module-federation/managers@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/managers@npm:0.6.10" dependencies: - "@module-federation/sdk": 0.6.4 + "@module-federation/sdk": 0.6.10 find-pkg: 2.0.0 fs-extra: 9.1.0 - checksum: b1d56910d0370093112af4117c7a868912b327d39cf61180c5373f5e4b3e0efb81759688758b1dfc0e0ee37ab9c2b408f5b88d6bb5af9cde3654ad17d7d8333e + checksum: a9109e7ad38c4db1c3b57662839621385310695c68b651ed7f24b5db4d469e7a8910daf9da5e585f883def1760d16bf89e9b8dfed7ae77240ae3bb92d49014ba languageName: node linkType: hard -"@module-federation/manifest@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/manifest@npm:0.6.4" +"@module-federation/manifest@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/manifest@npm:0.6.10" dependencies: - "@module-federation/dts-plugin": 0.6.4 - "@module-federation/managers": 0.6.4 - "@module-federation/sdk": 0.6.4 + "@module-federation/dts-plugin": 0.6.10 + "@module-federation/managers": 0.6.10 + "@module-federation/sdk": 0.6.10 chalk: 3.0.0 find-pkg: 2.0.0 - checksum: 4ea5e6372af3f5110e0c13120a71b7721f2bf7d2b01efa4bb67acf665bc09517bd8c87e07c0a759a1a17ed0569d273ff0fb585dd67c99c848d3e355d57def832 + checksum: 6df8448709bf8f34ebdf0ffb363898ee8b2175b43f1a06b63822ccc40113904499114022a93742354dad10a2f4a4316687400ff6235e30aa04e6bef57e1d3d63 languageName: node linkType: hard -"@module-federation/rspack@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/rspack@npm:0.6.4" +"@module-federation/rspack@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/rspack@npm:0.6.10" dependencies: - "@module-federation/bridge-react-webpack-plugin": 0.6.4 - "@module-federation/dts-plugin": 0.6.4 - "@module-federation/managers": 0.6.4 - "@module-federation/manifest": 0.6.4 - "@module-federation/runtime-tools": 0.6.4 - "@module-federation/sdk": 0.6.4 + "@module-federation/bridge-react-webpack-plugin": 0.6.10 + "@module-federation/dts-plugin": 0.6.10 + "@module-federation/managers": 0.6.10 + "@module-federation/manifest": 0.6.10 + "@module-federation/runtime-tools": 0.6.10 + "@module-federation/sdk": 0.6.10 peerDependencies: typescript: ^4.9.0 || ^5.0.0 vue-tsc: ">=1.0.24" @@ -11556,7 +11571,7 @@ __metadata: optional: true vue-tsc: optional: true - checksum: c5797728ebdffdf340348d5616d8f0aed0e24cc82cbaaa5b9795afb303c3ebf83219336f77c58a4b79caeff9d753c3a5c403d18863239f67d8c0715899abdada + checksum: ad1652d31e2f6286148c5869ee1cbf91a028d8de22c9751b7be55601e5a40fe8fa623ee80e258591df8363ad20069dd9f18d55ed5037873d11a2c79dcc15d713 languageName: node linkType: hard @@ -11570,13 +11585,13 @@ __metadata: languageName: node linkType: hard -"@module-federation/runtime-tools@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/runtime-tools@npm:0.6.4" +"@module-federation/runtime-tools@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/runtime-tools@npm:0.6.10" dependencies: - "@module-federation/runtime": 0.6.4 - "@module-federation/webpack-bundler-runtime": 0.6.4 - checksum: 836f28a2a7f0a2cc349d0bf2d08e6f1bee330d8bb10afeab771ea3dbdc193b621c8411085a88bf6032fa86c7286ac3607caeb6f4d4ad29bba9fc21600e64fb42 + "@module-federation/runtime": 0.6.10 + "@module-federation/webpack-bundler-runtime": 0.6.10 + checksum: 427ae776554a04f43a9efab15e6f3a941878631fbb2e4b1fad9a26bf067d81463b0dbcb6650dc1891917b410d36f0af2f75b9b46f6138ba3a41b04f96b2fe6d6 languageName: node linkType: hard @@ -11589,12 +11604,12 @@ __metadata: languageName: node linkType: hard -"@module-federation/runtime@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/runtime@npm:0.6.4" +"@module-federation/runtime@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/runtime@npm:0.6.10" dependencies: - "@module-federation/sdk": 0.6.4 - checksum: 93c74937fded491d249c5a462ecb856e37ead07e11b74dffff871ccde5a819ca7ce5c2df64160d59baaa0eebde9c0a3976a1347a41106fdb29644d8a2dee4f6b + "@module-federation/sdk": 0.6.10 + checksum: 73890537d47982c0bf5156dffd25b7314b734b1ae062d7e07a60887424686f5eb8e664f7ae9ff3567ae11797d48311dae74d8f5ef38b5ae3893947b3dbe67075 languageName: node linkType: hard @@ -11605,21 +11620,21 @@ __metadata: languageName: node linkType: hard -"@module-federation/sdk@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/sdk@npm:0.6.4" - checksum: 37ef2c2b794b8705b7d9b9da66adad95874987c5404b8d22baa617eabb29b8061e586879ada62b3e7207898dde1528897c3196c1f0c2bbf7526076ca6fa61672 +"@module-federation/sdk@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/sdk@npm:0.6.10" + checksum: 452841ed7d2110e37eebaced8c30635859ebada69ba977dc8a955bf8589ce45f8a6a170ba35e98265801b82bdefc2a115faa2ad73ec148fc0fa210e8301beeed languageName: node linkType: hard -"@module-federation/third-party-dts-extractor@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/third-party-dts-extractor@npm:0.6.4" +"@module-federation/third-party-dts-extractor@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/third-party-dts-extractor@npm:0.6.10" dependencies: find-pkg: 2.0.0 fs-extra: 9.1.0 resolve: 1.22.8 - checksum: de4126122643840528a584367808f51771d1554e0d4ae55040cd1976d9e9e28bcd80eade5a72b736f35af5ae458955c3c0d0fd46dcca6c478a4c4a589da801fe + checksum: 206d58e14dc781d78e90221dcab36b3234e8281b3e4f2a6a8b3b491199b629c06d8990e6ad1ac42752324f9025478b0f7d6f9b41fb289a0da2e515b36bcbbdcc languageName: node linkType: hard @@ -11633,13 +11648,13 @@ __metadata: languageName: node linkType: hard -"@module-federation/webpack-bundler-runtime@npm:0.6.4": - version: 0.6.4 - resolution: "@module-federation/webpack-bundler-runtime@npm:0.6.4" +"@module-federation/webpack-bundler-runtime@npm:0.6.10": + version: 0.6.10 + resolution: "@module-federation/webpack-bundler-runtime@npm:0.6.10" dependencies: - "@module-federation/runtime": 0.6.4 - "@module-federation/sdk": 0.6.4 - checksum: b701873384c00ee2af8cb58ff46714b1686e664c9416566865edd21d868a7a8c1c1325d23da917a67c9847244f7570777ab000b357ecc61e643965e32a5db04a + "@module-federation/runtime": 0.6.10 + "@module-federation/sdk": 0.6.10 + checksum: d30ce2452627886ec26c2cf921ebf4ae6d5b2ebf9f62f00fb05fcb58e7ce55e9592f110e5fe5e1f2b822537da9945d380933bfa11ad874931480bcf8245ed71a languageName: node linkType: hard @@ -45215,7 +45230,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:*, ws@npm:^8.11.0, ws@npm:^8.12.0, ws@npm:^8.13.0, ws@npm:^8.16.0, ws@npm:^8.17.1, ws@npm:^8.18.0, ws@npm:^8.8.0": +"ws@npm:*, ws@npm:8.18.0, ws@npm:^8.11.0, ws@npm:^8.12.0, ws@npm:^8.13.0, ws@npm:^8.16.0, ws@npm:^8.17.1, ws@npm:^8.18.0, ws@npm:^8.8.0": version: 8.18.0 resolution: "ws@npm:8.18.0" peerDependencies: @@ -45230,21 +45245,6 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.17.1": - version: 8.17.1 - resolution: "ws@npm:8.17.1" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 442badcce1f1178ec87a0b5372ae2e9771e07c4929a3180321901f226127f252441e8689d765aa5cfba5f50ac60dd830954afc5aeae81609aefa11d3ddf5cecf - languageName: node - linkType: hard - "ws@npm:^7, ws@npm:^7.4.6, ws@npm:^7.5.5": version: 7.5.10 resolution: "ws@npm:7.5.10" From 264058c1f01fbc3caf113a5b51f721f2c32e1619 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 18:49:48 +0200 Subject: [PATCH 110/268] cli: no longer default test to watch mode when since flag is provided Signed-off-by: Patrik Oldsberg --- .changeset/beige-ghosts-enjoy.md | 5 +++++ packages/cli/src/commands/repo/test.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/beige-ghosts-enjoy.md diff --git a/.changeset/beige-ghosts-enjoy.md b/.changeset/beige-ghosts-enjoy.md new file mode 100644 index 0000000000..49ae916939 --- /dev/null +++ b/.changeset/beige-ghosts-enjoy.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': minor +--- + +The `repo test` command will no longer default to watch mode if the `--since` flag is provided. diff --git a/packages/cli/src/commands/repo/test.ts b/packages/cli/src/commands/repo/test.ts index c55969d696..c2a31c1129 100644 --- a/packages/cli/src/commands/repo/test.ts +++ b/packages/cli/src/commands/repo/test.ts @@ -172,7 +172,11 @@ export async function command(opts: OptionValues, cmd: Command): Promise { } // Run in watch mode unless in CI, coverage mode, or running all tests - if (!process.env.CI && !hasFlags('--coverage', '--watch', '--watchAll')) { + if ( + !opts.since && + !process.env.CI && + !hasFlags('--coverage', '--watch', '--watchAll') + ) { const isGitRepo = () => runCheck('git', 'rev-parse', '--is-inside-work-tree'); const isMercurialRepo = () => runCheck('hg', '--cwd', '.', 'root'); From 40c3ae6cfe6758ea35de731c56f1d685315d97b8 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 18:50:34 +0200 Subject: [PATCH 111/268] cli: no longer notify test cache hit when not included in since Signed-off-by: Patrik Oldsberg --- packages/cli/src/commands/repo/test.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/commands/repo/test.ts b/packages/cli/src/commands/repo/test.ts index c2a31c1129..87f8e004b0 100644 --- a/packages/cli/src/commands/repo/test.ts +++ b/packages/cli/src/commands/repo/test.ts @@ -221,6 +221,7 @@ export async function command(opts: OptionValues, cmd: Command): Promise { return packageGraph; } + let selectedProjects: string[] | undefined = undefined; if (opts.since && !hasFlags('--selectProjects')) { const graph = await getPackageGraph(); const changedPackages = await graph.listChangedPackages({ @@ -228,19 +229,20 @@ export async function command(opts: OptionValues, cmd: Command): Promise { analyzeLockfile: true, }); - const packageNames = Array.from( + selectedProjects = Array.from( graph.collectPackageNames( changedPackages.map(pkg => pkg.name), pkg => pkg.allLocalDependents.keys(), ), ); - if (packageNames.length === 0) { + if (selectedProjects.length === 0) { console.log(`No packages changed since ${opts.since}`); return; } - args.push('--selectProjects', ...packageNames); + selectedProjects = selectedProjects.filter(pkg => pkg.includes('app')); + args.push('--selectProjects', ...selectedProjects); } // This is the only thing that is not implemented by jest.run(), so we do it here instead @@ -350,7 +352,9 @@ export async function command(opts: OptionValues, cmd: Command): Promise { projectHashes.set(packageName, sha); if (cache?.includes(sha)) { - console.log(`Skipped ${packageName} due to cache hit`); + if (!selectedProjects || selectedProjects.includes(packageName)) { + console.log(`Skipped ${packageName} due to cache hit`); + } outputSuccessCache.push(sha); return undefined; } From 95999c5e2c09f7a045f938116b8ac8b241b372ea Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 11:36:53 +0200 Subject: [PATCH 112/268] cli: update backend plugin template Signed-off-by: Patrik Oldsberg --- .changeset/mighty-terms-peel.md | 5 + .../default-backend-plugin/dev/index.ts | 9 -- .../default-backend-plugin/dev/index.ts.hbs | 60 ++++++++++++ .../default-backend-plugin/package.json.hbs | 10 +- .../default-backend-plugin/src/index.ts.hbs | 1 - .../src/plugin.test.ts.hbs | 85 ++++++++++++++++ .../default-backend-plugin/src/plugin.ts.hbs | 30 +++--- .../default-backend-plugin/src/router.test.ts | 67 +++++++++++++ .../default-backend-plugin/src/router.ts | 51 ++++++++++ .../src/service/router.test.ts | 30 ------ .../src/service/router.ts | 28 ------ .../TodoListService/createTodoListService.ts | 98 +++++++++++++++++++ .../src/services/TodoListService/index.ts | 1 + .../src/services/TodoListService/types.ts | 27 +++++ 14 files changed, 415 insertions(+), 87 deletions(-) create mode 100644 .changeset/mighty-terms-peel.md delete mode 100644 packages/cli/templates/default-backend-plugin/dev/index.ts create mode 100644 packages/cli/templates/default-backend-plugin/dev/index.ts.hbs create mode 100644 packages/cli/templates/default-backend-plugin/src/plugin.test.ts.hbs create mode 100644 packages/cli/templates/default-backend-plugin/src/router.test.ts create mode 100644 packages/cli/templates/default-backend-plugin/src/router.ts delete mode 100644 packages/cli/templates/default-backend-plugin/src/service/router.test.ts delete mode 100644 packages/cli/templates/default-backend-plugin/src/service/router.ts create mode 100644 packages/cli/templates/default-backend-plugin/src/services/TodoListService/createTodoListService.ts create mode 100644 packages/cli/templates/default-backend-plugin/src/services/TodoListService/index.ts create mode 100644 packages/cli/templates/default-backend-plugin/src/services/TodoListService/types.ts diff --git a/.changeset/mighty-terms-peel.md b/.changeset/mighty-terms-peel.md new file mode 100644 index 0000000000..8804ee4556 --- /dev/null +++ b/.changeset/mighty-terms-peel.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +The backend plugin template for the `new` command has been updated to provide more guidance and use a more modern structure. diff --git a/packages/cli/templates/default-backend-plugin/dev/index.ts b/packages/cli/templates/default-backend-plugin/dev/index.ts deleted file mode 100644 index 9d74c82508..0000000000 --- a/packages/cli/templates/default-backend-plugin/dev/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { createBackend } from '@backstage/backend-defaults'; - -const backend = createBackend(); - -backend.add(import('@backstage/plugin-auth-backend')); -backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); -backend.add(import('../src')); - -backend.start(); diff --git a/packages/cli/templates/default-backend-plugin/dev/index.ts.hbs b/packages/cli/templates/default-backend-plugin/dev/index.ts.hbs new file mode 100644 index 0000000000..07dc091083 --- /dev/null +++ b/packages/cli/templates/default-backend-plugin/dev/index.ts.hbs @@ -0,0 +1,60 @@ +import { createBackend } from '@backstage/backend-defaults'; +import { mockServices } from '@backstage/backend-test-utils'; +import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; + +// TEMPLATE NOTE: +// This is the development setup for your plugin that wires up a +// minimal backend that can use both real and mocked plugins and services. +// +// Start up the backend by running `yarn start` in the package directory. +// It's it's up and running, try out the following requests: +// +// Create a new todo item, standalone or for the sample component: +// +// curl http://localhost:7007/api/{{id}}/todos -H 'Content-Type: application/json' -d '{"title": "My Todo"}' +// curl http://localhost:7007/api/{{id}}/todos -H 'Content-Type: application/json' -d '{"title": "My Todo", "entityRef": "component:default/sample"}' +// +// List TODOs: +// +// curl http://localhost:7007/api/{{id}}/todos +// +// Explicitly make an unauthenticated request, or with service auth: +// +// curl http://localhost:7007/api/{{id}}/todos -H 'Authorization: Bearer mock-none-token' +// curl http://localhost:7007/api/{{id}}/todos -H 'Authorization: Bearer mock-service-token' + +const backend = createBackend(); + +// TEMPLATE NOTE: +// Mocking the auth and httpAuth service allows you to call your plugin API without +// having to authenticate. +// +// If you want to use real auth, you can install the following instead: +// backend.add(import('@backstage/plugin-auth-backend')); +// backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); +backend.add(mockServices.auth.factory()); +backend.add(mockServices.httpAuth.factory()); + +// TEMPLATE NOTE: +// Rather than using a real catalog you can use a mock with a fixed set of entities. +backend.add( + catalogServiceMock.factory({ + entities: [ + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Component', + metadata: { + name: 'sample', + title: 'Sample Component', + }, + spec: { + type: 'service', + }, + }, + ], + }), +); + +backend.add(import('../src')); + +backend.start(); diff --git a/packages/cli/templates/default-backend-plugin/package.json.hbs b/packages/cli/templates/default-backend-plugin/package.json.hbs index 6c25562c21..2f7c0931d8 100644 --- a/packages/cli/templates/default-backend-plugin/package.json.hbs +++ b/packages/cli/templates/default-backend-plugin/package.json.hbs @@ -30,19 +30,19 @@ "dependencies": { "@backstage/backend-defaults": "{{versionQuery '@backstage/backend-defaults'}}", "@backstage/backend-plugin-api": "{{versionQuery '@backstage/backend-plugin-api'}}", + "@backstage/catalog-client": "{{versionQuery '@backstage/catalog-client'}}", + "@backstage/errors": "{{versionQuery '@backstage/errors'}}", + "@backstage/plugin-catalog-node": "{{versionQuery '@backstage/plugin-catalog-node'}}", "express": "{{versionQuery 'express' '4.17.1'}}", "express-promise-router": "{{versionQuery 'express-promise-router' '4.1.0'}}", - "node-fetch": "{{versionQuery 'node-fetch' '2.6.7'}}" + "zod": "{{versionQuery 'zod' '3.22.4'}}" }, "devDependencies": { "@backstage/backend-test-utils": "{{versionQuery '@backstage/backend-test-utils'}}", "@backstage/cli": "{{versionQuery '@backstage/cli'}}", - "@backstage/plugin-auth-backend": "{{versionQuery '@backstage/plugin-auth-backend'}}", - "@backstage/plugin-auth-backend-module-guest-provider": "{{versionQuery '@backstage/plugin-auth-backend-module-guest-provider'}}", "@types/express": "{{versionQuery '@types/express' '4.17.6'}}", "@types/supertest": "{{versionQuery '@types/supertest' '2.0.12'}}", - "supertest": "{{versionQuery 'supertest' '6.2.4'}}", - "msw": "{{versionQuery 'msw' '2.3.1'}}" + "supertest": "{{versionQuery 'supertest' '6.2.4'}}" }, "files": [ "dist" diff --git a/packages/cli/templates/default-backend-plugin/src/index.ts.hbs b/packages/cli/templates/default-backend-plugin/src/index.ts.hbs index c04b266c28..be7f39c997 100644 --- a/packages/cli/templates/default-backend-plugin/src/index.ts.hbs +++ b/packages/cli/templates/default-backend-plugin/src/index.ts.hbs @@ -1,2 +1 @@ -export * from './service/router'; export { {{pluginVar}} as default } from './plugin'; diff --git a/packages/cli/templates/default-backend-plugin/src/plugin.test.ts.hbs b/packages/cli/templates/default-backend-plugin/src/plugin.test.ts.hbs new file mode 100644 index 0000000000..cd4b9fc438 --- /dev/null +++ b/packages/cli/templates/default-backend-plugin/src/plugin.test.ts.hbs @@ -0,0 +1,85 @@ +import { + mockCredentials, + startTestBackend, +} from '@backstage/backend-test-utils'; +import { {{pluginVar}} } from './plugin'; +import request from 'supertest'; +import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; + +// TEMPLATE NOTE: +// Plugin tests are integration tests for your plugin, ensuring that all pieces +// work together end-to-end. You can still mock injected backend services +// however, just like anyway that installs your plugin might replace the +// services with their own implementations. +describe('plugin', () => { + it('should create and read TODO items', async () => { + const { server } = await startTestBackend({ + features: [{{pluginVar}}], + }); + + await request(server).get('/api/{{id}}/todos').expect(200, { + items: [], + }); + + const createRes = await request(server) + .post('/api/{{id}}/todos') + .send({ title: 'My Todo' }); + + expect(createRes.status).toBe(201); + expect(createRes.body).toEqual({ + id: expect.any(String), + title: 'My Todo', + createdBy: mockCredentials.user().principal.userEntityRef, + createdAt: expect.any(String), + }); + + const createdTodoItem = createRes.body; + + await request(server) + .get('/api/{{id}}/todos') + .expect(200, { + items: [createdTodoItem], + }); + + await request(server) + .get(`/api/{{id}}/todos/${createdTodoItem.id}`) + .expect(200, createdTodoItem); + }); + + it('should create TODO item with catalog information', async () => { + const { server } = await startTestBackend({ + features: [ + {{pluginVar}}, + catalogServiceMock.factory({ + entities: [ + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Component', + metadata: { + name: 'my-component', + namespace: 'default', + title: 'My Component', + }, + spec: { + type: 'service', + owner: 'me', + }, + }, + ], + }), + ], + }); + + const createRes = await request(server) + .post('/api/{{id}}/todos') + .send({ title: 'My Todo', entityRef: 'component:default/my-component' }); + + expect(createRes.status).toBe(201); + expect(createRes.body).toEqual({ + id: expect.any(String), + title: '[My Component] My Todo', + createdBy: mockCredentials.user().principal.userEntityRef, + createdAt: expect.any(String), + }); + }); +}); diff --git a/packages/cli/templates/default-backend-plugin/src/plugin.ts.hbs b/packages/cli/templates/default-backend-plugin/src/plugin.ts.hbs index bf04b43afe..a9cccc2af2 100644 --- a/packages/cli/templates/default-backend-plugin/src/plugin.ts.hbs +++ b/packages/cli/templates/default-backend-plugin/src/plugin.ts.hbs @@ -2,7 +2,9 @@ import { coreServices, createBackendPlugin, } from '@backstage/backend-plugin-api'; -import { createRouter } from './service/router'; +import { createRouter } from './router'; +import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; +import { createTodoListService } from './services/TodoListService'; /** * {{pluginVar}} backend plugin @@ -14,25 +16,25 @@ export const {{pluginVar}} = createBackendPlugin({ register(env) { env.registerInit({ deps: { - httpRouter: coreServices.httpRouter, logger: coreServices.logger, - config: coreServices.rootConfig, + auth: coreServices.auth, + httpAuth: coreServices.httpAuth, + httpRouter: coreServices.httpRouter, + catalog: catalogServiceRef, }, - async init({ - httpRouter, - logger, - config, - }) { + async init({ logger, auth, httpAuth, httpRouter, catalog }) { + const todoListService = await createTodoListService({ + logger, + auth, + catalog, + }); + httpRouter.use( await createRouter({ - logger, - config, + httpAuth, + todoListService, }), ); - httpRouter.addAuthPolicy({ - path: '/health', - allow: 'unauthenticated', - }); }, }); }, diff --git a/packages/cli/templates/default-backend-plugin/src/router.test.ts b/packages/cli/templates/default-backend-plugin/src/router.test.ts new file mode 100644 index 0000000000..86c91aab8e --- /dev/null +++ b/packages/cli/templates/default-backend-plugin/src/router.test.ts @@ -0,0 +1,67 @@ +import { + mockCredentials, + mockErrorHandler, + mockServices, +} from '@backstage/backend-test-utils'; +import express from 'express'; +import request from 'supertest'; + +import { createRouter } from './router'; +import { TodoListService } from './services/TodoListService/types'; + +const mockTodoItem = { + title: 'Do the thing', + id: '123', + createdBy: mockCredentials.user().principal.userEntityRef, + createdAt: new Date().toISOString(), +}; + +// TEMPLATE NOTE: +// Testing the router directly allows you to write a unit test that mocks the provided options. +describe('createRouter', () => { + let app: express.Express; + let todoListService: jest.Mocked; + + beforeEach(async () => { + todoListService = { + createTodo: jest.fn(), + listTodos: jest.fn(), + getTodo: jest.fn(), + }; + const router = await createRouter({ + httpAuth: mockServices.httpAuth(), + todoListService, + }); + app = express(); + app.use(router); + app.use(mockErrorHandler()); + }); + + it('should create a TODO', async () => { + todoListService.createTodo.mockResolvedValue(mockTodoItem); + + const response = await request(app).post('/todos').send({ + title: 'Do the thing', + }); + + expect(response.status).toBe(201); + expect(response.body).toEqual(mockTodoItem); + }); + + it('should not allow unauthenticated requests to create a TODO', async () => { + todoListService.createTodo.mockResolvedValue(mockTodoItem); + + // TEMPLATE NOTE: + // The HttpAuth mock service considers all requests to be authenticated as a + // mock user by default. In order to test other cases we need to explicitly + // pass an authorization header with mock credentials. + const response = await request(app) + .post('/todos') + .set('Authorization', mockCredentials.none.header()) + .send({ + title: 'Do the thing', + }); + + expect(response.status).toBe(401); + }); +}); diff --git a/packages/cli/templates/default-backend-plugin/src/router.ts b/packages/cli/templates/default-backend-plugin/src/router.ts new file mode 100644 index 0000000000..4c2ca49b67 --- /dev/null +++ b/packages/cli/templates/default-backend-plugin/src/router.ts @@ -0,0 +1,51 @@ +import { HttpAuthService } from '@backstage/backend-plugin-api'; +import { InputError } from '@backstage/errors'; +import { z } from 'zod'; +import express from 'express'; +import Router from 'express-promise-router'; +import { TodoListService } from './services/TodoListService/types'; + +export async function createRouter({ + httpAuth, + todoListService, +}: { + httpAuth: HttpAuthService; + todoListService: TodoListService; +}): Promise { + const router = Router(); + router.use(express.json()); + + // TEMPLATE NOTE: + // Zod is a powerful library for data validation and recommended in particular + // for user-defined schemas. In this case we use it for input validation too. + // + // If you want to define a schema for your API we recommend using Backstage's + // OpenAPI tooling: https://backstage.io/docs/next/openapi/01-getting-started + const todoSchema = z.object({ + title: z.string(), + entityRef: z.string().optional(), + }); + + router.post('/todos', async (req, res) => { + const parsed = todoSchema.safeParse(req.body); + if (!parsed.success) { + throw new InputError(parsed.error.toString()); + } + + const result = await todoListService.createTodo(parsed.data, { + credentials: await httpAuth.credentials(req, { allow: ['user'] }), + }); + + res.status(201).json(result); + }); + + router.get('/todos', async (_req, res) => { + res.json(await todoListService.listTodos()); + }); + + router.get('/todos/:id', async (req, res) => { + res.json(await todoListService.getTodo({ id: req.params.id })); + }); + + return router; +} diff --git a/packages/cli/templates/default-backend-plugin/src/service/router.test.ts b/packages/cli/templates/default-backend-plugin/src/service/router.test.ts deleted file mode 100644 index ed19d50d2b..0000000000 --- a/packages/cli/templates/default-backend-plugin/src/service/router.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { mockServices } from '@backstage/backend-test-utils'; -import express from 'express'; -import request from 'supertest'; - -import { createRouter } from './router'; - -describe('createRouter', () => { - let app: express.Express; - - beforeAll(async () => { - const router = await createRouter({ - logger: mockServices.logger.mock(), - config: mockServices.rootConfig(), - }); - app = express().use(router); - }); - - beforeEach(() => { - jest.resetAllMocks(); - }); - - describe('GET /health', () => { - it('returns ok', async () => { - const response = await request(app).get('/health'); - - expect(response.status).toEqual(200); - expect(response.body).toEqual({ status: 'ok' }); - }); - }); -}); diff --git a/packages/cli/templates/default-backend-plugin/src/service/router.ts b/packages/cli/templates/default-backend-plugin/src/service/router.ts deleted file mode 100644 index ced654aa82..0000000000 --- a/packages/cli/templates/default-backend-plugin/src/service/router.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { MiddlewareFactory } from '@backstage/backend-defaults/rootHttpRouter'; -import { LoggerService, RootConfigService } from '@backstage/backend-plugin-api'; -import express from 'express'; -import Router from 'express-promise-router'; - -export interface RouterOptions { - logger: LoggerService; - config: RootConfigService; -} - -export async function createRouter( - options: RouterOptions, -): Promise { - const { logger, config } = options; - - const router = Router(); - router.use(express.json()); - - router.get('/health', (_, response) => { - logger.info('PONG!'); - response.json({ status: 'ok' }); - }); - - const middleware = MiddlewareFactory.create({ logger, config }); - - router.use(middleware.error()); - return router; -} diff --git a/packages/cli/templates/default-backend-plugin/src/services/TodoListService/createTodoListService.ts b/packages/cli/templates/default-backend-plugin/src/services/TodoListService/createTodoListService.ts new file mode 100644 index 0000000000..90f6ad8d9e --- /dev/null +++ b/packages/cli/templates/default-backend-plugin/src/services/TodoListService/createTodoListService.ts @@ -0,0 +1,98 @@ +import { AuthService, LoggerService } from '@backstage/backend-plugin-api'; +import { NotFoundError } from '@backstage/errors'; +import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; +import crypto from 'node:crypto'; +import { TodoItem, TodoListService } from './types'; + +// TEMPLATE NOTE: +// This is a simple in-memory todo list store. It is recommended to use a +// database to store data in a real application. See the database service +// documentation for more information on how to do this: +// https://backstage.io/docs/backend-system/core-services/database +export async function createTodoListService({ + auth, + logger, + catalog, +}: { + auth: AuthService; + logger: LoggerService; + catalog: typeof catalogServiceRef.T; +}): Promise { + logger.info('Initializing TodoListService'); + + const storedTodos = new Array(); + + return { + async createTodo(input, options) { + let title = input.title; + + // TEMPLATE NOTE: + // A common pattern for Backstage plugins is to pass an entity reference + // from the frontend to then fetch the entire entity from the catalog in the + // backend plugin. + if (input.entityRef) { + // TEMPLATE NOTE: + // Cross-plugin communication uses service-to-service authentication. The + // `AuthService` lets you generate a token that is valid for communication + // with the target plugin only. You must also provide credentials for the + // identity that you are making the request on behalf of. + // + // If you want to make a request using the plugin backend's own identity, + // you can access it via the `auth.getOwnServiceCredentials()` method. + // Beware that this bypasses any user permission checks. + const { token } = await auth.getPluginRequestToken({ + onBehalfOf: options.credentials, + targetPluginId: 'catalog', + }); + const entity = await catalog.getEntityByRef(input.entityRef, { + token, + }); + if (!entity) { + throw new NotFoundError( + `No entity found for ref '${input.entityRef}'`, + ); + } + + // TEMPLATE NOTE: + // Here you could read any form of data from the entity. A common use case + // is to read the value of a custom annotation for your plugin. You can + // read more about how to add custom annotations here: + // https://backstage.io/docs/features/software-catalog/extending-the-model#adding-a-new-annotation + // + // In this example we just use the entity title to decorate the todo item. + + const entityDisplay = entity.metadata.title ?? input.entityRef; + title = `[${entityDisplay}] ${input.title}`; + } + + const id = crypto.randomUUID(); + const createdBy = options.credentials.principal.userEntityRef; + const newTodo = { + title, + id, + createdBy, + createdAt: new Date().toISOString(), + }; + + storedTodos.push(newTodo); + + // TEMPLATE NOTE: + // The second argument of the logger methods can be used to pass structured metadata + logger.info('Created new todo item', { id, title, createdBy }); + + return newTodo; + }, + + async listTodos() { + return { items: Array.from(storedTodos) }; + }, + + async getTodo(request: { id: string }) { + const todo = storedTodos.find(item => item.id === request.id); + if (!todo) { + throw new NotFoundError(`No todo found with id '${request.id}'`); + } + return todo; + }, + }; +} diff --git a/packages/cli/templates/default-backend-plugin/src/services/TodoListService/index.ts b/packages/cli/templates/default-backend-plugin/src/services/TodoListService/index.ts new file mode 100644 index 0000000000..1bc52001a8 --- /dev/null +++ b/packages/cli/templates/default-backend-plugin/src/services/TodoListService/index.ts @@ -0,0 +1 @@ +export { createTodoListService } from './createTodoListService'; diff --git a/packages/cli/templates/default-backend-plugin/src/services/TodoListService/types.ts b/packages/cli/templates/default-backend-plugin/src/services/TodoListService/types.ts new file mode 100644 index 0000000000..af895981a0 --- /dev/null +++ b/packages/cli/templates/default-backend-plugin/src/services/TodoListService/types.ts @@ -0,0 +1,27 @@ +import { + BackstageCredentials, + BackstageUserPrincipal, +} from '@backstage/backend-plugin-api'; + +export interface TodoItem { + title: string; + id: string; + createdBy: string; + createdAt: string; +} + +export interface TodoListService { + createTodo( + input: { + title: string; + entityRef?: string; + }, + options: { + credentials: BackstageCredentials; + }, + ): Promise; + + listTodos(): Promise<{ items: TodoItem[] }>; + + getTodo(request: { id: string }): Promise; +} From 26c719d4a37da1fa14011fb3171a419ff65edcf9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 11:44:39 +0200 Subject: [PATCH 113/268] cli: add missing templating package versions Signed-off-by: Patrik Oldsberg --- packages/cli/package.json | 6 +++ packages/cli/src/lib/version.ts | 6 +++ yarn.lock | 69 +++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/packages/cli/package.json b/packages/cli/package.json index 0ca580dd91..83d6623ed5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -163,11 +163,17 @@ "@backstage/backend-common": "^0.25.0", "@backstage/backend-plugin-api": "workspace:^", "@backstage/backend-test-utils": "workspace:^", + "@backstage/catalog-client": "workspace:^", "@backstage/config": "workspace:^", "@backstage/core-app-api": "workspace:^", "@backstage/core-components": "workspace:^", "@backstage/core-plugin-api": "workspace:^", "@backstage/dev-utils": "workspace:^", + "@backstage/errors": "workspace:^", + "@backstage/plugin-auth-backend": "workspace:^", + "@backstage/plugin-auth-backend-module-guest-provider": "workspace:^", + "@backstage/plugin-catalog-node": "workspace:^", + "@backstage/plugin-scaffolder-node": "workspace:^", "@backstage/test-utils": "workspace:^", "@backstage/theme": "workspace:^", "@types/cross-spawn": "^6.0.2", diff --git a/packages/cli/src/lib/version.ts b/packages/cli/src/lib/version.ts index b2b3ae23cf..fb4a7105c3 100644 --- a/packages/cli/src/lib/version.ts +++ b/packages/cli/src/lib/version.ts @@ -34,16 +34,19 @@ leaving any imports in place. */ import { version as backendPluginApi } from '../../../../packages/backend-plugin-api/package.json'; import { version as backendTestUtils } from '../../../../packages/backend-test-utils/package.json'; +import { version as catalogClient } from '../../../../packages/catalog-client/package.json'; import { version as cli } from '../../../../packages/cli/package.json'; import { version as config } from '../../../../packages/config/package.json'; import { version as coreAppApi } from '../../../../packages/core-app-api/package.json'; import { version as coreComponents } from '../../../../packages/core-components/package.json'; import { version as corePluginApi } from '../../../../packages/core-plugin-api/package.json'; import { version as devUtils } from '../../../../packages/dev-utils/package.json'; +import { version as errors } from '../../../../packages/errors/package.json'; import { version as testUtils } from '../../../../packages/test-utils/package.json'; import { version as scaffolderNode } from '../../../../plugins/scaffolder-node/package.json'; import { version as authBackend } from '../../../../plugins/auth-backend/package.json'; import { version as authBackendModuleGuestProvider } from '../../../../plugins/auth-backend-module-guest-provider/package.json'; +import { version as catalogNode } from '../../../../plugins/catalog-node/package.json'; import { version as theme } from '../../../../packages/theme/package.json'; import { version as backendDefaults } from '../../../../packages/backend-defaults/package.json'; @@ -51,18 +54,21 @@ export const packageVersions: Record = { '@backstage/backend-defaults': backendDefaults, '@backstage/backend-plugin-api': backendPluginApi, '@backstage/backend-test-utils': backendTestUtils, + '@backstage/catalog-client': catalogClient, '@backstage/cli': cli, '@backstage/config': config, '@backstage/core-app-api': coreAppApi, '@backstage/core-components': coreComponents, '@backstage/core-plugin-api': corePluginApi, '@backstage/dev-utils': devUtils, + '@backstage/errors': errors, '@backstage/test-utils': testUtils, '@backstage/theme': theme, '@backstage/plugin-scaffolder-node': scaffolderNode, '@backstage/plugin-auth-backend': authBackend, '@backstage/plugin-auth-backend-module-guest-provider': authBackendModuleGuestProvider, + '@backstage/plugin-catalog-node': catalogNode, }; export function findVersion() { diff --git a/yarn.lock b/yarn.lock index 75503208bb..47b9244770 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3913,6 +3913,7 @@ __metadata: "@backstage/backend-common": ^0.25.0 "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-test-utils": "workspace:^" + "@backstage/catalog-client": "workspace:^" "@backstage/catalog-model": "workspace:^" "@backstage/cli-common": "workspace:^" "@backstage/cli-node": "workspace:^" @@ -3925,6 +3926,10 @@ __metadata: "@backstage/errors": "workspace:^" "@backstage/eslint-plugin": "workspace:^" "@backstage/integration": "workspace:^" + "@backstage/plugin-auth-backend": "workspace:^" + "@backstage/plugin-auth-backend-module-guest-provider": "workspace:^" + "@backstage/plugin-catalog-node": "workspace:^" + "@backstage/plugin-scaffolder-node": "workspace:^" "@backstage/release-manifests": "workspace:^" "@backstage/test-utils": "workspace:^" "@backstage/theme": "workspace:^" @@ -6842,6 +6847,30 @@ __metadata: languageName: unknown linkType: soft +"@backstage/plugin-modern-backend@workspace:plugins/modern-backend": + version: 0.0.0-use.local + resolution: "@backstage/plugin-modern-backend@workspace:plugins/modern-backend" + dependencies: + "@backstage/backend-defaults": "workspace:^" + "@backstage/backend-plugin-api": "workspace:^" + "@backstage/backend-test-utils": "workspace:^" + "@backstage/catalog-client": "workspace:^" + "@backstage/cli": "workspace:^" + "@backstage/errors": "workspace:^" + "@backstage/plugin-auth-backend": "workspace:^" + "@backstage/plugin-auth-backend-module-guest-provider": "workspace:^" + "@backstage/plugin-catalog-node": "workspace:^" + "@types/express": "*" + "@types/supertest": ^2.0.8 + express: ^4.17.1 + express-promise-router: ^4.1.0 + msw: ^2.0.8 + node-fetch: ^2.6.7 + supertest: ^6.2.4 + zod: ^3.22.4 + languageName: unknown + linkType: soft + "@backstage/plugin-notifications-backend-module-email@workspace:plugins/notifications-backend-module-email": version: 0.0.0-use.local resolution: "@backstage/plugin-notifications-backend-module-email@workspace:plugins/notifications-backend-module-email" @@ -27934,6 +27963,18 @@ __metadata: languageName: node linkType: hard +"formidable@npm:^2.1.2": + version: 2.1.2 + resolution: "formidable@npm:2.1.2" + dependencies: + dezalgo: ^1.0.4 + hexoid: ^1.0.0 + once: ^1.4.0 + qs: ^6.11.0 + checksum: 81c8e5d89f5eb873e992893468f0de22c01678ca3d315db62be0560f9de1c77d4faefc9b1f4575098eb2263b3c81ba1024833a9fc3206297ddbac88a4f69b7a8 + languageName: node + linkType: hard + "formidable@npm:^3.5.1": version: 3.5.1 resolution: "formidable@npm:3.5.1" @@ -42036,6 +42077,24 @@ __metadata: languageName: node linkType: hard +"superagent@npm:^8.1.2": + version: 8.1.2 + resolution: "superagent@npm:8.1.2" + dependencies: + component-emitter: ^1.3.0 + cookiejar: ^2.1.4 + debug: ^4.3.4 + fast-safe-stringify: ^2.1.1 + form-data: ^4.0.0 + formidable: ^2.1.2 + methods: ^1.1.2 + mime: 2.6.0 + qs: ^6.11.0 + semver: ^7.3.8 + checksum: f3601c5ccae34d5ba684a03703394b5d25931f4ae2e1e31a1de809f88a9400e997ece037f9accf148a21c408f950dc829db1e4e23576a7f9fe0efa79fd5c9d2f + languageName: node + linkType: hard + "superagent@npm:^9.0.1": version: 9.0.2 resolution: "superagent@npm:9.0.2" @@ -42053,6 +42112,16 @@ __metadata: languageName: node linkType: hard +"supertest@npm:^6.2.4": + version: 6.3.4 + resolution: "supertest@npm:6.3.4" + dependencies: + methods: ^1.1.2 + superagent: ^8.1.2 + checksum: 875c6fa7940f21e5be9bb646579cdb030d4057bf2da643e125e1f0480add1200395d2b17e10b8e54e1009efc63e047422501e9eb30e12828668498c0910f295f + languageName: node + linkType: hard + "supertest@npm:^7.0.0": version: 7.0.0 resolution: "supertest@npm:7.0.0" From bb8bb7790e35adc3beaa8eede128a2f8e448c371 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 11:55:55 +0200 Subject: [PATCH 114/268] plugins: remove temporary modern-backend plugin Signed-off-by: Patrik Oldsberg --- plugins/modern-backend/.eslintrc.js | 1 - plugins/modern-backend/README.md | 14 --- plugins/modern-backend/catalog-info.yaml | 9 -- plugins/modern-backend/dev/index.ts | 74 ------------ plugins/modern-backend/package.json | 48 -------- plugins/modern-backend/src/index.ts | 17 --- plugins/modern-backend/src/plugin.test.ts | 101 ---------------- plugins/modern-backend/src/plugin.ts | 57 --------- plugins/modern-backend/src/router.test.ts | 83 ------------- plugins/modern-backend/src/router.ts | 67 ---------- .../TodoListService/createTodoListService.ts | 114 ------------------ .../src/services/TodoListService/index.ts | 17 --- .../src/services/TodoListService/types.ts | 43 ------- plugins/modern-backend/src/setupTests.ts | 17 --- yarn.lock | 64 ---------- 15 files changed, 726 deletions(-) delete mode 100644 plugins/modern-backend/.eslintrc.js delete mode 100644 plugins/modern-backend/README.md delete mode 100644 plugins/modern-backend/catalog-info.yaml delete mode 100644 plugins/modern-backend/dev/index.ts delete mode 100644 plugins/modern-backend/package.json delete mode 100644 plugins/modern-backend/src/index.ts delete mode 100644 plugins/modern-backend/src/plugin.test.ts delete mode 100644 plugins/modern-backend/src/plugin.ts delete mode 100644 plugins/modern-backend/src/router.test.ts delete mode 100644 plugins/modern-backend/src/router.ts delete mode 100644 plugins/modern-backend/src/services/TodoListService/createTodoListService.ts delete mode 100644 plugins/modern-backend/src/services/TodoListService/index.ts delete mode 100644 plugins/modern-backend/src/services/TodoListService/types.ts delete mode 100644 plugins/modern-backend/src/setupTests.ts diff --git a/plugins/modern-backend/.eslintrc.js b/plugins/modern-backend/.eslintrc.js deleted file mode 100644 index e2a53a6ad2..0000000000 --- a/plugins/modern-backend/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/modern-backend/README.md b/plugins/modern-backend/README.md deleted file mode 100644 index 929b0a189f..0000000000 --- a/plugins/modern-backend/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# modern - -Welcome to the modern backend plugin! - -_This plugin was created through the Backstage CLI_ - -## Getting started - -Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn -start` in the root directory, and then navigating to [/modern/health](http://localhost:7007/api/modern/health). - -You can also serve the plugin in isolation by running `yarn start` in the plugin directory. -This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. -It is only meant for local development, and the setup for it can be found inside the [/dev](./dev) directory. diff --git a/plugins/modern-backend/catalog-info.yaml b/plugins/modern-backend/catalog-info.yaml deleted file mode 100644 index fd4b9dc0ba..0000000000 --- a/plugins/modern-backend/catalog-info.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: backstage.io/v1alpha1 -kind: Component -metadata: - name: backstage-plugin-modern-backend - title: '@backstage/plugin-modern-backend' -spec: - lifecycle: experimental - type: backstage-backend-plugin - owner: maintainers diff --git a/plugins/modern-backend/dev/index.ts b/plugins/modern-backend/dev/index.ts deleted file mode 100644 index 393f979bed..0000000000 --- a/plugins/modern-backend/dev/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2024 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 { createBackend } from '@backstage/backend-defaults'; -import { mockServices } from '@backstage/backend-test-utils'; -import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; - -// TEMPLATE NOTE: -// This is the development setup for your plugin that wires up a -// minimal backend that can use both real and mocked plugins and services. -// -// Start up the backend by running `yarn start` in the package directory. -// It's it's up and running, try out the following requests: -// -// Create a new todo item: -// -// curl http://localhost:7007/api/modern/todos -H 'Content-Type: application/json' -d '{"title": "My Todo"}' -// -// List TODOs: -// -// curl http://localhost:7007/api/modern/todos -// -// Explicitly make an unauthenticated request, or with service auth: -// -// curl http://localhost:7007/api/modern/todos -H 'Authorization: Bearer mock-none-token' -// curl http://localhost:7007/api/modern/todos -H 'Authorization: Bearer mock-service-token' - -const backend = createBackend(); - -// TEMPLATE NOTE: -// Mocking the auth and httpAuth service allows you to call your plugin API without -// having to authenticate. -// -// If you want to use real auth, you can install the following instead: -// backend.add(import('@backstage/plugin-auth-backend')); -// backend.add(import('@backstage/plugin-auth-backend-module-guest-provider')); -backend.add(mockServices.auth.factory()); -backend.add(mockServices.httpAuth.factory()); - -// TEMPLATE NOTE: -// Rather than using a real catalog you can use a mock with a fixed set of entities. -backend.add( - catalogServiceMock.factory({ - entities: [ - { - apiVersion: 'backstage.io/v1alpha1', - kind: 'Component', - metadata: { - name: 'sample', - title: 'Sample Component', - }, - spec: { - type: 'service', - }, - }, - ], - }), -); - -backend.add(import('../src')); - -backend.start(); diff --git a/plugins/modern-backend/package.json b/plugins/modern-backend/package.json deleted file mode 100644 index def56e6ce3..0000000000 --- a/plugins/modern-backend/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@backstage/plugin-modern-backend", - "version": "0.0.0", - "backstage": { - "role": "backend-plugin" - }, - "publishConfig": { - "access": "public", - "main": "dist/index.cjs.js", - "types": "dist/index.d.ts" - }, - "license": "Apache-2.0", - "main": "src/index.ts", - "types": "src/index.ts", - "files": [ - "dist" - ], - "scripts": { - "build": "backstage-cli package build", - "clean": "backstage-cli package clean", - "lint": "backstage-cli package lint", - "prepack": "backstage-cli package prepack", - "postpack": "backstage-cli package postpack", - "start": "backstage-cli package start", - "test": "backstage-cli package test" - }, - "dependencies": { - "@backstage/backend-defaults": "workspace:^", - "@backstage/backend-plugin-api": "workspace:^", - "@backstage/catalog-client": "workspace:^", - "@backstage/errors": "workspace:^", - "@backstage/plugin-catalog-node": "workspace:^", - "express": "^4.17.1", - "express-promise-router": "^4.1.0", - "node-fetch": "^2.6.7", - "zod": "^3.22.4" - }, - "devDependencies": { - "@backstage/backend-test-utils": "workspace:^", - "@backstage/cli": "workspace:^", - "@backstage/plugin-auth-backend": "workspace:^", - "@backstage/plugin-auth-backend-module-guest-provider": "workspace:^", - "@types/express": "*", - "@types/supertest": "^2.0.8", - "msw": "^2.0.8", - "supertest": "^6.2.4" - } -} diff --git a/plugins/modern-backend/src/index.ts b/plugins/modern-backend/src/index.ts deleted file mode 100644 index 33e742ca76..0000000000 --- a/plugins/modern-backend/src/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { modernPlugin as default } from './plugin'; diff --git a/plugins/modern-backend/src/plugin.test.ts b/plugins/modern-backend/src/plugin.test.ts deleted file mode 100644 index 975fb1ae70..0000000000 --- a/plugins/modern-backend/src/plugin.test.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2024 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 { - mockCredentials, - startTestBackend, -} from '@backstage/backend-test-utils'; -import { modernPlugin } from './plugin'; -import request from 'supertest'; -import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; - -// TEMPLATE NOTE: -// Plugin tests are integration tests for your plugin, ensuring that all pieces -// work together end-to-end. You can still mock injected backend services -// however, just like anyway that installs your plugin might replace the -// services with their own implementations. -describe('plugin', () => { - it('should create and read TODO items', async () => { - const { server } = await startTestBackend({ - features: [modernPlugin], - }); - - await request(server).get('/api/modern/todos').expect(200, { - items: [], - }); - - const createRes = await request(server) - .post('/api/modern/todos') - .send({ title: 'My Todo' }); - - expect(createRes.status).toBe(201); - expect(createRes.body).toEqual({ - id: expect.any(String), - title: 'My Todo', - createdBy: mockCredentials.user().principal.userEntityRef, - createdAt: expect.any(String), - }); - - const createdTodoItem = createRes.body; - - await request(server) - .get('/api/modern/todos') - .expect(200, { - items: [createdTodoItem], - }); - - await request(server) - .get(`/api/modern/todos/${createdTodoItem.id}`) - .expect(200, createdTodoItem); - }); - - it('should create TODO item with catalog information', async () => { - const { server } = await startTestBackend({ - features: [ - modernPlugin, - catalogServiceMock.factory({ - entities: [ - { - apiVersion: 'backstage.io/v1alpha1', - kind: 'Component', - metadata: { - name: 'my-component', - namespace: 'default', - title: 'My Component', - }, - spec: { - type: 'service', - owner: 'me', - }, - }, - ], - }), - ], - }); - - const createRes = await request(server) - .post('/api/modern/todos') - .send({ title: 'My Todo', entityRef: 'component:default/my-component' }); - - expect(createRes.status).toBe(201); - expect(createRes.body).toEqual({ - id: expect.any(String), - title: '[My Component] My Todo', - createdBy: mockCredentials.user().principal.userEntityRef, - createdAt: expect.any(String), - }); - }); -}); diff --git a/plugins/modern-backend/src/plugin.ts b/plugins/modern-backend/src/plugin.ts deleted file mode 100644 index 6db9427f2d..0000000000 --- a/plugins/modern-backend/src/plugin.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2024 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 { - coreServices, - createBackendPlugin, -} from '@backstage/backend-plugin-api'; -import { createRouter } from './router'; -import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; -import { createTodoListService } from './services/TodoListService'; - -/** - * modernPlugin backend plugin - * - * @public - */ -export const modernPlugin = createBackendPlugin({ - pluginId: 'modern', - register(env) { - env.registerInit({ - deps: { - logger: coreServices.logger, - auth: coreServices.auth, - httpAuth: coreServices.httpAuth, - httpRouter: coreServices.httpRouter, - catalog: catalogServiceRef, - }, - async init({ logger, auth, httpAuth, httpRouter, catalog }) { - const todoListService = await createTodoListService({ - logger, - auth, - catalog, - }); - - httpRouter.use( - await createRouter({ - httpAuth, - todoListService, - }), - ); - }, - }); - }, -}); diff --git a/plugins/modern-backend/src/router.test.ts b/plugins/modern-backend/src/router.test.ts deleted file mode 100644 index 70534703b4..0000000000 --- a/plugins/modern-backend/src/router.test.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2024 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 { - mockCredentials, - mockErrorHandler, - mockServices, -} from '@backstage/backend-test-utils'; -import express from 'express'; -import request from 'supertest'; - -import { createRouter } from './router'; -import { TodoListService } from './services/TodoListService/types'; - -const mockTodoItem = { - title: 'Do the thing', - id: '123', - createdBy: mockCredentials.user().principal.userEntityRef, - createdAt: new Date().toISOString(), -}; - -// TEMPLATE NOTE: -// Testing the router directly allows you to write a unit test that mocks the provided options. -describe('createRouter', () => { - let app: express.Express; - let todoListService: jest.Mocked; - - beforeEach(async () => { - todoListService = { - createTodo: jest.fn(), - listTodos: jest.fn(), - getTodo: jest.fn(), - }; - const router = await createRouter({ - httpAuth: mockServices.httpAuth(), - todoListService, - }); - app = express(); - app.use(router); - app.use(mockErrorHandler()); - }); - - it('should create a TODO', async () => { - todoListService.createTodo.mockResolvedValue(mockTodoItem); - - const response = await request(app).post('/todos').send({ - title: 'Do the thing', - }); - - expect(response.status).toBe(200); - expect(response.body).toEqual(mockTodoItem); - }); - - it('should not allow unauthenticated requests to create a TODO', async () => { - todoListService.createTodo.mockResolvedValue(mockTodoItem); - - // TEMPLATE NOTE: - // The HttpAuth mock service considers all requests to be authenticated as a - // mock user by default. In order to test other cases we need to explicitly - // pass an authorization header with mock credentials. - const response = await request(app) - .post('/todos') - .set('Authorization', mockCredentials.none.header()) - .send({ - title: 'Do the thing', - }); - - expect(response.status).toBe(401); - }); -}); diff --git a/plugins/modern-backend/src/router.ts b/plugins/modern-backend/src/router.ts deleted file mode 100644 index f4abbe7383..0000000000 --- a/plugins/modern-backend/src/router.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2024 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 { HttpAuthService } from '@backstage/backend-plugin-api'; -import { InputError } from '@backstage/errors'; -import { z } from 'zod'; -import express from 'express'; -import Router from 'express-promise-router'; -import { TodoListService } from './services/TodoListService/types'; - -export async function createRouter({ - httpAuth, - todoListService, -}: { - httpAuth: HttpAuthService; - todoListService: TodoListService; -}): Promise { - const router = Router(); - router.use(express.json()); - - // TEMPLATE NOTE: - // Zod is a powerful library for data validation and recommended in particular - // for user-defined schemas. In this case we use it for input validation too. - // - // If you want to define a schema for your API we recommend using Backstage's - // OpenAPI tooling: https://backstage.io/docs/next/openapi/01-getting-started - const todoSchema = z.object({ - title: z.string(), - entityRef: z.string().optional(), - }); - - router.post('/todos', async (req, res) => { - const parsed = todoSchema.safeParse(req.body); - if (!parsed.success) { - throw new InputError(parsed.error.toString()); - } - - const result = await todoListService.createTodo(parsed.data, { - credentials: await httpAuth.credentials(req, { allow: ['user'] }), - }); - - res.status(201).json(result); - }); - - router.get('/todos', async (_req, res) => { - res.json(await todoListService.listTodos()); - }); - - router.get('/todos/:id', async (req, res) => { - res.json(await todoListService.getTodo({ id: req.params.id })); - }); - - return router; -} diff --git a/plugins/modern-backend/src/services/TodoListService/createTodoListService.ts b/plugins/modern-backend/src/services/TodoListService/createTodoListService.ts deleted file mode 100644 index a1b25b027f..0000000000 --- a/plugins/modern-backend/src/services/TodoListService/createTodoListService.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2024 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 { AuthService, LoggerService } from '@backstage/backend-plugin-api'; -import { NotFoundError } from '@backstage/errors'; -import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; -import crypto from 'node:crypto'; -import { TodoItem, TodoListService } from './types'; - -// TEMPLATE NOTE: -// This is a simple in-memory todo list store. It is recommended to use a -// database to store data in a real application. See the database service -// documentation for more information on how to do this: -// https://backstage.io/docs/backend-system/core-services/database -export async function createTodoListService({ - auth, - logger, - catalog, -}: { - auth: AuthService; - logger: LoggerService; - catalog: typeof catalogServiceRef.T; -}): Promise { - logger.info('Initializing TodoListService'); - - const storedTodos = new Array(); - - return { - async createTodo(input, options) { - let title = input.title; - - // TEMPLATE NOTE: - // A common pattern for Backstage plugins is to pass an entity reference - // from the frontend to then fetch the entire entity from the catalog in the - // backend plugin. - if (input.entityRef) { - // TEMPLATE NOTE: - // Cross-plugin communication uses service-to-service authentication. The - // `AuthService` lets you generate a token that is valid for communication - // with the target plugin only. You must also provide credentials for the - // identity that you are making the request on behalf of. - // - // If you want to make a request using the plugin backend's own identity, - // you can access it via the `auth.getOwnServiceCredentials()` method. - // Beware that this bypasses any user permission checks. - const { token } = await auth.getPluginRequestToken({ - onBehalfOf: options.credentials, - targetPluginId: 'catalog', - }); - const entity = await catalog.getEntityByRef(input.entityRef, { - token, - }); - if (!entity) { - throw new NotFoundError( - `No entity found for ref '${input.entityRef}'`, - ); - } - - // TEMPLATE NOTE: - // Here you could read any form of data from the entity. A common use case - // is to read the value of a custom annotation for your plugin. You can - // read more about how to add custom annotations here: - // https://backstage.io/docs/features/software-catalog/extending-the-model#adding-a-new-annotation - // - // In this example we just use the entity title to decorate the todo item. - - const entityDisplay = entity.metadata.title ?? input.entityRef; - title = `[${entityDisplay}] ${input.title}`; - } - - const id = crypto.randomUUID(); - const createdBy = options.credentials.principal.userEntityRef; - const newTodo = { - title, - id, - createdBy, - createdAt: new Date().toISOString(), - }; - - storedTodos.push(newTodo); - - // TEMPLATE NOTE: - // The second argument of the logger methods can be used to pass structured metadata - logger.info('Created new todo item', { id, title, createdBy }); - - return newTodo; - }, - - async listTodos() { - return { items: Array.from(storedTodos) }; - }, - - async getTodo(request: { id: string }) { - const todo = storedTodos.find(item => item.id === request.id); - if (!todo) { - throw new NotFoundError(`No todo found with id '${request.id}'`); - } - return todo; - }, - }; -} diff --git a/plugins/modern-backend/src/services/TodoListService/index.ts b/plugins/modern-backend/src/services/TodoListService/index.ts deleted file mode 100644 index 8f2547209b..0000000000 --- a/plugins/modern-backend/src/services/TodoListService/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { createTodoListService } from './createTodoListService'; diff --git a/plugins/modern-backend/src/services/TodoListService/types.ts b/plugins/modern-backend/src/services/TodoListService/types.ts deleted file mode 100644 index 07ff7cdc48..0000000000 --- a/plugins/modern-backend/src/services/TodoListService/types.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2024 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 { - BackstageCredentials, - BackstageUserPrincipal, -} from '@backstage/backend-plugin-api'; - -export interface TodoItem { - title: string; - id: string; - createdBy: string; - createdAt: string; -} - -export interface TodoListService { - createTodo( - input: { - title: string; - entityRef?: string; - }, - options: { - credentials: BackstageCredentials; - }, - ): Promise; - - listTodos(): Promise<{ items: TodoItem[] }>; - - getTodo(request: { id: string }): Promise; -} diff --git a/plugins/modern-backend/src/setupTests.ts b/plugins/modern-backend/src/setupTests.ts deleted file mode 100644 index b0f602d2d8..0000000000 --- a/plugins/modern-backend/src/setupTests.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export {}; diff --git a/yarn.lock b/yarn.lock index 47b9244770..2d83745f3b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6847,30 +6847,6 @@ __metadata: languageName: unknown linkType: soft -"@backstage/plugin-modern-backend@workspace:plugins/modern-backend": - version: 0.0.0-use.local - resolution: "@backstage/plugin-modern-backend@workspace:plugins/modern-backend" - dependencies: - "@backstage/backend-defaults": "workspace:^" - "@backstage/backend-plugin-api": "workspace:^" - "@backstage/backend-test-utils": "workspace:^" - "@backstage/catalog-client": "workspace:^" - "@backstage/cli": "workspace:^" - "@backstage/errors": "workspace:^" - "@backstage/plugin-auth-backend": "workspace:^" - "@backstage/plugin-auth-backend-module-guest-provider": "workspace:^" - "@backstage/plugin-catalog-node": "workspace:^" - "@types/express": "*" - "@types/supertest": ^2.0.8 - express: ^4.17.1 - express-promise-router: ^4.1.0 - msw: ^2.0.8 - node-fetch: ^2.6.7 - supertest: ^6.2.4 - zod: ^3.22.4 - languageName: unknown - linkType: soft - "@backstage/plugin-notifications-backend-module-email@workspace:plugins/notifications-backend-module-email": version: 0.0.0-use.local resolution: "@backstage/plugin-notifications-backend-module-email@workspace:plugins/notifications-backend-module-email" @@ -27963,18 +27939,6 @@ __metadata: languageName: node linkType: hard -"formidable@npm:^2.1.2": - version: 2.1.2 - resolution: "formidable@npm:2.1.2" - dependencies: - dezalgo: ^1.0.4 - hexoid: ^1.0.0 - once: ^1.4.0 - qs: ^6.11.0 - checksum: 81c8e5d89f5eb873e992893468f0de22c01678ca3d315db62be0560f9de1c77d4faefc9b1f4575098eb2263b3c81ba1024833a9fc3206297ddbac88a4f69b7a8 - languageName: node - linkType: hard - "formidable@npm:^3.5.1": version: 3.5.1 resolution: "formidable@npm:3.5.1" @@ -42077,24 +42041,6 @@ __metadata: languageName: node linkType: hard -"superagent@npm:^8.1.2": - version: 8.1.2 - resolution: "superagent@npm:8.1.2" - dependencies: - component-emitter: ^1.3.0 - cookiejar: ^2.1.4 - debug: ^4.3.4 - fast-safe-stringify: ^2.1.1 - form-data: ^4.0.0 - formidable: ^2.1.2 - methods: ^1.1.2 - mime: 2.6.0 - qs: ^6.11.0 - semver: ^7.3.8 - checksum: f3601c5ccae34d5ba684a03703394b5d25931f4ae2e1e31a1de809f88a9400e997ece037f9accf148a21c408f950dc829db1e4e23576a7f9fe0efa79fd5c9d2f - languageName: node - linkType: hard - "superagent@npm:^9.0.1": version: 9.0.2 resolution: "superagent@npm:9.0.2" @@ -42112,16 +42058,6 @@ __metadata: languageName: node linkType: hard -"supertest@npm:^6.2.4": - version: 6.3.4 - resolution: "supertest@npm:6.3.4" - dependencies: - methods: ^1.1.2 - superagent: ^8.1.2 - checksum: 875c6fa7940f21e5be9bb646579cdb030d4057bf2da643e125e1f0480add1200395d2b17e10b8e54e1009efc63e047422501e9eb30e12828668498c0910f295f - languageName: node - linkType: hard - "supertest@npm:^7.0.0": version: 7.0.0 resolution: "supertest@npm:7.0.0" From a05fcbbe632b1db08a7ab91f805c2dd03316dc7b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 12:09:28 +0200 Subject: [PATCH 115/268] cli: update backend plugin template README Signed-off-by: Patrik Oldsberg --- .../default-backend-plugin/README.md.hbs | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/packages/cli/templates/default-backend-plugin/README.md.hbs b/packages/cli/templates/default-backend-plugin/README.md.hbs index d519c3f459..00e83a33ec 100644 --- a/packages/cli/templates/default-backend-plugin/README.md.hbs +++ b/packages/cli/templates/default-backend-plugin/README.md.hbs @@ -1,14 +1,28 @@ # {{id}} -Welcome to the {{id}} backend plugin! +This plugin backend was templated using the Backstage CLI. You should replace this text with a description of your plugin backend. -_This plugin was created through the Backstage CLI_ +## Installation -## Getting started +This plugin is installed via the `{{name}}` package. To install it to your backend package, run the following command: -Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn -start` in the root directory, and then navigating to [/{{id}}/health](http://localhost:7007/api/{{id}}/health). +```bash +# From your root directory +yarn --cwd packages/backend add {{name}} +``` -You can also serve the plugin in isolation by running `yarn start` in the plugin directory. -This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. -It is only meant for local development, and the setup for it can be found inside the [/dev](./dev) directory. +Then add the plugin to your backend in `packages/backend/src/index.ts`: + +```ts +const backend = createBackend(); +// ... +backend.add(import('{{name}}')); +``` + +## Development + +This plugin backend can be started in a standalone mode from directly in this +package with `yarn start`. It is a limited setup that is most convenient when +developing the plugin backend itself. + +If you want to run the entire project, including the frontend, run `yarn dev` from the root directory. From 11a489f2fafa49a725480c8e4e0ef5c47db30e37 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 18:06:35 +0200 Subject: [PATCH 116/268] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Patrik Oldsberg --- packages/cli/templates/default-backend-plugin/dev/index.ts.hbs | 2 +- .../cli/templates/default-backend-plugin/src/plugin.test.ts.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/templates/default-backend-plugin/dev/index.ts.hbs b/packages/cli/templates/default-backend-plugin/dev/index.ts.hbs index 07dc091083..ce1d2919c9 100644 --- a/packages/cli/templates/default-backend-plugin/dev/index.ts.hbs +++ b/packages/cli/templates/default-backend-plugin/dev/index.ts.hbs @@ -7,7 +7,7 @@ import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; // minimal backend that can use both real and mocked plugins and services. // // Start up the backend by running `yarn start` in the package directory. -// It's it's up and running, try out the following requests: +// Once it's up and running, try out the following requests: // // Create a new todo item, standalone or for the sample component: // diff --git a/packages/cli/templates/default-backend-plugin/src/plugin.test.ts.hbs b/packages/cli/templates/default-backend-plugin/src/plugin.test.ts.hbs index cd4b9fc438..b6f387383e 100644 --- a/packages/cli/templates/default-backend-plugin/src/plugin.test.ts.hbs +++ b/packages/cli/templates/default-backend-plugin/src/plugin.test.ts.hbs @@ -9,7 +9,7 @@ import { catalogServiceMock } from '@backstage/plugin-catalog-node/testUtils'; // TEMPLATE NOTE: // Plugin tests are integration tests for your plugin, ensuring that all pieces // work together end-to-end. You can still mock injected backend services -// however, just like anyway that installs your plugin might replace the +// however, just like anyone who installs your plugin might replace the // services with their own implementations. describe('plugin', () => { it('should create and read TODO items', async () => { From 9a86d790173eed371b484398af2bc99e422207f1 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 12 Oct 2024 23:49:57 +0200 Subject: [PATCH 117/268] cli: update backend plugin templating test Signed-off-by: Patrik Oldsberg --- packages/cli/src/lib/new/factories/backendPlugin.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/lib/new/factories/backendPlugin.test.ts b/packages/cli/src/lib/new/factories/backendPlugin.test.ts index c5dc237517..5415a3cd71 100644 --- a/packages/cli/src/lib/new/factories/backendPlugin.test.ts +++ b/packages/cli/src/lib/new/factories/backendPlugin.test.ts @@ -92,12 +92,16 @@ describe('backendPlugin factory', () => { 'templating .eslintrc.js.hbs', 'templating README.md.hbs', 'templating index.ts.hbs', + 'templating index.ts.hbs', 'templating package.json.hbs', + 'templating plugin.ts.hbs', + 'templating plugin.test.ts.hbs', 'copying index.ts', 'copying setupTests.ts', - 'copying router.test.ts', 'copying router.ts', - 'templating plugin.ts.hbs', + 'copying router.test.ts', + 'copying createTodoListService.ts', + 'copying types.ts', 'Installing:', `moving plugins${sep}test-backend`, 'backend adding dependency', From 881507f9d5aae262ec05a2f12a57eaf9b0cf9c77 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 13 Oct 2024 10:54:10 +0200 Subject: [PATCH 118/268] plugins/catalog-backend-module-*: flip around alpha exports to stable Signed-off-by: Patrik Oldsberg --- .../report-alpha.api.md | 10 +++-- .../catalog-backend-module-aws/report.api.md | 12 ++---- .../catalog-backend-module-aws/src/alpha.ts | 7 +++- .../catalog-backend-module-aws/src/index.ts | 7 +--- .../catalogModuleAwsS3EntityProvider.ts | 2 +- .../report-alpha.api.md | 10 +++-- .../report.api.md | 10 ++--- .../catalog-backend-module-azure/src/alpha.ts | 7 +++- .../catalog-backend-module-azure/src/index.ts | 7 +--- .../catalogModuleAzureDevOpsEntityProvider.ts | 2 +- .../report-alpha.api.md | 6 +-- .../report.api.md | 9 ++--- .../src/alpha.ts | 7 +++- .../src/index.ts | 7 +--- ...talogModuleBitbucketCloudEntityProvider.ts | 2 +- .../report-alpha.api.md | 6 +-- .../report.api.md | 9 ++--- .../src/alpha.ts | 7 +++- .../src/index.ts | 7 +--- ...alogModuleBitbucketServerEntityProvider.ts | 2 +- .../report-alpha.api.md | 6 +-- .../report.api.md | 6 +-- .../src/alpha.ts | 7 +++- .../src/index.ts | 7 +--- .../catalogModuleGerritEntityProvider.ts | 2 +- .../report-alpha.api.md | 10 +++-- .../report.api.md | 10 ++--- .../src/alpha.ts | 7 +++- .../src/index.ts | 7 +--- .../src/module/githubCatalogModule.ts | 2 +- .../report-alpha.api.md | 10 +++-- .../report.api.md | 10 ++--- .../src/alpha.ts | 6 ++- .../src/index.ts | 7 +--- ...alogModuleGitlabDiscoveryEntityProvider.ts | 2 +- .../report-alpha.api.md | 28 +++++++------ .../report.api.md | 26 ++++++++---- .../src/alpha.ts | 16 +++++++- .../src/index.ts | 8 +--- ...oduleIncrementalIngestionEntityProvider.ts | 6 +-- .../report-alpha.api.md | 40 ++++++++----------- .../report.api.md | 40 +++++++++++++++---- .../src/alpha.ts | 18 ++++++++- .../src/index.ts | 8 +--- ...ogModuleMicrosoftGraphOrgEntityProvider.ts | 6 +-- 45 files changed, 230 insertions(+), 201 deletions(-) diff --git a/plugins/catalog-backend-module-aws/report-alpha.api.md b/plugins/catalog-backend-module-aws/report-alpha.api.md index 495abb6b48..2d9ceaec2d 100644 --- a/plugins/catalog-backend-module-aws/report-alpha.api.md +++ b/plugins/catalog-backend-module-aws/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const catalogModuleAwsS3EntityProvider: BackendFeature; -export default catalogModuleAwsS3EntityProvider; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-aws/report.api.md b/plugins/catalog-backend-module-aws/report.api.md index ed0eac9864..c0e5653190 100644 --- a/plugins/catalog-backend-module-aws/report.api.md +++ b/plugins/catalog-backend-module-aws/report.api.md @@ -105,6 +105,10 @@ export class AwsS3EntityProvider implements EntityProvider { refresh(logger: LoggerService): Promise; } +// @public +const catalogModuleAwsS3EntityProvider: BackendFeature; +export default catalogModuleAwsS3EntityProvider; + // @public export const defaultEksClusterEntityTransformer: EksClusterEntityTransformer; @@ -114,14 +118,8 @@ export type EksClusterEntityTransformer = ( accountId: string, ) => Promise; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/processors/AwsEKSClusterProcessor.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/processors/AwsEKSClusterProcessor.d.ts:26:5 - (ae-undocumented) Missing documentation for "getProcessorName". // src/processors/AwsEKSClusterProcessor.d.ts:27:5 - (ae-undocumented) Missing documentation for "readLocation". @@ -132,6 +130,4 @@ export default _feature; // src/processors/AwsS3DiscoveryProcessor.d.ts:16:5 - (ae-undocumented) Missing documentation for "readLocation". // src/providers/AwsS3EntityProvider.d.ts:20:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/AwsS3EntityProvider.d.ts:31:5 - (ae-undocumented) Missing documentation for "refresh". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-aws/src/alpha.ts b/plugins/catalog-backend-module-aws/src/alpha.ts index 01a9b25f7c..cba672ce49 100644 --- a/plugins/catalog-backend-module-aws/src/alpha.ts +++ b/plugins/catalog-backend-module-aws/src/alpha.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export * from './module'; -export { default } from './module'; +import { default as feature } from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/catalog-backend-module-aws/src/index.ts b/plugins/catalog-backend-module-aws/src/index.ts index 8fbc7e3b87..1170fba043 100644 --- a/plugins/catalog-backend-module-aws/src/index.ts +++ b/plugins/catalog-backend-module-aws/src/index.ts @@ -14,18 +14,13 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A Backstage catalog backend module that helps integrate towards AWS * * @packageDocumentation */ +export { default } from './module'; export * from './processors'; export * from './providers'; export * from './types'; diff --git a/plugins/catalog-backend-module-aws/src/module/catalogModuleAwsS3EntityProvider.ts b/plugins/catalog-backend-module-aws/src/module/catalogModuleAwsS3EntityProvider.ts index 5568b8b3d8..2c99f2a44a 100644 --- a/plugins/catalog-backend-module-aws/src/module/catalogModuleAwsS3EntityProvider.ts +++ b/plugins/catalog-backend-module-aws/src/module/catalogModuleAwsS3EntityProvider.ts @@ -24,7 +24,7 @@ import { AwsS3EntityProvider } from '../providers'; /** * Registers the AwsS3EntityProvider with the catalog processing extension point. * - * @alpha + * @public */ export const catalogModuleAwsS3EntityProvider = createBackendModule({ pluginId: 'catalog', diff --git a/plugins/catalog-backend-module-azure/report-alpha.api.md b/plugins/catalog-backend-module-azure/report-alpha.api.md index fc48df304a..1be3e1481f 100644 --- a/plugins/catalog-backend-module-azure/report-alpha.api.md +++ b/plugins/catalog-backend-module-azure/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const catalogModuleAzureDevOpsEntityProvider: BackendFeature; -export default catalogModuleAzureDevOpsEntityProvider; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-azure/report.api.md b/plugins/catalog-backend-module-azure/report.api.md index 00a18ee604..b3b7b71158 100644 --- a/plugins/catalog-backend-module-azure/report.api.md +++ b/plugins/catalog-backend-module-azure/report.api.md @@ -55,19 +55,15 @@ export class AzureDevOpsEntityProvider implements EntityProvider { refresh(logger: LoggerService): Promise; } -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const catalogModuleAzureDevOpsEntityProvider: BackendFeature; +export default catalogModuleAzureDevOpsEntityProvider; // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/processors/AzureDevOpsDiscoveryProcessor.d.ts:26:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/processors/AzureDevOpsDiscoveryProcessor.d.ts:33:5 - (ae-undocumented) Missing documentation for "getProcessorName". // src/processors/AzureDevOpsDiscoveryProcessor.d.ts:34:5 - (ae-undocumented) Missing documentation for "readLocation". // src/providers/AzureDevOpsEntityProvider.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/AzureDevOpsEntityProvider.d.ts:29:5 - (ae-undocumented) Missing documentation for "refresh". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-azure/src/alpha.ts b/plugins/catalog-backend-module-azure/src/alpha.ts index 01a9b25f7c..cba672ce49 100644 --- a/plugins/catalog-backend-module-azure/src/alpha.ts +++ b/plugins/catalog-backend-module-azure/src/alpha.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export * from './module'; -export { default } from './module'; +import { default as feature } from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/catalog-backend-module-azure/src/index.ts b/plugins/catalog-backend-module-azure/src/index.ts index f844d9a7b6..dbbdff67ce 100644 --- a/plugins/catalog-backend-module-azure/src/index.ts +++ b/plugins/catalog-backend-module-azure/src/index.ts @@ -14,17 +14,12 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A Backstage catalog backend module that helps integrate towards Azure * * @packageDocumentation */ +export { default } from './module'; export { AzureDevOpsDiscoveryProcessor } from './processors'; export { AzureDevOpsEntityProvider } from './providers'; diff --git a/plugins/catalog-backend-module-azure/src/module/catalogModuleAzureDevOpsEntityProvider.ts b/plugins/catalog-backend-module-azure/src/module/catalogModuleAzureDevOpsEntityProvider.ts index cb4d5a1bf8..3aaa1b5b08 100644 --- a/plugins/catalog-backend-module-azure/src/module/catalogModuleAzureDevOpsEntityProvider.ts +++ b/plugins/catalog-backend-module-azure/src/module/catalogModuleAzureDevOpsEntityProvider.ts @@ -24,7 +24,7 @@ import { AzureDevOpsEntityProvider } from '../providers'; /** * Registers the AzureDevOpsEntityProvider with the catalog processing extension point. * - * @alpha + * @public */ export const catalogModuleAzureDevOpsEntityProvider = createBackendModule({ pluginId: 'catalog', diff --git a/plugins/catalog-backend-module-bitbucket-cloud/report-alpha.api.md b/plugins/catalog-backend-module-bitbucket-cloud/report-alpha.api.md index 3f0a2d1514..418327eb07 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/report-alpha.api.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/report-alpha.api.md @@ -6,12 +6,12 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -const catalogModuleBitbucketCloudEntityProvider: BackendFeature; -export default catalogModuleBitbucketCloudEntityProvider; +const _feature: BackendFeature; +export default _feature; // Warnings were encountered during analysis: // -// src/module/catalogModuleBitbucketCloudEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleBitbucketCloudEntityProvider". +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-cloud/report.api.md b/plugins/catalog-backend-module-bitbucket-cloud/report.api.md index 2ddf5f5401..19e835913f 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/report.api.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/report.api.md @@ -39,16 +39,13 @@ export class BitbucketCloudEntityProvider implements EntityProvider { } // @public (undocumented) -const _feature: BackendFeature; -export default _feature; +const catalogModuleBitbucketCloudEntityProvider: BackendFeature; +export default catalogModuleBitbucketCloudEntityProvider; // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file +// src/module/catalogModuleBitbucketCloudEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleBitbucketCloudEntityProvider". // src/providers/BitbucketCloudEntityProvider.d.ts:26:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/BitbucketCloudEntityProvider.d.ts:42:5 - (ae-undocumented) Missing documentation for "refresh". // src/providers/BitbucketCloudEntityProvider.d.ts:44:5 - (ae-undocumented) Missing documentation for "onRepoPush". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-cloud/src/alpha.ts b/plugins/catalog-backend-module-bitbucket-cloud/src/alpha.ts index 01a9b25f7c..cba672ce49 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/src/alpha.ts +++ b/plugins/catalog-backend-module-bitbucket-cloud/src/alpha.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export * from './module'; -export { default } from './module'; +import { default as feature } from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/catalog-backend-module-bitbucket-cloud/src/index.ts b/plugins/catalog-backend-module-bitbucket-cloud/src/index.ts index ef693fedc3..b46ff31c51 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/src/index.ts +++ b/plugins/catalog-backend-module-bitbucket-cloud/src/index.ts @@ -14,16 +14,11 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A Backstage catalog backend module that helps integrate towards Bitbucket Cloud * * @packageDocumentation */ +export { default } from './module'; export { BitbucketCloudEntityProvider } from './providers/BitbucketCloudEntityProvider'; diff --git a/plugins/catalog-backend-module-bitbucket-cloud/src/module/catalogModuleBitbucketCloudEntityProvider.ts b/plugins/catalog-backend-module-bitbucket-cloud/src/module/catalogModuleBitbucketCloudEntityProvider.ts index 8cc8f50d5b..91f20c157c 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/src/module/catalogModuleBitbucketCloudEntityProvider.ts +++ b/plugins/catalog-backend-module-bitbucket-cloud/src/module/catalogModuleBitbucketCloudEntityProvider.ts @@ -26,7 +26,7 @@ import { eventsServiceRef } from '@backstage/plugin-events-node'; import { BitbucketCloudEntityProvider } from '../providers/BitbucketCloudEntityProvider'; /** - * @alpha + * @public */ export const catalogModuleBitbucketCloudEntityProvider = createBackendModule({ pluginId: 'catalog', diff --git a/plugins/catalog-backend-module-bitbucket-server/report-alpha.api.md b/plugins/catalog-backend-module-bitbucket-server/report-alpha.api.md index 49648580f8..60f05fac26 100644 --- a/plugins/catalog-backend-module-bitbucket-server/report-alpha.api.md +++ b/plugins/catalog-backend-module-bitbucket-server/report-alpha.api.md @@ -6,12 +6,12 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -const catalogModuleBitbucketServerEntityProvider: BackendFeature; -export default catalogModuleBitbucketServerEntityProvider; +const _feature: BackendFeature; +export default _feature; // Warnings were encountered during analysis: // -// src/module/catalogModuleBitbucketServerEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleBitbucketServerEntityProvider". +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-server/report.api.md b/plugins/catalog-backend-module-bitbucket-server/report.api.md index 33acd9a926..41b0d398ab 100644 --- a/plugins/catalog-backend-module-bitbucket-server/report.api.md +++ b/plugins/catalog-backend-module-bitbucket-server/report.api.md @@ -112,13 +112,11 @@ export type BitbucketServerRepository = { }; // @public (undocumented) -const _feature: BackendFeature; -export default _feature; +const catalogModuleBitbucketServerEntityProvider: BackendFeature; +export default catalogModuleBitbucketServerEntityProvider; // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/lib/BitbucketServerClient.d.ts:11:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/lib/BitbucketServerClient.d.ts:17:5 - (ae-undocumented) Missing documentation for "listProjects". // src/lib/BitbucketServerClient.d.ts:20:5 - (ae-undocumented) Missing documentation for "listRepositories". @@ -129,8 +127,7 @@ export default _feature; // src/lib/BitbucketServerClient.d.ts:56:1 - (ae-undocumented) Missing documentation for "BitbucketServerPagedResponse". // src/lib/types.d.ts:2:1 - (ae-undocumented) Missing documentation for "BitbucketServerRepository". // src/lib/types.d.ts:14:1 - (ae-undocumented) Missing documentation for "BitbucketServerProject". +// src/module/catalogModuleBitbucketServerEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleBitbucketServerEntityProvider". // src/providers/BitbucketServerEntityProvider.d.ts:20:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/BitbucketServerEntityProvider.d.ts:32:5 - (ae-undocumented) Missing documentation for "refresh". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-server/src/alpha.ts b/plugins/catalog-backend-module-bitbucket-server/src/alpha.ts index 01a9b25f7c..cba672ce49 100644 --- a/plugins/catalog-backend-module-bitbucket-server/src/alpha.ts +++ b/plugins/catalog-backend-module-bitbucket-server/src/alpha.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export * from './module'; -export { default } from './module'; +import { default as feature } from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/catalog-backend-module-bitbucket-server/src/index.ts b/plugins/catalog-backend-module-bitbucket-server/src/index.ts index 7bc1737803..f05c9ca0e9 100644 --- a/plugins/catalog-backend-module-bitbucket-server/src/index.ts +++ b/plugins/catalog-backend-module-bitbucket-server/src/index.ts @@ -14,18 +14,13 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A Backstage catalog backend module that helps integrate towards Bitbucket Server * * @packageDocumentation */ +export { default } from './module'; export { BitbucketServerClient } from './lib'; export type { BitbucketServerProject, diff --git a/plugins/catalog-backend-module-bitbucket-server/src/module/catalogModuleBitbucketServerEntityProvider.ts b/plugins/catalog-backend-module-bitbucket-server/src/module/catalogModuleBitbucketServerEntityProvider.ts index 3b9a44f5a2..2c78d219d9 100644 --- a/plugins/catalog-backend-module-bitbucket-server/src/module/catalogModuleBitbucketServerEntityProvider.ts +++ b/plugins/catalog-backend-module-bitbucket-server/src/module/catalogModuleBitbucketServerEntityProvider.ts @@ -22,7 +22,7 @@ import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/ import { BitbucketServerEntityProvider } from '../providers'; /** - * @alpha + * @public */ export const catalogModuleBitbucketServerEntityProvider = createBackendModule({ pluginId: 'catalog', diff --git a/plugins/catalog-backend-module-gerrit/report-alpha.api.md b/plugins/catalog-backend-module-gerrit/report-alpha.api.md index 0774a27299..741c105577 100644 --- a/plugins/catalog-backend-module-gerrit/report-alpha.api.md +++ b/plugins/catalog-backend-module-gerrit/report-alpha.api.md @@ -6,12 +6,12 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; // @alpha (undocumented) -const catalogModuleGerritEntityProvider: BackendFeature; -export default catalogModuleGerritEntityProvider; +const _feature: BackendFeature; +export default _feature; // Warnings were encountered during analysis: // -// src/module/catalogModuleGerritEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleGerritEntityProvider". +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gerrit/report.api.md b/plugins/catalog-backend-module-gerrit/report.api.md index 5d78cba9aa..76866fe76a 100644 --- a/plugins/catalog-backend-module-gerrit/report.api.md +++ b/plugins/catalog-backend-module-gerrit/report.api.md @@ -12,8 +12,8 @@ import { SchedulerService } from '@backstage/backend-plugin-api'; import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api'; // @public (undocumented) -const _feature: BackendFeature; -export default _feature; +const catalogModuleGerritEntityProvider: BackendFeature; +export default catalogModuleGerritEntityProvider; // @public (undocumented) export class GerritEntityProvider implements EntityProvider { @@ -36,7 +36,7 @@ export class GerritEntityProvider implements EntityProvider { // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/module/catalogModuleGerritEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleGerritEntityProvider". // src/providers/GerritEntityProvider.d.ts:5:1 - (ae-undocumented) Missing documentation for "GerritEntityProvider". // src/providers/GerritEntityProvider.d.ts:11:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/GerritEntityProvider.d.ts:17:5 - (ae-undocumented) Missing documentation for "getProviderName". diff --git a/plugins/catalog-backend-module-gerrit/src/alpha.ts b/plugins/catalog-backend-module-gerrit/src/alpha.ts index 01a9b25f7c..cba672ce49 100644 --- a/plugins/catalog-backend-module-gerrit/src/alpha.ts +++ b/plugins/catalog-backend-module-gerrit/src/alpha.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export * from './module'; -export { default } from './module'; +import { default as feature } from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/catalog-backend-module-gerrit/src/index.ts b/plugins/catalog-backend-module-gerrit/src/index.ts index 177932685e..81375b9ab2 100644 --- a/plugins/catalog-backend-module-gerrit/src/index.ts +++ b/plugins/catalog-backend-module-gerrit/src/index.ts @@ -14,10 +14,5 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - +export { default } from './module'; export { GerritEntityProvider } from './providers/GerritEntityProvider'; diff --git a/plugins/catalog-backend-module-gerrit/src/module/catalogModuleGerritEntityProvider.ts b/plugins/catalog-backend-module-gerrit/src/module/catalogModuleGerritEntityProvider.ts index e0efbabefd..a1aaac7b5c 100644 --- a/plugins/catalog-backend-module-gerrit/src/module/catalogModuleGerritEntityProvider.ts +++ b/plugins/catalog-backend-module-gerrit/src/module/catalogModuleGerritEntityProvider.ts @@ -22,7 +22,7 @@ import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/ import { GerritEntityProvider } from '../providers/GerritEntityProvider'; /** - * @alpha + * @public */ export const catalogModuleGerritEntityProvider = createBackendModule({ pluginId: 'catalog', diff --git a/plugins/catalog-backend-module-github/report-alpha.api.md b/plugins/catalog-backend-module-github/report-alpha.api.md index faa5423d82..fbe98b714e 100644 --- a/plugins/catalog-backend-module-github/report-alpha.api.md +++ b/plugins/catalog-backend-module-github/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const githubCatalogModule: BackendFeature; -export default githubCatalogModule; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-github/report.api.md b/plugins/catalog-backend-module-github/report.api.md index 52c061c8a5..e81d0a0e81 100644 --- a/plugins/catalog-backend-module-github/report.api.md +++ b/plugins/catalog-backend-module-github/report.api.md @@ -38,9 +38,9 @@ export const defaultUserTransformer: ( _ctx: TransformerContext, ) => Promise; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const githubCatalogModule: BackendFeature; +export default githubCatalogModule; // @public export class GithubDiscoveryProcessor implements CatalogProcessor { @@ -338,8 +338,6 @@ export type UserTransformer = ( // src/deprecated.d.ts:29:5 - (ae-undocumented) Missing documentation for "connect". // src/deprecated.d.ts:30:5 - (ae-undocumented) Missing documentation for "getProviderName". // src/deprecated.d.ts:31:5 - (ae-undocumented) Missing documentation for "refresh". -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/lib/defaultTransformers.d.ts:10:5 - (ae-undocumented) Missing documentation for "client". // src/lib/defaultTransformers.d.ts:11:5 - (ae-undocumented) Missing documentation for "query". // src/lib/defaultTransformers.d.ts:12:5 - (ae-undocumented) Missing documentation for "org". @@ -362,6 +360,4 @@ export type UserTransformer = ( // src/providers/GithubEntityProvider.d.ts:102:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration // src/providers/GithubMultiOrgEntityProvider.d.ts:84:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/GithubOrgEntityProvider.d.ts:71:5 - (ae-undocumented) Missing documentation for "fromConfig". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-github/src/alpha.ts b/plugins/catalog-backend-module-github/src/alpha.ts index 01a9b25f7c..cba672ce49 100644 --- a/plugins/catalog-backend-module-github/src/alpha.ts +++ b/plugins/catalog-backend-module-github/src/alpha.ts @@ -14,5 +14,8 @@ * limitations under the License. */ -export * from './module'; -export { default } from './module'; +import { default as feature } from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/catalog-backend-module-github/src/index.ts b/plugins/catalog-backend-module-github/src/index.ts index e7a96d8a3f..539e4ae14f 100644 --- a/plugins/catalog-backend-module-github/src/index.ts +++ b/plugins/catalog-backend-module-github/src/index.ts @@ -14,18 +14,13 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A Backstage catalog backend module that helps integrate towards Github * * @packageDocumentation */ +export { default } from './module'; export { GithubLocationAnalyzer } from './analyzers/GithubLocationAnalyzer'; export type { GithubLocationAnalyzerOptions } from './analyzers/GithubLocationAnalyzer'; export { GithubDiscoveryProcessor } from './processors/GithubDiscoveryProcessor'; diff --git a/plugins/catalog-backend-module-github/src/module/githubCatalogModule.ts b/plugins/catalog-backend-module-github/src/module/githubCatalogModule.ts index 15d36a3011..bc10b04802 100644 --- a/plugins/catalog-backend-module-github/src/module/githubCatalogModule.ts +++ b/plugins/catalog-backend-module-github/src/module/githubCatalogModule.ts @@ -30,7 +30,7 @@ import { GithubLocationAnalyzer } from '../analyzers/GithubLocationAnalyzer'; /** * Registers the `GithubEntityProvider` with the catalog processing extension point. * - * @alpha + * @public */ export const githubCatalogModule = createBackendModule({ pluginId: 'catalog', diff --git a/plugins/catalog-backend-module-gitlab/report-alpha.api.md b/plugins/catalog-backend-module-gitlab/report-alpha.api.md index 0b1c7df3cc..350411a6dc 100644 --- a/plugins/catalog-backend-module-gitlab/report-alpha.api.md +++ b/plugins/catalog-backend-module-gitlab/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const catalogModuleGitlabDiscoveryEntityProvider: BackendFeature; -export default catalogModuleGitlabDiscoveryEntityProvider; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gitlab/report.api.md b/plugins/catalog-backend-module-gitlab/report.api.md index ac7624986d..07612bca88 100644 --- a/plugins/catalog-backend-module-gitlab/report.api.md +++ b/plugins/catalog-backend-module-gitlab/report.api.md @@ -19,9 +19,9 @@ import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api'; import { SchedulerServiceTaskScheduleDefinition } from '@backstage/backend-plugin-api'; import { UserEntity } from '@backstage/catalog-model'; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const catalogModuleGitlabDiscoveryEntityProvider: BackendFeature; +export default catalogModuleGitlabDiscoveryEntityProvider; // @public export class GitlabDiscoveryEntityProvider implements EntityProvider { @@ -182,8 +182,6 @@ export interface UserTransformerOptions { // src/GitLabDiscoveryProcessor.d.ts:14:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/GitLabDiscoveryProcessor.d.ts:20:5 - (ae-undocumented) Missing documentation for "getProcessorName". // src/GitLabDiscoveryProcessor.d.ts:21:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/lib/types.d.ts:48:1 - (ae-undocumented) Missing documentation for "GitLabGroupSamlIdentity". // src/lib/types.d.ts:234:5 - (ae-undocumented) Missing documentation for "group". // src/lib/types.d.ts:235:5 - (ae-undocumented) Missing documentation for "providerConfig". @@ -203,6 +201,4 @@ export interface UserTransformerOptions { // src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:21:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:31:5 - (ae-undocumented) Missing documentation for "getProviderName". // src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:32:5 - (ae-undocumented) Missing documentation for "connect". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gitlab/src/alpha.ts b/plugins/catalog-backend-module-gitlab/src/alpha.ts index 65f5b05b49..4c49bb9de9 100644 --- a/plugins/catalog-backend-module-gitlab/src/alpha.ts +++ b/plugins/catalog-backend-module-gitlab/src/alpha.ts @@ -14,4 +14,8 @@ * limitations under the License. */ -export { catalogModuleGitlabDiscoveryEntityProvider as default } from './module/catalogModuleGitlabDiscoveryEntityProvider'; +import { catalogModuleGitlabDiscoveryEntityProvider } from './module/catalogModuleGitlabDiscoveryEntityProvider'; + +/** @alpha */ +const _feature = catalogModuleGitlabDiscoveryEntityProvider; +export default _feature; diff --git a/plugins/catalog-backend-module-gitlab/src/index.ts b/plugins/catalog-backend-module-gitlab/src/index.ts index fa2de998b7..4f64e76395 100644 --- a/plugins/catalog-backend-module-gitlab/src/index.ts +++ b/plugins/catalog-backend-module-gitlab/src/index.ts @@ -14,18 +14,13 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A Backstage catalog backend module that helps integrate towards GitLab * * @packageDocumentation */ +export { catalogModuleGitlabDiscoveryEntityProvider as default } from './module/catalogModuleGitlabDiscoveryEntityProvider'; export { GitLabDiscoveryProcessor } from './GitLabDiscoveryProcessor'; export { GitlabDiscoveryEntityProvider, diff --git a/plugins/catalog-backend-module-gitlab/src/module/catalogModuleGitlabDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/module/catalogModuleGitlabDiscoveryEntityProvider.ts index bba8348a74..bbcbae0763 100644 --- a/plugins/catalog-backend-module-gitlab/src/module/catalogModuleGitlabDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/module/catalogModuleGitlabDiscoveryEntityProvider.ts @@ -25,7 +25,7 @@ import { GitlabDiscoveryEntityProvider } from '../providers'; /** * Registers the GitlabDiscoveryEntityProvider with the catalog processing extension point. * - * @alpha + * @public */ export const catalogModuleGitlabDiscoveryEntityProvider = createBackendModule({ diff --git a/plugins/catalog-backend-module-incremental-ingestion/report-alpha.api.md b/plugins/catalog-backend-module-incremental-ingestion/report-alpha.api.md index cfc4bca6f2..8f3a5fa780 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/report-alpha.api.md +++ b/plugins/catalog-backend-module-incremental-ingestion/report-alpha.api.md @@ -8,20 +8,24 @@ import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { IncrementalEntityProvider } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; import { IncrementalEntityProviderOptions } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; -// @alpha -const catalogModuleIncrementalIngestionEntityProvider: BackendFeature; -export default catalogModuleIncrementalIngestionEntityProvider; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; -// @alpha -export interface IncrementalIngestionProviderExtensionPoint { - addProvider(config: { - options: IncrementalEntityProviderOptions; - provider: IncrementalEntityProvider; - }): void; -} +// Warning: (ae-forgotten-export) The symbol "IncrementalIngestionProviderExtensionPoint_2" needs to be exported by the entry point alpha.d.ts +// +// @alpha (undocumented) +export type IncrementalIngestionProviderExtensionPoint = + IncrementalIngestionProviderExtensionPoint_2; -// @alpha -export const incrementalIngestionProvidersExtensionPoint: ExtensionPoint; +// @alpha (undocumented) +export const incrementalIngestionProvidersExtensionPoint: ExtensionPoint; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". +// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "IncrementalIngestionProviderExtensionPoint". +// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "incrementalIngestionProvidersExtensionPoint". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-incremental-ingestion/report.api.md b/plugins/catalog-backend-module-incremental-ingestion/report.api.md index 70a96ade80..4b7e473b48 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/report.api.md +++ b/plugins/catalog-backend-module-incremental-ingestion/report.api.md @@ -12,6 +12,9 @@ import type { DeferredEntity } from '@backstage/plugin-catalog-node'; import type { DurationObjectUnits } from 'luxon'; import { EventParams } from '@backstage/plugin-events-node'; import { EventSubscriber } from '@backstage/plugin-events-node'; +import { ExtensionPoint } from '@backstage/backend-plugin-api'; +import { IncrementalEntityProvider as IncrementalEntityProvider_2 } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; +import { IncrementalEntityProviderOptions as IncrementalEntityProviderOptions_2 } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; import type { Logger } from 'winston'; import type { PermissionEvaluator } from '@backstage/plugin-permission-common'; import type { PluginDatabaseManager } from '@backstage/backend-common'; @@ -19,6 +22,10 @@ import { Router } from 'express'; import { SchedulerService } from '@backstage/backend-plugin-api'; import { UrlReaderService } from '@backstage/backend-plugin-api'; +// @public +const catalogModuleIncrementalIngestionEntityProvider: BackendFeature; +export default catalogModuleIncrementalIngestionEntityProvider; + // @public export type EntityIteratorResult = | { @@ -32,10 +39,6 @@ export type EntityIteratorResult = cursor?: T; }; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public (undocumented) export class IncrementalCatalogBuilder { // (undocumented) @@ -90,6 +93,17 @@ export interface IncrementalEntityProviderOptions { restLength: DurationObjectUnits; } +// @public +export interface IncrementalIngestionProviderExtensionPoint { + addProvider(config: { + options: IncrementalEntityProviderOptions_2; + provider: IncrementalEntityProvider_2; + }): void; +} + +// @public +export const incrementalIngestionProvidersExtensionPoint: ExtensionPoint; + // @public (undocumented) export type PluginEnvironment = { logger: Logger; @@ -102,13 +116,9 @@ export type PluginEnvironment = { // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/service/IncrementalCatalogBuilder.d.ts:6:1 - (ae-undocumented) Missing documentation for "IncrementalCatalogBuilder". // src/service/IncrementalCatalogBuilder.d.ts:20:5 - (ae-undocumented) Missing documentation for "build". // src/service/IncrementalCatalogBuilder.d.ts:23:5 - (ae-undocumented) Missing documentation for "addIncrementalEntityProvider". // src/types.d.ts:106:1 - (ae-undocumented) Missing documentation for "IncrementalEntityProviderOptions". // src/types.d.ts:145:1 - (ae-undocumented) Missing documentation for "PluginEnvironment". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/alpha.ts b/plugins/catalog-backend-module-incremental-ingestion/src/alpha.ts index 01a9b25f7c..ee9c7ff415 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/alpha.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/alpha.ts @@ -14,5 +14,17 @@ * limitations under the License. */ -export * from './module'; -export { default } from './module'; +import { default as feature } from './module'; +import { + IncrementalIngestionProviderExtensionPoint as ExtensionPoint, + incrementalIngestionProvidersExtensionPoint as extensionPoint, +} from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; + +/** @alpha */ +export type IncrementalIngestionProviderExtensionPoint = ExtensionPoint; +/** @alpha */ +export const incrementalIngestionProvidersExtensionPoint = extensionPoint; diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/index.ts b/plugins/catalog-backend-module-incremental-ingestion/src/index.ts index fcd7670245..73c0e33946 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/index.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/index.ts @@ -14,18 +14,14 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * Provides efficient incremental ingestion of entities into the catalog. * * @packageDocumentation */ +export { default } from './module'; +export * from './module'; export * from './service'; export { type EntityIteratorResult, diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/module/catalogModuleIncrementalIngestionEntityProvider.ts b/plugins/catalog-backend-module-incremental-ingestion/src/module/catalogModuleIncrementalIngestionEntityProvider.ts index adb5ab6a04..8752bd3137 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/module/catalogModuleIncrementalIngestionEntityProvider.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/module/catalogModuleIncrementalIngestionEntityProvider.ts @@ -27,7 +27,7 @@ import { import { WrapperProviders } from './WrapperProviders'; /** - * @alpha + * @public * Interface for {@link incrementalIngestionProvidersExtensionPoint}. */ export interface IncrementalIngestionProviderExtensionPoint { @@ -39,7 +39,7 @@ export interface IncrementalIngestionProviderExtensionPoint { } /** - * @alpha + * @public * * Extension point for registering incremental ingestion providers. * The `catalogModuleIncrementalIngestionEntityProvider` must be installed for these providers to work. @@ -80,7 +80,7 @@ export const incrementalIngestionProvidersExtensionPoint = /** * Registers the incremental entity provider with the catalog processing extension point. * - * @alpha + * @public */ export const catalogModuleIncrementalIngestionEntityProvider = createBackendModule({ diff --git a/plugins/catalog-backend-module-msgraph/report-alpha.api.md b/plugins/catalog-backend-module-msgraph/report-alpha.api.md index 8129aec50f..416c335bff 100644 --- a/plugins/catalog-backend-module-msgraph/report-alpha.api.md +++ b/plugins/catalog-backend-module-msgraph/report-alpha.api.md @@ -10,32 +10,24 @@ import { OrganizationTransformer } from '@backstage/plugin-catalog-backend-modul import { ProviderConfigTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; import { UserTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; -// @alpha -const catalogModuleMicrosoftGraphOrgEntityProvider: BackendFeature; -export default catalogModuleMicrosoftGraphOrgEntityProvider; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; -// @alpha -export const microsoftGraphOrgEntityProviderTransformExtensionPoint: ExtensionPoint; +// Warning: (ae-forgotten-export) The symbol "MicrosoftGraphOrgEntityProviderTransformsExtensionPoint_2" needs to be exported by the entry point alpha.d.ts +// +// @alpha (undocumented) +export const microsoftGraphOrgEntityProviderTransformExtensionPoint: ExtensionPoint; -// @alpha -export interface MicrosoftGraphOrgEntityProviderTransformsExtensionPoint { - setGroupTransformer( - transformer: GroupTransformer | Record, - ): void; - setOrganizationTransformer( - transformer: - | OrganizationTransformer - | Record, - ): void; - setProviderConfigTransformer( - transformer: - | ProviderConfigTransformer - | Record, - ): void; - setUserTransformer( - transformer: UserTransformer | Record, - ): void; -} +// @alpha (undocumented) +export type MicrosoftGraphOrgEntityProviderTransformsExtensionPoint = + MicrosoftGraphOrgEntityProviderTransformsExtensionPoint_2; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". +// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "MicrosoftGraphOrgEntityProviderTransformsExtensionPoint". +// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "microsoftGraphOrgEntityProviderTransformExtensionPoint". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-msgraph/report.api.md b/plugins/catalog-backend-module-msgraph/report.api.md index 3e29ed76df..4d7c0966a5 100644 --- a/plugins/catalog-backend-module-msgraph/report.api.md +++ b/plugins/catalog-backend-module-msgraph/report.api.md @@ -9,16 +9,25 @@ import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node'; import { Config } from '@backstage/config'; import { EntityProvider } from '@backstage/plugin-catalog-node'; import { EntityProviderConnection } from '@backstage/plugin-catalog-node'; +import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { GroupEntity } from '@backstage/catalog-model'; +import { GroupTransformer as GroupTransformer_2 } from '@backstage/plugin-catalog-backend-module-msgraph'; import { LocationSpec } from '@backstage/plugin-catalog-common'; import { LoggerService } from '@backstage/backend-plugin-api'; import * as MicrosoftGraph from '@microsoft/microsoft-graph-types'; +import { OrganizationTransformer as OrganizationTransformer_2 } from '@backstage/plugin-catalog-backend-module-msgraph'; +import { ProviderConfigTransformer as ProviderConfigTransformer_2 } from '@backstage/plugin-catalog-backend-module-msgraph'; import { Response as Response_2 } from 'node-fetch'; import { SchedulerService } from '@backstage/backend-plugin-api'; import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api'; import { SchedulerServiceTaskScheduleDefinition } from '@backstage/backend-plugin-api'; import { TokenCredential } from '@azure/identity'; import { UserEntity } from '@backstage/catalog-model'; +import { UserTransformer as UserTransformer_2 } from '@backstage/plugin-catalog-backend-module-msgraph'; + +// @public +const catalogModuleMicrosoftGraphOrgEntityProvider: BackendFeature; +export default catalogModuleMicrosoftGraphOrgEntityProvider; // @public export function defaultGroupTransformer( @@ -37,10 +46,6 @@ export function defaultUserTransformer( userPhoto?: string, ): Promise; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public export type GroupMember = | (MicrosoftGraph.Group & { @@ -172,6 +177,29 @@ export type MicrosoftGraphOrgEntityProviderOptions = | Record; }; +// @public +export const microsoftGraphOrgEntityProviderTransformExtensionPoint: ExtensionPoint; + +// @public +export interface MicrosoftGraphOrgEntityProviderTransformsExtensionPoint { + setGroupTransformer( + transformer: GroupTransformer_2 | Record, + ): void; + setOrganizationTransformer( + transformer: + | OrganizationTransformer_2 + | Record, + ): void; + setProviderConfigTransformer( + transformer: + | ProviderConfigTransformer_2 + | Record, + ): void; + setUserTransformer( + transformer: UserTransformer_2 | Record, + ): void; +} + // @public @deprecated export class MicrosoftGraphOrgReaderProcessor implements CatalogProcessor { constructor(options: { @@ -298,8 +326,6 @@ export type UserTransformer = ( // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/microsoftGraph/client.d.ts:109:5 - (ae-undocumented) Missing documentation for "getUserPhoto". // src/microsoftGraph/client.d.ts:129:5 - (ae-undocumented) Missing documentation for "getGroupPhoto". // src/microsoftGraph/client.d.ts:176:5 - (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-catalog-backend-module-msgraph" does not have an export "entityName" @@ -307,6 +333,4 @@ export type UserTransformer = ( // src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:31:5 - (ae-undocumented) Missing documentation for "getProcessorName". // src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:32:5 - (ae-undocumented) Missing documentation for "readLocation". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-msgraph/src/alpha.ts b/plugins/catalog-backend-module-msgraph/src/alpha.ts index 01a9b25f7c..2c0cfe2fb4 100644 --- a/plugins/catalog-backend-module-msgraph/src/alpha.ts +++ b/plugins/catalog-backend-module-msgraph/src/alpha.ts @@ -14,5 +14,19 @@ * limitations under the License. */ -export * from './module'; -export { default } from './module'; +import { default as feature } from './module'; +import { + MicrosoftGraphOrgEntityProviderTransformsExtensionPoint as ExtensionPoint, + microsoftGraphOrgEntityProviderTransformExtensionPoint as extensionPoint, +} from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; + +/** @alpha */ +export type MicrosoftGraphOrgEntityProviderTransformsExtensionPoint = + ExtensionPoint; +/** @alpha */ +export const microsoftGraphOrgEntityProviderTransformExtensionPoint = + extensionPoint; diff --git a/plugins/catalog-backend-module-msgraph/src/index.ts b/plugins/catalog-backend-module-msgraph/src/index.ts index 4dd70d32e8..bd7e72479b 100644 --- a/plugins/catalog-backend-module-msgraph/src/index.ts +++ b/plugins/catalog-backend-module-msgraph/src/index.ts @@ -14,17 +14,13 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A Backstage catalog backend module that helps integrate towards Microsoft Graph * * @packageDocumentation */ +export { default } from './module'; +export * from './module'; export * from './microsoftGraph'; export * from './processors'; diff --git a/plugins/catalog-backend-module-msgraph/src/module/catalogModuleMicrosoftGraphOrgEntityProvider.ts b/plugins/catalog-backend-module-msgraph/src/module/catalogModuleMicrosoftGraphOrgEntityProvider.ts index e1a15a3468..262c56cf3f 100644 --- a/plugins/catalog-backend-module-msgraph/src/module/catalogModuleMicrosoftGraphOrgEntityProvider.ts +++ b/plugins/catalog-backend-module-msgraph/src/module/catalogModuleMicrosoftGraphOrgEntityProvider.ts @@ -31,7 +31,7 @@ import { MicrosoftGraphOrgEntityProvider } from '../processors'; /** * Interface for {@link microsoftGraphOrgEntityProviderTransformExtensionPoint}. * - * @alpha + * @public */ export interface MicrosoftGraphOrgEntityProviderTransformsExtensionPoint { /** @@ -76,7 +76,7 @@ export interface MicrosoftGraphOrgEntityProviderTransformsExtensionPoint { /** * Extension point used to customize the transforms used by the module. * - * @alpha + * @public */ export const microsoftGraphOrgEntityProviderTransformExtensionPoint = createExtensionPoint( @@ -88,7 +88,7 @@ export const microsoftGraphOrgEntityProviderTransformExtensionPoint = /** * Registers the MicrosoftGraphOrgEntityProvider with the catalog processing extension point. * - * @alpha + * @public */ export const catalogModuleMicrosoftGraphOrgEntityProvider = createBackendModule( { From 7138ee6f41067a2159af7b8d1d5d28bb2312e5b0 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 13 Oct 2024 11:31:27 +0200 Subject: [PATCH 119/268] plugins/events-backend-module-*: flip around alpha exports to stable Signed-off-by: Patrik Oldsberg --- .../report-alpha.api.md | 10 +++++++--- .../events-backend-module-aws-sqs/report.api.md | 10 +++------- .../events-backend-module-aws-sqs/src/alpha.ts | 6 +++++- .../events-backend-module-aws-sqs/src/index.ts | 7 +------ .../eventsModuleAwsSqsConsumingEventPublisher.ts | 2 +- .../report-alpha.api.md | 15 +++++++++++---- plugins/events-backend-module-azure/report.api.md | 10 +++------- plugins/events-backend-module-azure/src/alpha.ts | 9 +++++++-- plugins/events-backend-module-azure/src/index.ts | 7 +------ .../service/eventsModuleAzureDevOpsEventRouter.ts | 2 +- .../report-alpha.api.md | 15 +++++++++++---- .../report.api.md | 10 +++------- .../src/alpha.ts | 9 +++++++-- .../src/index.ts | 7 +------ .../eventsModuleBitbucketCloudEventRouter.ts | 2 +- .../report-alpha.api.md | 15 +++++++++++---- .../events-backend-module-gerrit/report.api.md | 10 +++------- plugins/events-backend-module-gerrit/src/alpha.ts | 9 +++++++-- plugins/events-backend-module-gerrit/src/index.ts | 7 +------ .../src/service/eventsModuleGerritEventRouter.ts | 2 +- 20 files changed, 86 insertions(+), 78 deletions(-) diff --git a/plugins/events-backend-module-aws-sqs/report-alpha.api.md b/plugins/events-backend-module-aws-sqs/report-alpha.api.md index 1e8ae5c690..38ce74daa9 100644 --- a/plugins/events-backend-module-aws-sqs/report-alpha.api.md +++ b/plugins/events-backend-module-aws-sqs/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const eventsModuleAwsSqsConsumingEventPublisher: BackendFeature; -export default eventsModuleAwsSqsConsumingEventPublisher; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-aws-sqs/report.api.md b/plugins/events-backend-module-aws-sqs/report.api.md index 6957a3036d..5363884ea9 100644 --- a/plugins/events-backend-module-aws-sqs/report.api.md +++ b/plugins/events-backend-module-aws-sqs/report.api.md @@ -22,16 +22,12 @@ export class AwsSqsConsumingEventPublisher { start(): Promise; } -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const eventsModuleAwsSqsConsumingEventPublisher: BackendFeature; +export default eventsModuleAwsSqsConsumingEventPublisher; // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/publisher/AwsSqsConsumingEventPublisher.d.ts:21:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/publisher/AwsSqsConsumingEventPublisher.d.ts:28:5 - (ae-undocumented) Missing documentation for "start". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-aws-sqs/src/alpha.ts b/plugins/events-backend-module-aws-sqs/src/alpha.ts index 3107411645..cbbbf1a62d 100644 --- a/plugins/events-backend-module-aws-sqs/src/alpha.ts +++ b/plugins/events-backend-module-aws-sqs/src/alpha.ts @@ -14,4 +14,8 @@ * limitations under the License. */ -export { eventsModuleAwsSqsConsumingEventPublisher as default } from './service/eventsModuleAwsSqsConsumingEventPublisher'; +import { eventsModuleAwsSqsConsumingEventPublisher } from './service/eventsModuleAwsSqsConsumingEventPublisher'; + +/** @alpha */ +const _feature = eventsModuleAwsSqsConsumingEventPublisher; +export default _feature; diff --git a/plugins/events-backend-module-aws-sqs/src/index.ts b/plugins/events-backend-module-aws-sqs/src/index.ts index a16bc9be04..f0080d4ed5 100644 --- a/plugins/events-backend-module-aws-sqs/src/index.ts +++ b/plugins/events-backend-module-aws-sqs/src/index.ts @@ -14,12 +14,6 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * The module "sqs" for the Backstage backend plugin "events" * adding an AWS SQS-based publisher, @@ -29,4 +23,5 @@ export default _feature; * @packageDocumentation */ +export { eventsModuleAwsSqsConsumingEventPublisher as default } from './service/eventsModuleAwsSqsConsumingEventPublisher'; export { AwsSqsConsumingEventPublisher } from './publisher/AwsSqsConsumingEventPublisher'; diff --git a/plugins/events-backend-module-aws-sqs/src/service/eventsModuleAwsSqsConsumingEventPublisher.ts b/plugins/events-backend-module-aws-sqs/src/service/eventsModuleAwsSqsConsumingEventPublisher.ts index ea0f094bee..de3b3eba9e 100644 --- a/plugins/events-backend-module-aws-sqs/src/service/eventsModuleAwsSqsConsumingEventPublisher.ts +++ b/plugins/events-backend-module-aws-sqs/src/service/eventsModuleAwsSqsConsumingEventPublisher.ts @@ -24,7 +24,7 @@ import { AwsSqsConsumingEventPublisher } from '../publisher/AwsSqsConsumingEvent /** * AWS SQS module for the Events plugin. * - * @alpha + * @public */ export const eventsModuleAwsSqsConsumingEventPublisher = createBackendModule({ pluginId: 'events', diff --git a/plugins/events-backend-module-azure/report-alpha.api.md b/plugins/events-backend-module-azure/report-alpha.api.md index 861ff95bcd..d9f3a6f000 100644 --- a/plugins/events-backend-module-azure/report-alpha.api.md +++ b/plugins/events-backend-module-azure/report-alpha.api.md @@ -5,10 +5,17 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const eventsModuleAzureDevOpsEventRouter: BackendFeature; -export default eventsModuleAzureDevOpsEventRouter; -export { eventsModuleAzureDevOpsEventRouter }; +// @alpha (undocumented) +export const eventsModuleAzureDevOpsEventRouter: BackendFeature; + +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/alpha.d.ts:5:22 - (ae-undocumented) Missing documentation for "eventsModuleAzureDevOpsEventRouter". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-azure/report.api.md b/plugins/events-backend-module-azure/report.api.md index 0109bad0e3..d89a5608e3 100644 --- a/plugins/events-backend-module-azure/report.api.md +++ b/plugins/events-backend-module-azure/report.api.md @@ -17,16 +17,12 @@ export class AzureDevOpsEventRouter extends SubTopicEventRouter { protected getSubscriberId(): string; } -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const eventsModuleAzureDevOpsEventRouter: BackendFeature; +export default eventsModuleAzureDevOpsEventRouter; // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/router/AzureDevOpsEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". // src/router/AzureDevOpsEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-azure/src/alpha.ts b/plugins/events-backend-module-azure/src/alpha.ts index 4de53df42a..b407ccded4 100644 --- a/plugins/events-backend-module-azure/src/alpha.ts +++ b/plugins/events-backend-module-azure/src/alpha.ts @@ -14,5 +14,10 @@ * limitations under the License. */ -export { eventsModuleAzureDevOpsEventRouter } from './service/eventsModuleAzureDevOpsEventRouter'; -export { eventsModuleAzureDevOpsEventRouter as default } from './service/eventsModuleAzureDevOpsEventRouter'; +import { eventsModuleAzureDevOpsEventRouter as feature } from './service/eventsModuleAzureDevOpsEventRouter'; + +/** @alpha */ +const _feature = feature; +export default _feature; +/** @alpha */ +export const eventsModuleAzureDevOpsEventRouter = _feature; diff --git a/plugins/events-backend-module-azure/src/index.ts b/plugins/events-backend-module-azure/src/index.ts index 523673c562..8df8e5a171 100644 --- a/plugins/events-backend-module-azure/src/index.ts +++ b/plugins/events-backend-module-azure/src/index.ts @@ -14,12 +14,6 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * The module "azure" for the Backstage backend plugin "events-backend" * adding an event router for Azure DevOps. @@ -27,4 +21,5 @@ export default _feature; * @packageDocumentation */ +export { eventsModuleAzureDevOpsEventRouter as default } from './service/eventsModuleAzureDevOpsEventRouter'; export { AzureDevOpsEventRouter } from './router/AzureDevOpsEventRouter'; diff --git a/plugins/events-backend-module-azure/src/service/eventsModuleAzureDevOpsEventRouter.ts b/plugins/events-backend-module-azure/src/service/eventsModuleAzureDevOpsEventRouter.ts index 9741015477..02322d7782 100644 --- a/plugins/events-backend-module-azure/src/service/eventsModuleAzureDevOpsEventRouter.ts +++ b/plugins/events-backend-module-azure/src/service/eventsModuleAzureDevOpsEventRouter.ts @@ -23,7 +23,7 @@ import { AzureDevOpsEventRouter } from '../router/AzureDevOpsEventRouter'; * * Registers the `AzureDevOpsEventRouter`. * - * @alpha + * @public */ export const eventsModuleAzureDevOpsEventRouter = createBackendModule({ pluginId: 'events', diff --git a/plugins/events-backend-module-bitbucket-cloud/report-alpha.api.md b/plugins/events-backend-module-bitbucket-cloud/report-alpha.api.md index 6ee4fab225..b081759920 100644 --- a/plugins/events-backend-module-bitbucket-cloud/report-alpha.api.md +++ b/plugins/events-backend-module-bitbucket-cloud/report-alpha.api.md @@ -5,10 +5,17 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const eventsModuleBitbucketCloudEventRouter: BackendFeature; -export default eventsModuleBitbucketCloudEventRouter; -export { eventsModuleBitbucketCloudEventRouter }; +// @alpha (undocumented) +export const eventsModuleBitbucketCloudEventRouter: BackendFeature; + +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/alpha.d.ts:5:22 - (ae-undocumented) Missing documentation for "eventsModuleBitbucketCloudEventRouter". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-bitbucket-cloud/report.api.md b/plugins/events-backend-module-bitbucket-cloud/report.api.md index 08c953f96b..06bd71e7f7 100644 --- a/plugins/events-backend-module-bitbucket-cloud/report.api.md +++ b/plugins/events-backend-module-bitbucket-cloud/report.api.md @@ -17,16 +17,12 @@ export class BitbucketCloudEventRouter extends SubTopicEventRouter { protected getSubscriberId(): string; } -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const eventsModuleBitbucketCloudEventRouter: BackendFeature; +export default eventsModuleBitbucketCloudEventRouter; // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/router/BitbucketCloudEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". // src/router/BitbucketCloudEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-bitbucket-cloud/src/alpha.ts b/plugins/events-backend-module-bitbucket-cloud/src/alpha.ts index 1f0e09a653..e3fa541842 100644 --- a/plugins/events-backend-module-bitbucket-cloud/src/alpha.ts +++ b/plugins/events-backend-module-bitbucket-cloud/src/alpha.ts @@ -14,5 +14,10 @@ * limitations under the License. */ -export { eventsModuleBitbucketCloudEventRouter } from './service/eventsModuleBitbucketCloudEventRouter'; -export { eventsModuleBitbucketCloudEventRouter as default } from './service/eventsModuleBitbucketCloudEventRouter'; +import { eventsModuleBitbucketCloudEventRouter as feature } from './service/eventsModuleBitbucketCloudEventRouter'; + +/** @alpha */ +const _feature = feature; +export default _feature; +/** @alpha */ +export const eventsModuleBitbucketCloudEventRouter = _feature; diff --git a/plugins/events-backend-module-bitbucket-cloud/src/index.ts b/plugins/events-backend-module-bitbucket-cloud/src/index.ts index d7f0cfa4d7..a67500ab19 100644 --- a/plugins/events-backend-module-bitbucket-cloud/src/index.ts +++ b/plugins/events-backend-module-bitbucket-cloud/src/index.ts @@ -14,12 +14,6 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * The module "bitbucket-cloud" for the Backstage backend plugin "events-backend" * adding an event router for Bitbucket Cloud. @@ -27,4 +21,5 @@ export default _feature; * @packageDocumentation */ +export { eventsModuleBitbucketCloudEventRouter as default } from './service/eventsModuleBitbucketCloudEventRouter'; export { BitbucketCloudEventRouter } from './router/BitbucketCloudEventRouter'; diff --git a/plugins/events-backend-module-bitbucket-cloud/src/service/eventsModuleBitbucketCloudEventRouter.ts b/plugins/events-backend-module-bitbucket-cloud/src/service/eventsModuleBitbucketCloudEventRouter.ts index 648d6c67fb..4628d5cb0b 100644 --- a/plugins/events-backend-module-bitbucket-cloud/src/service/eventsModuleBitbucketCloudEventRouter.ts +++ b/plugins/events-backend-module-bitbucket-cloud/src/service/eventsModuleBitbucketCloudEventRouter.ts @@ -23,7 +23,7 @@ import { BitbucketCloudEventRouter } from '../router/BitbucketCloudEventRouter'; * * Registers the `BitbucketCloudEventRouter`. * - * @alpha + * @public */ export const eventsModuleBitbucketCloudEventRouter = createBackendModule({ pluginId: 'events', diff --git a/plugins/events-backend-module-gerrit/report-alpha.api.md b/plugins/events-backend-module-gerrit/report-alpha.api.md index 83b2fdff98..e37ca3050a 100644 --- a/plugins/events-backend-module-gerrit/report-alpha.api.md +++ b/plugins/events-backend-module-gerrit/report-alpha.api.md @@ -5,10 +5,17 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const eventsModuleGerritEventRouter: BackendFeature; -export default eventsModuleGerritEventRouter; -export { eventsModuleGerritEventRouter }; +// @alpha (undocumented) +export const eventsModuleGerritEventRouter: BackendFeature; + +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". +// src/alpha.d.ts:5:22 - (ae-undocumented) Missing documentation for "eventsModuleGerritEventRouter". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gerrit/report.api.md b/plugins/events-backend-module-gerrit/report.api.md index 58981896a9..1206a50c88 100644 --- a/plugins/events-backend-module-gerrit/report.api.md +++ b/plugins/events-backend-module-gerrit/report.api.md @@ -8,9 +8,9 @@ import { EventParams } from '@backstage/plugin-events-node'; import { EventsService } from '@backstage/plugin-events-node'; import { SubTopicEventRouter } from '@backstage/plugin-events-node'; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const eventsModuleGerritEventRouter: BackendFeature; +export default eventsModuleGerritEventRouter; // @public export class GerritEventRouter extends SubTopicEventRouter { @@ -23,10 +23,6 @@ export class GerritEventRouter extends SubTopicEventRouter { // Warnings were encountered during analysis: // -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file // src/router/GerritEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". // src/router/GerritEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gerrit/src/alpha.ts b/plugins/events-backend-module-gerrit/src/alpha.ts index 9c1eea0b75..6222b3e534 100644 --- a/plugins/events-backend-module-gerrit/src/alpha.ts +++ b/plugins/events-backend-module-gerrit/src/alpha.ts @@ -14,5 +14,10 @@ * limitations under the License. */ -export { eventsModuleGerritEventRouter } from './service/eventsModuleGerritEventRouter'; -export { eventsModuleGerritEventRouter as default } from './service/eventsModuleGerritEventRouter'; +import { eventsModuleGerritEventRouter as feature } from './service/eventsModuleGerritEventRouter'; + +/** @alpha */ +const _feature = feature; +export default _feature; +/** @alpha */ +export const eventsModuleGerritEventRouter = _feature; diff --git a/plugins/events-backend-module-gerrit/src/index.ts b/plugins/events-backend-module-gerrit/src/index.ts index 4f2ba573ba..fdf3b53162 100644 --- a/plugins/events-backend-module-gerrit/src/index.ts +++ b/plugins/events-backend-module-gerrit/src/index.ts @@ -14,12 +14,6 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * The module `gerrit` for the Backstage backend plugin "events-backend" * adding an event router for Gerrit. @@ -27,4 +21,5 @@ export default _feature; * @packageDocumentation */ +export { eventsModuleGerritEventRouter as default } from './service/eventsModuleGerritEventRouter'; export { GerritEventRouter } from './router/GerritEventRouter'; diff --git a/plugins/events-backend-module-gerrit/src/service/eventsModuleGerritEventRouter.ts b/plugins/events-backend-module-gerrit/src/service/eventsModuleGerritEventRouter.ts index 8d9792c4f4..c218f9c562 100644 --- a/plugins/events-backend-module-gerrit/src/service/eventsModuleGerritEventRouter.ts +++ b/plugins/events-backend-module-gerrit/src/service/eventsModuleGerritEventRouter.ts @@ -23,7 +23,7 @@ import { GerritEventRouter } from '../router/GerritEventRouter'; * * Registers the `GerritEventRouter`. * - * @alpha + * @public */ export const eventsModuleGerritEventRouter = createBackendModule({ pluginId: 'events', From b071eec7d7e93f7bf59eb4f9a78e9209e1e844c4 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 13 Oct 2024 12:58:37 +0200 Subject: [PATCH 120/268] plugins/search-backend-module-*: flip around alpha exports to stable Signed-off-by: Patrik Oldsberg --- .../report-alpha.api.md | 24 ++-- .../report.api.md | 19 ++- .../src/alpha.ts | 103 ++----------- .../src/index.ts | 8 +- .../src/{alpha.test.ts => module.test.ts} | 2 +- .../src/module.ts | 109 ++++++++++++++ .../report-alpha.api.md | 23 +-- .../report.api.md | 25 ++-- .../src/alpha.ts | 84 ++--------- .../src/index.ts | 8 +- .../src/module.ts | 90 ++++++++++++ .../report-alpha.api.md | 10 +- .../report.api.md | 7 +- .../src/alpha.ts | 69 +-------- .../src/index.ts | 7 +- .../src/{alpha.test.ts => module.test.ts} | 2 +- .../src/module.ts | 80 +++++++++++ .../report-alpha.api.md | 10 +- .../search-backend-module-pg/report.api.md | 12 +- plugins/search-backend-module-pg/src/alpha.ts | 45 +----- plugins/search-backend-module-pg/src/index.ts | 7 +- .../search-backend-module-pg/src/module.ts | 54 +++++++ .../report-alpha.api.md | 30 ++-- .../report.api.md | 28 +++- .../src/alpha.ts | 127 ++-------------- .../src/index.ts | 8 +- .../src/{alpha.test.ts => module.test.ts} | 2 +- .../src/module.ts | 135 ++++++++++++++++++ 28 files changed, 640 insertions(+), 488 deletions(-) rename plugins/search-backend-module-catalog/src/{alpha.test.ts => module.test.ts} (97%) create mode 100644 plugins/search-backend-module-catalog/src/module.ts create mode 100644 plugins/search-backend-module-elasticsearch/src/module.ts rename plugins/search-backend-module-explore/src/{alpha.test.ts => module.test.ts} (97%) create mode 100644 plugins/search-backend-module-explore/src/module.ts create mode 100644 plugins/search-backend-module-pg/src/module.ts rename plugins/search-backend-module-techdocs/src/{alpha.test.ts => module.test.ts} (97%) create mode 100644 plugins/search-backend-module-techdocs/src/module.ts diff --git a/plugins/search-backend-module-catalog/report-alpha.api.md b/plugins/search-backend-module-catalog/report-alpha.api.md index e5080fae35..8a91ccdb5e 100644 --- a/plugins/search-backend-module-catalog/report-alpha.api.md +++ b/plugins/search-backend-module-catalog/report-alpha.api.md @@ -7,17 +7,23 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogCollatorEntityTransformer } from '@backstage/plugin-search-backend-module-catalog'; import { ExtensionPoint } from '@backstage/backend-plugin-api'; -// @alpha -export type CatalogCollatorExtensionPoint = { - setEntityTransformer(transformer: CatalogCollatorEntityTransformer): void; -}; +// Warning: (ae-forgotten-export) The symbol "CatalogCollatorExtensionPoint_2" needs to be exported by the entry point alpha.d.ts +// +// @alpha (undocumented) +export type CatalogCollatorExtensionPoint = CatalogCollatorExtensionPoint_2; -// @alpha -export const catalogCollatorExtensionPoint: ExtensionPoint; +// @alpha (undocumented) +export const catalogCollatorExtensionPoint: ExtensionPoint; -// @alpha -const _default: BackendFeature; -export default _default; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". +// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "CatalogCollatorExtensionPoint". +// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "catalogCollatorExtensionPoint". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-catalog/report.api.md b/plugins/search-backend-module-catalog/report.api.md index 63ecce93e1..f20907494e 100644 --- a/plugins/search-backend-module-catalog/report.api.md +++ b/plugins/search-backend-module-catalog/report.api.md @@ -8,11 +8,13 @@ import { AuthService } from '@backstage/backend-plugin-api'; import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; +import { CatalogCollatorEntityTransformer as CatalogCollatorEntityTransformer_2 } from '@backstage/plugin-search-backend-module-catalog'; import { CatalogEntityDocument } from '@backstage/plugin-catalog-common'; import { Config } from '@backstage/config'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; import { Entity } from '@backstage/catalog-model'; +import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { GetEntitiesRequest } from '@backstage/catalog-client'; import { Permission } from '@backstage/plugin-permission-common'; import { Readable } from 'stream'; @@ -23,6 +25,18 @@ export type CatalogCollatorEntityTransformer = ( entity: Entity, ) => Omit; +// @public +export type CatalogCollatorExtensionPoint = { + setEntityTransformer(transformer: CatalogCollatorEntityTransformer_2): void; +}; + +// @public +export const catalogCollatorExtensionPoint: ExtensionPoint; + +// @public +const _default: BackendFeature; +export default _default; + // @public (undocumented) export const defaultCatalogCollatorEntityTransformer: CatalogCollatorEntityTransformer; @@ -53,10 +67,6 @@ export type DefaultCatalogCollatorFactoryOptions = { entityTransformer?: CatalogCollatorEntityTransformer; }; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // Warnings were encountered during analysis: // // src/collators/CatalogCollatorEntityTransformer.d.ts:4:1 - (ae-undocumented) Missing documentation for "CatalogCollatorEntityTransformer". @@ -66,5 +76,4 @@ export default _feature; // src/collators/DefaultCatalogCollatorFactory.d.ts:51:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/collators/DefaultCatalogCollatorFactory.d.ts:53:5 - (ae-undocumented) Missing documentation for "getCollator". // src/collators/defaultCatalogCollatorEntityTransformer.d.ts:3:22 - (ae-undocumented) Missing documentation for "defaultCatalogCollatorEntityTransformer". -// src/index.d.ts:7:15 - (ae-undocumented) Missing documentation for "_feature". ``` diff --git a/plugins/search-backend-module-catalog/src/alpha.ts b/plugins/search-backend-module-catalog/src/alpha.ts index 03e5bcb226..b5fbb5e0c6 100644 --- a/plugins/search-backend-module-catalog/src/alpha.ts +++ b/plugins/search-backend-module-catalog/src/alpha.ts @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Backstage Authors + * Copyright 2024 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,96 +14,17 @@ * limitations under the License. */ -/** - * @packageDocumentation - * A module for the search backend that exports Catalog modules. - */ - import { - coreServices, - createBackendModule, - createExtensionPoint, -} from '@backstage/backend-plugin-api'; -import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; -import { - CatalogCollatorEntityTransformer, - DefaultCatalogCollatorFactory, -} from '@backstage/plugin-search-backend-module-catalog'; -import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; -import { readScheduleConfigOptions } from './collators/config'; + default as feature, + CatalogCollatorExtensionPoint as ExtensionPoint, + catalogCollatorExtensionPoint as extensionPoint, +} from './module'; -/** - * Options for {@link catalogCollatorExtensionPoint}. - * - * @alpha - */ -export type CatalogCollatorExtensionPoint = { - /** - * Allows you to customize how entities are shaped into documents. - */ - setEntityTransformer(transformer: CatalogCollatorEntityTransformer): void; -}; +/** @alpha */ +const _feature = feature; +export default _feature; -/** - * Extension point for customizing how catalog entities are shaped into - * documents for the search backend. - * - * @alpha - */ -export const catalogCollatorExtensionPoint = - createExtensionPoint({ - id: 'search.catalogCollator.extension', - }); - -/** - * Search backend module for the Catalog index. - * - * @alpha - */ -export default createBackendModule({ - pluginId: 'search', - moduleId: 'catalog-collator', - register(env) { - let entityTransformer: CatalogCollatorEntityTransformer | undefined; - - env.registerExtensionPoint(catalogCollatorExtensionPoint, { - setEntityTransformer(transformer) { - if (entityTransformer) { - throw new Error('setEntityTransformer can only be called once'); - } - entityTransformer = transformer; - }, - }); - - env.registerInit({ - deps: { - auth: coreServices.auth, - config: coreServices.rootConfig, - discovery: coreServices.discovery, - scheduler: coreServices.scheduler, - indexRegistry: searchIndexRegistryExtensionPoint, - catalog: catalogServiceRef, - }, - async init({ - auth, - config, - discovery, - scheduler, - indexRegistry, - catalog, - }) { - indexRegistry.addCollator({ - schedule: scheduler.createScheduledTaskRunner( - readScheduleConfigOptions(config), - ), - factory: DefaultCatalogCollatorFactory.fromConfig(config, { - auth, - entityTransformer, - discovery, - catalogClient: catalog, - }), - }); - }, - }); - }, -}); +/** @alpha */ +export type CatalogCollatorExtensionPoint = ExtensionPoint; +/** @alpha */ +export const catalogCollatorExtensionPoint = extensionPoint; diff --git a/plugins/search-backend-module-catalog/src/index.ts b/plugins/search-backend-module-catalog/src/index.ts index 91726fb716..3e0ec59cc0 100644 --- a/plugins/search-backend-module-catalog/src/index.ts +++ b/plugins/search-backend-module-catalog/src/index.ts @@ -14,15 +14,11 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - /** * @packageDocumentation * A module for the search backend that exports Catalog modules. */ +export * from './module'; +export { default } from './module'; export * from './collators'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/search-backend-module-catalog/src/alpha.test.ts b/plugins/search-backend-module-catalog/src/module.test.ts similarity index 97% rename from plugins/search-backend-module-catalog/src/alpha.test.ts rename to plugins/search-backend-module-catalog/src/module.test.ts index 94c585161b..d05c96c8ec 100644 --- a/plugins/search-backend-module-catalog/src/alpha.test.ts +++ b/plugins/search-backend-module-catalog/src/module.test.ts @@ -16,7 +16,7 @@ import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; -import searchModuleCatalogCollator from './alpha'; +import searchModuleCatalogCollator from './module'; describe('searchModuleCatalogCollator', () => { it('should register the catalog collator to the search index registry extension point with factory and schedule', async () => { diff --git a/plugins/search-backend-module-catalog/src/module.ts b/plugins/search-backend-module-catalog/src/module.ts new file mode 100644 index 0000000000..3256a2b32f --- /dev/null +++ b/plugins/search-backend-module-catalog/src/module.ts @@ -0,0 +1,109 @@ +/* + * Copyright 2023 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. + */ + +/** + * @packageDocumentation + * A module for the search backend that exports Catalog modules. + */ + +import { + coreServices, + createBackendModule, + createExtensionPoint, +} from '@backstage/backend-plugin-api'; +import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; +import { + CatalogCollatorEntityTransformer, + DefaultCatalogCollatorFactory, +} from '@backstage/plugin-search-backend-module-catalog'; +import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; +import { readScheduleConfigOptions } from './collators/config'; + +/** + * Options for {@link catalogCollatorExtensionPoint}. + * + * @public + */ +export type CatalogCollatorExtensionPoint = { + /** + * Allows you to customize how entities are shaped into documents. + */ + setEntityTransformer(transformer: CatalogCollatorEntityTransformer): void; +}; + +/** + * Extension point for customizing how catalog entities are shaped into + * documents for the search backend. + * + * @public + */ +export const catalogCollatorExtensionPoint = + createExtensionPoint({ + id: 'search.catalogCollator.extension', + }); + +/** + * Search backend module for the Catalog index. + * + * @public + */ +export default createBackendModule({ + pluginId: 'search', + moduleId: 'catalog-collator', + register(env) { + let entityTransformer: CatalogCollatorEntityTransformer | undefined; + + env.registerExtensionPoint(catalogCollatorExtensionPoint, { + setEntityTransformer(transformer) { + if (entityTransformer) { + throw new Error('setEntityTransformer can only be called once'); + } + entityTransformer = transformer; + }, + }); + + env.registerInit({ + deps: { + auth: coreServices.auth, + config: coreServices.rootConfig, + discovery: coreServices.discovery, + scheduler: coreServices.scheduler, + indexRegistry: searchIndexRegistryExtensionPoint, + catalog: catalogServiceRef, + }, + async init({ + auth, + config, + discovery, + scheduler, + indexRegistry, + catalog, + }) { + indexRegistry.addCollator({ + schedule: scheduler.createScheduledTaskRunner( + readScheduleConfigOptions(config), + ), + factory: DefaultCatalogCollatorFactory.fromConfig(config, { + auth, + entityTransformer, + discovery, + catalogClient: catalog, + }), + }); + }, + }); + }, +}); diff --git a/plugins/search-backend-module-elasticsearch/report-alpha.api.md b/plugins/search-backend-module-elasticsearch/report-alpha.api.md index e612215a87..344718f5e5 100644 --- a/plugins/search-backend-module-elasticsearch/report-alpha.api.md +++ b/plugins/search-backend-module-elasticsearch/report-alpha.api.md @@ -7,23 +7,24 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; import { ElasticSearchQueryTranslator } from '@backstage/plugin-search-backend-module-elasticsearch'; import { ExtensionPoint } from '@backstage/backend-plugin-api'; -// @alpha -const _default: BackendFeature; -export default _default; +// Warning: (ae-forgotten-export) The symbol "ElasticSearchQueryTranslatorExtensionPoint_2" needs to be exported by the entry point alpha.d.ts +// +// @alpha (undocumented) +export type ElasticSearchQueryTranslatorExtensionPoint = + ElasticSearchQueryTranslatorExtensionPoint_2; // @alpha (undocumented) -export interface ElasticSearchQueryTranslatorExtensionPoint { - // (undocumented) - setTranslator(translator: ElasticSearchQueryTranslator): void; -} +export const elasticsearchTranslatorExtensionPoint: ExtensionPoint; -// @alpha -export const elasticsearchTranslatorExtensionPoint: ExtensionPoint; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; // Warnings were encountered during analysis: // -// src/alpha.d.ts:3:1 - (ae-undocumented) Missing documentation for "ElasticSearchQueryTranslatorExtensionPoint". -// src/alpha.d.ts:4:5 - (ae-undocumented) Missing documentation for "setTranslator". +// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". +// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "ElasticSearchQueryTranslatorExtensionPoint". +// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "elasticsearchTranslatorExtensionPoint". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-elasticsearch/report.api.md b/plugins/search-backend-module-elasticsearch/report.api.md index 9843582b13..d1ec3b171d 100644 --- a/plugins/search-backend-module-elasticsearch/report.api.md +++ b/plugins/search-backend-module-elasticsearch/report.api.md @@ -13,6 +13,8 @@ import { BulkHelper } from '@elastic/elasticsearch/lib/Helpers'; import { BulkStats } from '@elastic/elasticsearch/lib/Helpers'; import { Config } from '@backstage/config'; import type { ConnectionOptions } from 'tls'; +import { ElasticSearchQueryTranslator as ElasticSearchQueryTranslator_2 } from '@backstage/plugin-search-backend-module-elasticsearch'; +import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { IndexableDocument } from '@backstage/plugin-search-common'; import { IndexableResultSet } from '@backstage/plugin-search-common'; import { LoggerService } from '@backstage/backend-plugin-api'; @@ -73,6 +75,10 @@ export function decodeElasticSearchPageCursor(pageCursor?: string): { page: number; }; +// @public +const _default: BackendFeature; +export default _default; + // @public (undocumented) export interface ElasticSearchAgentOptions { // (undocumented) @@ -319,6 +325,12 @@ export type ElasticSearchQueryTranslator = ( options?: ElasticSearchQueryTranslatorOptions, ) => ElasticSearchConcreteQuery; +// @public (undocumented) +export interface ElasticSearchQueryTranslatorExtensionPoint { + // (undocumented) + setTranslator(translator: ElasticSearchQueryTranslator_2): void; +} + // @public export type ElasticSearchQueryTranslatorOptions = { highlightOptions?: ElasticSearchHighlightConfig; @@ -379,6 +391,9 @@ export type ElasticSearchSearchEngineIndexerOptions = { skipRefresh?: boolean; }; +// @public +export const elasticsearchTranslatorExtensionPoint: ExtensionPoint; + // @public (undocumented) export interface ElasticSearchTransportConstructor { // (undocumented) @@ -392,10 +407,6 @@ export interface ElasticSearchTransportConstructor { }; } -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public export const isOpenSearchCompatible: ( opts: ElasticSearchClientOptions, @@ -557,8 +568,6 @@ export interface OpenSearchNodeOptions { // src/engines/ElasticSearchSearchEngineIndexer.d.ts:39:5 - (ae-undocumented) Missing documentation for "initialize". // src/engines/ElasticSearchSearchEngineIndexer.d.ts:40:5 - (ae-undocumented) Missing documentation for "index". // src/engines/ElasticSearchSearchEngineIndexer.d.ts:41:5 - (ae-undocumented) Missing documentation for "finalize". -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file - -// (No @packageDocumentation comment for this package) +// src/module.d.ts:3:1 - (ae-undocumented) Missing documentation for "ElasticSearchQueryTranslatorExtensionPoint". +// src/module.d.ts:4:5 - (ae-undocumented) Missing documentation for "setTranslator". ``` diff --git a/plugins/search-backend-module-elasticsearch/src/alpha.ts b/plugins/search-backend-module-elasticsearch/src/alpha.ts index 0af5904df0..22ff705cd2 100644 --- a/plugins/search-backend-module-elasticsearch/src/alpha.ts +++ b/plugins/search-backend-module-elasticsearch/src/alpha.ts @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Backstage Authors + * Copyright 2024 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,78 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { - coreServices, - createBackendModule, - createExtensionPoint, -} from '@backstage/backend-plugin-api'; -import { searchEngineRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; -import { - ElasticSearchQueryTranslator, - ElasticSearchSearchEngine, -} from '@backstage/plugin-search-backend-module-elasticsearch'; + default as feature, + ElasticSearchQueryTranslatorExtensionPoint as ExtensionPoint, + elasticsearchTranslatorExtensionPoint as extensionPoint, +} from './module'; /** @alpha */ -export interface ElasticSearchQueryTranslatorExtensionPoint { - setTranslator(translator: ElasticSearchQueryTranslator): void; -} +const _feature = feature; +export default _feature; -/** - * Extension point used to customize the ElasticSearch query translator. - * - * @alpha - */ -export const elasticsearchTranslatorExtensionPoint = - createExtensionPoint({ - id: 'search.elasticsearchEngine.translator', - }); - -/** - * Search backend module for the Elasticsearch engine. - * - * @alpha - */ -export default createBackendModule({ - pluginId: 'search', - moduleId: 'elasticsearch-engine', - register(env) { - let translator: ElasticSearchQueryTranslator | undefined; - - env.registerExtensionPoint(elasticsearchTranslatorExtensionPoint, { - setTranslator(newTranslator) { - if (translator) { - throw new Error( - 'ElasticSearch query translator may only be set once', - ); - } - translator = newTranslator; - }, - }); - - env.registerInit({ - deps: { - searchEngineRegistry: searchEngineRegistryExtensionPoint, - logger: coreServices.logger, - config: coreServices.rootConfig, - }, - async init({ searchEngineRegistry, logger, config }) { - const baseKey = 'search.elasticsearch'; - const baseConfig = config.getOptional(baseKey); - if (!baseConfig) { - logger.warn( - 'No configuration found under "search.elasticsearch" key. Skipping search engine inititalization.', - ); - return; - } - - searchEngineRegistry.setSearchEngine( - await ElasticSearchSearchEngine.fromConfig({ - logger, - config, - translator, - }), - ); - }, - }); - }, -}); +/** @alpha */ +export type ElasticSearchQueryTranslatorExtensionPoint = ExtensionPoint; +/** @alpha */ +export const elasticsearchTranslatorExtensionPoint = extensionPoint; diff --git a/plugins/search-backend-module-elasticsearch/src/index.ts b/plugins/search-backend-module-elasticsearch/src/index.ts index a25ef80260..4a9f3474b1 100644 --- a/plugins/search-backend-module-elasticsearch/src/index.ts +++ b/plugins/search-backend-module-elasticsearch/src/index.ts @@ -14,18 +14,14 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A module for the search backend that implements search using ElasticSearch * * @packageDocumentation */ +export { default } from './module'; +export * from './module'; export { decodeElasticSearchPageCursor, ElasticSearchSearchEngine, diff --git a/plugins/search-backend-module-elasticsearch/src/module.ts b/plugins/search-backend-module-elasticsearch/src/module.ts new file mode 100644 index 0000000000..827c8d48b8 --- /dev/null +++ b/plugins/search-backend-module-elasticsearch/src/module.ts @@ -0,0 +1,90 @@ +/* + * Copyright 2023 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 { + coreServices, + createBackendModule, + createExtensionPoint, +} from '@backstage/backend-plugin-api'; +import { searchEngineRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; +import { + ElasticSearchQueryTranslator, + ElasticSearchSearchEngine, +} from '@backstage/plugin-search-backend-module-elasticsearch'; + +/** @public */ +export interface ElasticSearchQueryTranslatorExtensionPoint { + setTranslator(translator: ElasticSearchQueryTranslator): void; +} + +/** + * Extension point used to customize the ElasticSearch query translator. + * + * @public + */ +export const elasticsearchTranslatorExtensionPoint = + createExtensionPoint({ + id: 'search.elasticsearchEngine.translator', + }); + +/** + * Search backend module for the Elasticsearch engine. + * + * @public + */ +export default createBackendModule({ + pluginId: 'search', + moduleId: 'elasticsearch-engine', + register(env) { + let translator: ElasticSearchQueryTranslator | undefined; + + env.registerExtensionPoint(elasticsearchTranslatorExtensionPoint, { + setTranslator(newTranslator) { + if (translator) { + throw new Error( + 'ElasticSearch query translator may only be set once', + ); + } + translator = newTranslator; + }, + }); + + env.registerInit({ + deps: { + searchEngineRegistry: searchEngineRegistryExtensionPoint, + logger: coreServices.logger, + config: coreServices.rootConfig, + }, + async init({ searchEngineRegistry, logger, config }) { + const baseKey = 'search.elasticsearch'; + const baseConfig = config.getOptional(baseKey); + if (!baseConfig) { + logger.warn( + 'No configuration found under "search.elasticsearch" key. Skipping search engine inititalization.', + ); + return; + } + + searchEngineRegistry.setSearchEngine( + await ElasticSearchSearchEngine.fromConfig({ + logger, + config, + translator, + }), + ); + }, + }); + }, +}); diff --git a/plugins/search-backend-module-explore/report-alpha.api.md b/plugins/search-backend-module-explore/report-alpha.api.md index 3a1eef9393..0a383dc7d0 100644 --- a/plugins/search-backend-module-explore/report-alpha.api.md +++ b/plugins/search-backend-module-explore/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const _default: BackendFeature; -export default _default; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-explore/report.api.md b/plugins/search-backend-module-explore/report.api.md index 2d8c907c00..b8ec1aa9c3 100644 --- a/plugins/search-backend-module-explore/report.api.md +++ b/plugins/search-backend-module-explore/report.api.md @@ -16,9 +16,9 @@ import { LoggerService } from '@backstage/backend-plugin-api'; import { Readable } from 'stream'; import { TokenManager } from '@backstage/backend-common'; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const _default: BackendFeature; +export default _default; // @public export interface ToolDocument extends IndexableDocument, ExploreTool {} @@ -53,5 +53,4 @@ export type ToolDocumentCollatorFactoryOptions = { // src/collators/ToolDocumentCollatorFactory.d.ts:37:5 - (ae-undocumented) Missing documentation for "fromConfig". // src/collators/ToolDocumentCollatorFactory.d.ts:38:5 - (ae-undocumented) Missing documentation for "getCollator". // src/collators/ToolDocumentCollatorFactory.d.ts:39:5 - (ae-undocumented) Missing documentation for "execute". -// src/index.d.ts:7:15 - (ae-undocumented) Missing documentation for "_feature". ``` diff --git a/plugins/search-backend-module-explore/src/alpha.ts b/plugins/search-backend-module-explore/src/alpha.ts index 63a13c273b..e5554e85bd 100644 --- a/plugins/search-backend-module-explore/src/alpha.ts +++ b/plugins/search-backend-module-explore/src/alpha.ts @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Backstage Authors + * Copyright 2024 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,67 +14,8 @@ * limitations under the License. */ -/** - * @packageDocumentation - * A module for the search backend that exports Explore modules. - */ +import { default as feature } from './module'; -import { - coreServices, - createBackendModule, - readSchedulerServiceTaskScheduleDefinitionFromConfig, -} from '@backstage/backend-plugin-api'; -import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; - -import { ToolDocumentCollatorFactory } from '@backstage/plugin-search-backend-module-explore'; - -/** - * Search backend module for the Explore index. - * - * @alpha - */ -export default createBackendModule({ - pluginId: 'search', - moduleId: 'explore-collator', - register(env) { - env.registerInit({ - deps: { - config: coreServices.rootConfig, - logger: coreServices.logger, - discovery: coreServices.discovery, - scheduler: coreServices.scheduler, - auth: coreServices.auth, - indexRegistry: searchIndexRegistryExtensionPoint, - }, - async init({ - config, - logger, - discovery, - scheduler, - auth, - indexRegistry, - }) { - const defaultSchedule = { - frequency: { minutes: 10 }, - timeout: { minutes: 15 }, - initialDelay: { seconds: 3 }, - }; - - const schedule = config.has('search.collators.explore.schedule') - ? readSchedulerServiceTaskScheduleDefinitionFromConfig( - config.getConfig('search.collators.explore.schedule'), - ) - : defaultSchedule; - - indexRegistry.addCollator({ - schedule: scheduler.createScheduledTaskRunner(schedule), - factory: ToolDocumentCollatorFactory.fromConfig(config, { - discovery, - logger, - auth, - }), - }); - }, - }); - }, -}); +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/search-backend-module-explore/src/index.ts b/plugins/search-backend-module-explore/src/index.ts index 520ae90e96..d0ed56eac9 100644 --- a/plugins/search-backend-module-explore/src/index.ts +++ b/plugins/search-backend-module-explore/src/index.ts @@ -14,15 +14,10 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - /** * @packageDocumentation * A module for the search backend that exports Explore modules. */ export * from './collators'; - -/** @public */ -const _feature = feature; -export default _feature; +export { default } from './module'; diff --git a/plugins/search-backend-module-explore/src/alpha.test.ts b/plugins/search-backend-module-explore/src/module.test.ts similarity index 97% rename from plugins/search-backend-module-explore/src/alpha.test.ts rename to plugins/search-backend-module-explore/src/module.test.ts index 2ba01ec478..4be26a14d1 100644 --- a/plugins/search-backend-module-explore/src/alpha.test.ts +++ b/plugins/search-backend-module-explore/src/module.test.ts @@ -16,7 +16,7 @@ import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; -import searchModuleExploreCollator from './alpha'; +import searchModuleExploreCollator from './module'; describe('searchModuleExploreCollator', () => { const schedule = { diff --git a/plugins/search-backend-module-explore/src/module.ts b/plugins/search-backend-module-explore/src/module.ts new file mode 100644 index 0000000000..f0ac187908 --- /dev/null +++ b/plugins/search-backend-module-explore/src/module.ts @@ -0,0 +1,80 @@ +/* + * Copyright 2023 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. + */ + +/** + * @packageDocumentation + * A module for the search backend that exports Explore modules. + */ + +import { + coreServices, + createBackendModule, + readSchedulerServiceTaskScheduleDefinitionFromConfig, +} from '@backstage/backend-plugin-api'; +import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; + +import { ToolDocumentCollatorFactory } from '@backstage/plugin-search-backend-module-explore'; + +/** + * Search backend module for the Explore index. + * + * @public + */ +export default createBackendModule({ + pluginId: 'search', + moduleId: 'explore-collator', + register(env) { + env.registerInit({ + deps: { + config: coreServices.rootConfig, + logger: coreServices.logger, + discovery: coreServices.discovery, + scheduler: coreServices.scheduler, + auth: coreServices.auth, + indexRegistry: searchIndexRegistryExtensionPoint, + }, + async init({ + config, + logger, + discovery, + scheduler, + auth, + indexRegistry, + }) { + const defaultSchedule = { + frequency: { minutes: 10 }, + timeout: { minutes: 15 }, + initialDelay: { seconds: 3 }, + }; + + const schedule = config.has('search.collators.explore.schedule') + ? readSchedulerServiceTaskScheduleDefinitionFromConfig( + config.getConfig('search.collators.explore.schedule'), + ) + : defaultSchedule; + + indexRegistry.addCollator({ + schedule: scheduler.createScheduledTaskRunner(schedule), + factory: ToolDocumentCollatorFactory.fromConfig(config, { + discovery, + logger, + auth, + }), + }); + }, + }); + }, +}); diff --git a/plugins/search-backend-module-pg/report-alpha.api.md b/plugins/search-backend-module-pg/report-alpha.api.md index b36b782f6c..c5d011b95f 100644 --- a/plugins/search-backend-module-pg/report-alpha.api.md +++ b/plugins/search-backend-module-pg/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const _default: BackendFeature; -export default _default; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-pg/report.api.md b/plugins/search-backend-module-pg/report.api.md index 380d1cdb7b..77e795321a 100644 --- a/plugins/search-backend-module-pg/report.api.md +++ b/plugins/search-backend-module-pg/report.api.md @@ -71,6 +71,10 @@ export interface DatabaseStore { transaction(fn: (tx: Knex.Transaction) => Promise): Promise; } +// @public +const _default: BackendFeature; +export default _default; + // @public (undocumented) export interface DocumentResultRow { // (undocumented) @@ -81,10 +85,6 @@ export interface DocumentResultRow { type: string; } -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public (undocumented) export class PgSearchEngine implements SearchEngine { // @deprecated @@ -240,8 +240,4 @@ export interface RawDocumentRow { // src/database/types.d.ts:30:5 - (ae-undocumented) Missing documentation for "document". // src/database/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "type". // src/database/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "highlight". -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:4:1 - (ae-misplaced-package-tag) The @packageDocumentation comment must appear at the top of entry point *.d.ts file - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-pg/src/alpha.ts b/plugins/search-backend-module-pg/src/alpha.ts index 3ee4d685e7..e5554e85bd 100644 --- a/plugins/search-backend-module-pg/src/alpha.ts +++ b/plugins/search-backend-module-pg/src/alpha.ts @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Backstage Authors + * Copyright 2024 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,42 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { - coreServices, - createBackendModule, -} from '@backstage/backend-plugin-api'; -import { searchEngineRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; -import { PgSearchEngine } from './PgSearchEngine'; -/** - * @alpha - * Search backend module for the Postgres engine. - */ -export default createBackendModule({ - pluginId: 'search', - moduleId: 'postgres-engine', - register(env) { - env.registerInit({ - deps: { - searchEngineRegistry: searchEngineRegistryExtensionPoint, - database: coreServices.database, - config: coreServices.rootConfig, - logger: coreServices.logger, - }, - async init({ searchEngineRegistry, database, config, logger }) { - if (await PgSearchEngine.supported(database)) { - searchEngineRegistry.setSearchEngine( - await PgSearchEngine.fromConfig(config, { - database, - logger, - }), - ); - } else { - logger.warn( - 'Postgres search engine is not supported, skipping registration of search-backend-module-pg', - ); - } - }, - }); - }, -}); +import { default as feature } from './module'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/search-backend-module-pg/src/index.ts b/plugins/search-backend-module-pg/src/index.ts index eedb819593..efac60e686 100644 --- a/plugins/search-backend-module-pg/src/index.ts +++ b/plugins/search-backend-module-pg/src/index.ts @@ -14,17 +14,12 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - /** * A module for the search backend that implements search using PostgreSQL * * @packageDocumentation */ +export { default } from './module'; export * from './database'; export * from './PgSearchEngine'; diff --git a/plugins/search-backend-module-pg/src/module.ts b/plugins/search-backend-module-pg/src/module.ts new file mode 100644 index 0000000000..43bdb41905 --- /dev/null +++ b/plugins/search-backend-module-pg/src/module.ts @@ -0,0 +1,54 @@ +/* + * Copyright 2023 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 { + coreServices, + createBackendModule, +} from '@backstage/backend-plugin-api'; +import { searchEngineRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; +import { PgSearchEngine } from './PgSearchEngine'; + +/** + * @public + * Search backend module for the Postgres engine. + */ +export default createBackendModule({ + pluginId: 'search', + moduleId: 'postgres-engine', + register(env) { + env.registerInit({ + deps: { + searchEngineRegistry: searchEngineRegistryExtensionPoint, + database: coreServices.database, + config: coreServices.rootConfig, + logger: coreServices.logger, + }, + async init({ searchEngineRegistry, database, config, logger }) { + if (await PgSearchEngine.supported(database)) { + searchEngineRegistry.setSearchEngine( + await PgSearchEngine.fromConfig(config, { + database, + logger, + }), + ); + } else { + logger.warn( + 'Postgres search engine is not supported, skipping registration of search-backend-module-pg', + ); + } + }, + }); + }, +}); diff --git a/plugins/search-backend-module-techdocs/report-alpha.api.md b/plugins/search-backend-module-techdocs/report-alpha.api.md index 758441c12d..678f9a679d 100644 --- a/plugins/search-backend-module-techdocs/report-alpha.api.md +++ b/plugins/search-backend-module-techdocs/report-alpha.api.md @@ -8,28 +8,24 @@ import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { TechDocsCollatorDocumentTransformer } from '@backstage/plugin-search-backend-module-techdocs'; import { TechDocsCollatorEntityTransformer } from '@backstage/plugin-search-backend-module-techdocs'; -// @alpha -const _default: BackendFeature; -export default _default; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warning: (ae-forgotten-export) The symbol "TechDocsCollatorEntityTransformerExtensionPoint_2" needs to be exported by the entry point alpha.d.ts +// +// @alpha (undocumented) +export type TechDocsCollatorEntityTransformerExtensionPoint = + TechDocsCollatorEntityTransformerExtensionPoint_2; // @alpha (undocumented) -export interface TechDocsCollatorEntityTransformerExtensionPoint { - // (undocumented) - setDocumentTransformer( - transformer: TechDocsCollatorDocumentTransformer, - ): void; - // (undocumented) - setTransformer(transformer: TechDocsCollatorEntityTransformer): void; -} - -// @alpha -export const techdocsCollatorEntityTransformerExtensionPoint: ExtensionPoint; +export const techdocsCollatorEntityTransformerExtensionPoint: ExtensionPoint; // Warnings were encountered during analysis: // -// src/alpha.d.ts:3:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorEntityTransformerExtensionPoint". -// src/alpha.d.ts:4:5 - (ae-undocumented) Missing documentation for "setTransformer". -// src/alpha.d.ts:5:5 - (ae-undocumented) Missing documentation for "setDocumentTransformer". +// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". +// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorEntityTransformerExtensionPoint". +// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "techdocsCollatorEntityTransformerExtensionPoint". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-techdocs/report.api.md b/plugins/search-backend-module-techdocs/report.api.md index 90a4fa9479..9f03812e44 100644 --- a/plugins/search-backend-module-techdocs/report.api.md +++ b/plugins/search-backend-module-techdocs/report.api.md @@ -12,13 +12,20 @@ import { Config } from '@backstage/config'; import { DiscoveryService } from '@backstage/backend-plugin-api'; import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; import { Entity } from '@backstage/catalog-model'; +import { ExtensionPoint } from '@backstage/backend-plugin-api'; import { HttpAuthService } from '@backstage/backend-plugin-api'; import { LoggerService } from '@backstage/backend-plugin-api'; import { Permission } from '@backstage/plugin-permission-common'; import { Readable } from 'stream'; +import { TechDocsCollatorDocumentTransformer as TechDocsCollatorDocumentTransformer_2 } from '@backstage/plugin-search-backend-module-techdocs'; +import { TechDocsCollatorEntityTransformer as TechDocsCollatorEntityTransformer_2 } from '@backstage/plugin-search-backend-module-techdocs'; import { TechDocsDocument } from '@backstage/plugin-techdocs-node'; import { TokenManager } from '@backstage/backend-common'; +// @public +const _default: BackendFeature; +export default _default; + // @public (undocumented) export const defaultTechDocsCollatorEntityTransformer: TechDocsCollatorEntityTransformer; @@ -37,10 +44,6 @@ export class DefaultTechDocsCollatorFactory implements DocumentCollatorFactory { readonly visibilityPermission: Permission; } -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public (undocumented) export interface MkSearchIndexDoc { // (undocumented) @@ -74,6 +77,19 @@ export type TechDocsCollatorEntityTransformer = ( entity: Entity, ) => Partial>; +// @public (undocumented) +export interface TechDocsCollatorEntityTransformerExtensionPoint { + // (undocumented) + setDocumentTransformer( + transformer: TechDocsCollatorDocumentTransformer_2, + ): void; + // (undocumented) + setTransformer(transformer: TechDocsCollatorEntityTransformer_2): void; +} + +// @public +export const techdocsCollatorEntityTransformerExtensionPoint: ExtensionPoint; + // @public @deprecated export type TechDocsCollatorFactoryOptions = { discovery: DiscoveryService; @@ -103,5 +119,7 @@ export type TechDocsCollatorFactoryOptions = { // src/collators/TechDocsCollatorDocumentTransformer.d.ts:10:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorDocumentTransformer". // src/collators/TechDocsCollatorEntityTransformer.d.ts:4:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorEntityTransformer". // src/collators/defaultTechDocsCollatorEntityTransformer.d.ts:3:22 - (ae-undocumented) Missing documentation for "defaultTechDocsCollatorEntityTransformer". -// src/index.d.ts:7:15 - (ae-undocumented) Missing documentation for "_feature". +// src/module.d.ts:3:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorEntityTransformerExtensionPoint". +// src/module.d.ts:4:5 - (ae-undocumented) Missing documentation for "setTransformer". +// src/module.d.ts:5:5 - (ae-undocumented) Missing documentation for "setDocumentTransformer". ``` diff --git a/plugins/search-backend-module-techdocs/src/alpha.ts b/plugins/search-backend-module-techdocs/src/alpha.ts index 88b914cf19..ecd56a9af1 100644 --- a/plugins/search-backend-module-techdocs/src/alpha.ts +++ b/plugins/search-backend-module-techdocs/src/alpha.ts @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Backstage Authors + * Copyright 2024 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,122 +14,17 @@ * limitations under the License. */ -/** - * @packageDocumentation - * A module for the search backend that exports TechDocs modules. - */ - import { - coreServices, - createBackendModule, - createExtensionPoint, - readSchedulerServiceTaskScheduleDefinitionFromConfig, -} from '@backstage/backend-plugin-api'; -import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; -import { - DefaultTechDocsCollatorFactory, - TechDocsCollatorDocumentTransformer, - TechDocsCollatorEntityTransformer, -} from '@backstage/plugin-search-backend-module-techdocs'; -import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; + default as feature, + TechDocsCollatorEntityTransformerExtensionPoint as ExtensionPoint, + techdocsCollatorEntityTransformerExtensionPoint as extensionPoint, +} from './module'; /** @alpha */ -export interface TechDocsCollatorEntityTransformerExtensionPoint { - setTransformer(transformer: TechDocsCollatorEntityTransformer): void; - setDocumentTransformer( - transformer: TechDocsCollatorDocumentTransformer, - ): void; -} +const _feature = feature; +export default _feature; -/** - * Extension point used to customize the TechDocs collator entity transformer. - * - * @alpha - */ -export const techdocsCollatorEntityTransformerExtensionPoint = - createExtensionPoint({ - id: 'search.techdocsCollator.transformer', - }); - -/** - * @alpha - * Search backend module for the TechDocs index. - */ -export default createBackendModule({ - pluginId: 'search', - moduleId: 'techdocs-collator', - register(env) { - let entityTransformer: TechDocsCollatorEntityTransformer | undefined; - let documentTransformer: TechDocsCollatorDocumentTransformer | undefined; - - env.registerExtensionPoint( - techdocsCollatorEntityTransformerExtensionPoint, - { - setTransformer(newTransformer) { - if (entityTransformer) { - throw new Error( - 'TechDocs collator entity transformer may only be set once', - ); - } - entityTransformer = newTransformer; - }, - setDocumentTransformer(newTransformer) { - if (documentTransformer) { - throw new Error( - 'TechDocs collator document transformer may only be set once', - ); - } - documentTransformer = newTransformer; - }, - }, - ); - - env.registerInit({ - deps: { - config: coreServices.rootConfig, - logger: coreServices.logger, - auth: coreServices.auth, - httpAuth: coreServices.httpAuth, - discovery: coreServices.discovery, - scheduler: coreServices.scheduler, - catalog: catalogServiceRef, - indexRegistry: searchIndexRegistryExtensionPoint, - }, - async init({ - config, - logger, - auth, - httpAuth, - discovery, - scheduler, - catalog, - indexRegistry, - }) { - const defaultSchedule = { - frequency: { minutes: 10 }, - timeout: { minutes: 15 }, - initialDelay: { seconds: 3 }, - }; - - const schedule = config.has('search.collators.techdocs.schedule') - ? readSchedulerServiceTaskScheduleDefinitionFromConfig( - config.getConfig('search.collators.techdocs.schedule'), - ) - : defaultSchedule; - - indexRegistry.addCollator({ - schedule: scheduler.createScheduledTaskRunner(schedule), - factory: DefaultTechDocsCollatorFactory.fromConfig(config, { - discovery, - auth, - httpAuth, - logger, - catalogClient: catalog, - entityTransformer, - documentTransformer, - }), - }); - }, - }); - }, -}); +/** @alpha */ +export type TechDocsCollatorEntityTransformerExtensionPoint = ExtensionPoint; +/** @alpha */ +export const techdocsCollatorEntityTransformerExtensionPoint = extensionPoint; diff --git a/plugins/search-backend-module-techdocs/src/index.ts b/plugins/search-backend-module-techdocs/src/index.ts index c8f9a93c6a..cd11b89671 100644 --- a/plugins/search-backend-module-techdocs/src/index.ts +++ b/plugins/search-backend-module-techdocs/src/index.ts @@ -14,15 +14,11 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - /** * @packageDocumentation * A module for the search backend that exports TechDocs modules. */ +export { default } from './module'; +export * from './module'; export * from './collators'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/search-backend-module-techdocs/src/alpha.test.ts b/plugins/search-backend-module-techdocs/src/module.test.ts similarity index 97% rename from plugins/search-backend-module-techdocs/src/alpha.test.ts rename to plugins/search-backend-module-techdocs/src/module.test.ts index f1875a881b..92e4366980 100644 --- a/plugins/search-backend-module-techdocs/src/alpha.test.ts +++ b/plugins/search-backend-module-techdocs/src/module.test.ts @@ -16,7 +16,7 @@ import { mockServices, startTestBackend } from '@backstage/backend-test-utils'; import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; -import searchModuleTechDocsCollator from './alpha'; +import searchModuleTechDocsCollator from './module'; describe('searchModuleTechDocsCollator', () => { const schedule = { diff --git a/plugins/search-backend-module-techdocs/src/module.ts b/plugins/search-backend-module-techdocs/src/module.ts new file mode 100644 index 0000000000..0114b88c2d --- /dev/null +++ b/plugins/search-backend-module-techdocs/src/module.ts @@ -0,0 +1,135 @@ +/* + * Copyright 2023 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. + */ + +/** + * @packageDocumentation + * A module for the search backend that exports TechDocs modules. + */ + +import { + coreServices, + createBackendModule, + createExtensionPoint, + readSchedulerServiceTaskScheduleDefinitionFromConfig, +} from '@backstage/backend-plugin-api'; +import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; +import { + DefaultTechDocsCollatorFactory, + TechDocsCollatorDocumentTransformer, + TechDocsCollatorEntityTransformer, +} from '@backstage/plugin-search-backend-module-techdocs'; +import { searchIndexRegistryExtensionPoint } from '@backstage/plugin-search-backend-node/alpha'; + +/** @public */ +export interface TechDocsCollatorEntityTransformerExtensionPoint { + setTransformer(transformer: TechDocsCollatorEntityTransformer): void; + setDocumentTransformer( + transformer: TechDocsCollatorDocumentTransformer, + ): void; +} + +/** + * Extension point used to customize the TechDocs collator entity transformer. + * + * @public + */ +export const techdocsCollatorEntityTransformerExtensionPoint = + createExtensionPoint({ + id: 'search.techdocsCollator.transformer', + }); + +/** + * @public + * Search backend module for the TechDocs index. + */ +export default createBackendModule({ + pluginId: 'search', + moduleId: 'techdocs-collator', + register(env) { + let entityTransformer: TechDocsCollatorEntityTransformer | undefined; + let documentTransformer: TechDocsCollatorDocumentTransformer | undefined; + + env.registerExtensionPoint( + techdocsCollatorEntityTransformerExtensionPoint, + { + setTransformer(newTransformer) { + if (entityTransformer) { + throw new Error( + 'TechDocs collator entity transformer may only be set once', + ); + } + entityTransformer = newTransformer; + }, + setDocumentTransformer(newTransformer) { + if (documentTransformer) { + throw new Error( + 'TechDocs collator document transformer may only be set once', + ); + } + documentTransformer = newTransformer; + }, + }, + ); + + env.registerInit({ + deps: { + config: coreServices.rootConfig, + logger: coreServices.logger, + auth: coreServices.auth, + httpAuth: coreServices.httpAuth, + discovery: coreServices.discovery, + scheduler: coreServices.scheduler, + catalog: catalogServiceRef, + indexRegistry: searchIndexRegistryExtensionPoint, + }, + async init({ + config, + logger, + auth, + httpAuth, + discovery, + scheduler, + catalog, + indexRegistry, + }) { + const defaultSchedule = { + frequency: { minutes: 10 }, + timeout: { minutes: 15 }, + initialDelay: { seconds: 3 }, + }; + + const schedule = config.has('search.collators.techdocs.schedule') + ? readSchedulerServiceTaskScheduleDefinitionFromConfig( + config.getConfig('search.collators.techdocs.schedule'), + ) + : defaultSchedule; + + indexRegistry.addCollator({ + schedule: scheduler.createScheduledTaskRunner(schedule), + factory: DefaultTechDocsCollatorFactory.fromConfig(config, { + discovery, + auth, + httpAuth, + logger, + catalogClient: catalog, + entityTransformer, + documentTransformer, + }), + }); + }, + }); + }, +}); From 7cfc0c190217d5bcab3659e1613a5d9cefc977bd Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 13 Oct 2024 13:11:11 +0200 Subject: [PATCH 121/268] plugins/*-backend: flip around alpha exports to stable Signed-off-by: Patrik Oldsberg --- plugins/app-backend/report-alpha.api.md | 10 +- plugins/app-backend/report.api.md | 9 +- plugins/app-backend/src/alpha.ts | 6 +- plugins/app-backend/src/index.ts | 7 +- plugins/app-backend/src/service/appPlugin.ts | 2 +- plugins/catalog-backend/report-alpha.api.md | 12 +- plugins/catalog-backend/report.api.md | 9 +- plugins/catalog-backend/src/alpha.ts | 7 +- plugins/catalog-backend/src/index.ts | 7 +- .../src/service/CatalogPlugin.ts | 2 +- plugins/events-backend/report-alpha.api.md | 10 +- plugins/events-backend/report.api.md | 7 +- plugins/events-backend/src/alpha.ts | 6 +- plugins/events-backend/src/index.ts | 7 +- .../src/service/EventsPlugin.ts | 2 +- .../kubernetes-backend/report-alpha.api.md | 10 +- plugins/kubernetes-backend/report.api.md | 9 +- plugins/kubernetes-backend/src/alpha.ts | 7 +- plugins/kubernetes-backend/src/index.ts | 7 +- plugins/kubernetes-backend/src/plugin.ts | 3 +- .../permission-backend/report-alpha.api.md | 10 +- plugins/permission-backend/report.api.md | 7 +- plugins/permission-backend/src/alpha.ts | 6 +- plugins/permission-backend/src/index.ts | 7 +- plugins/permission-backend/src/plugin.ts | 2 +- plugins/proxy-backend/report-alpha.api.md | 10 +- plugins/proxy-backend/report.api.md | 7 +- plugins/proxy-backend/src/alpha.ts | 36 +---- plugins/proxy-backend/src/index.ts | 7 +- plugins/proxy-backend/src/plugin.ts | 49 ++++++ .../scaffolder-backend/report-alpha.api.md | 9 +- plugins/scaffolder-backend/report.api.md | 9 +- .../src/ScaffolderPlugin.ts | 2 +- plugins/scaffolder-backend/src/alpha.ts | 6 +- plugins/scaffolder-backend/src/index.ts | 7 +- plugins/search-backend/dev/index.ts | 2 +- plugins/search-backend/report-alpha.api.md | 10 +- plugins/search-backend/report.api.md | 7 +- plugins/search-backend/src/alpha.ts | 142 +--------------- plugins/search-backend/src/index.ts | 7 +- .../src/{alpha.test.ts => plugin.test.ts} | 2 +- plugins/search-backend/src/plugin.ts | 153 ++++++++++++++++++ plugins/techdocs-backend/report-alpha.api.md | 10 +- plugins/techdocs-backend/report.api.md | 15 +- plugins/techdocs-backend/src/alpha.ts | 6 +- plugins/techdocs-backend/src/index.ts | 6 +- plugins/techdocs-backend/src/plugin.ts | 2 +- plugins/user-settings-backend/dev/index.ts | 2 +- .../user-settings-backend/report-alpha.api.md | 10 +- plugins/user-settings-backend/report.api.md | 10 +- plugins/user-settings-backend/src/alpha.ts | 39 +---- plugins/user-settings-backend/src/index.ts | 7 +- plugins/user-settings-backend/src/plugin.ts | 50 ++++++ 53 files changed, 430 insertions(+), 363 deletions(-) create mode 100644 plugins/proxy-backend/src/plugin.ts rename plugins/search-backend/src/{alpha.test.ts => plugin.test.ts} (96%) create mode 100644 plugins/search-backend/src/plugin.ts create mode 100644 plugins/user-settings-backend/src/plugin.ts diff --git a/plugins/app-backend/report-alpha.api.md b/plugins/app-backend/report-alpha.api.md index 1c9b6b2902..f5bd67554d 100644 --- a/plugins/app-backend/report-alpha.api.md +++ b/plugins/app-backend/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const appPlugin: BackendFeature; -export default appPlugin; +// @alpha (undocumented) +const _appPlugin: BackendFeature; +export default _appPlugin; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_appPlugin". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/app-backend/report.api.md b/plugins/app-backend/report.api.md index b1a3eaa9a7..4ec356951f 100644 --- a/plugins/app-backend/report.api.md +++ b/plugins/app-backend/report.api.md @@ -12,13 +12,13 @@ import { HttpAuthService } from '@backstage/backend-plugin-api'; import { LoggerService } from '@backstage/backend-plugin-api'; import { RootConfigService } from '@backstage/backend-plugin-api'; +// @public +const appPlugin: BackendFeature; +export default appPlugin; + // @public @deprecated (undocumented) export function createRouter(options: RouterOptions): Promise; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public @deprecated (undocumented) export interface RouterOptions { appPackageName: string; @@ -38,7 +38,6 @@ export interface RouterOptions { // Warnings were encountered during analysis: // -// src/index.d.ts:8:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/router.d.ts:9:1 - (ae-undocumented) Missing documentation for "RouterOptions". // src/service/router.d.ts:10:5 - (ae-undocumented) Missing documentation for "config". // src/service/router.d.ts:11:5 - (ae-undocumented) Missing documentation for "logger". diff --git a/plugins/app-backend/src/alpha.ts b/plugins/app-backend/src/alpha.ts index 830e3587dc..eb661bc295 100644 --- a/plugins/app-backend/src/alpha.ts +++ b/plugins/app-backend/src/alpha.ts @@ -14,4 +14,8 @@ * limitations under the License. */ -export { appPlugin as default } from './service/appPlugin'; +import { appPlugin } from './service/appPlugin'; + +/** @alpha */ +const _appPlugin = appPlugin; +export default _appPlugin; diff --git a/plugins/app-backend/src/index.ts b/plugins/app-backend/src/index.ts index f59fcb7da5..9f83f6e30a 100644 --- a/plugins/app-backend/src/index.ts +++ b/plugins/app-backend/src/index.ts @@ -14,16 +14,11 @@ * limitations under the License. */ -import { appPlugin as feature } from './service/appPlugin'; - /** * A Backstage backend plugin that serves the Backstage frontend app * * @packageDocumentation */ +export { appPlugin as default } from './service/appPlugin'; export * from './service/router'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/app-backend/src/service/appPlugin.ts b/plugins/app-backend/src/service/appPlugin.ts index 000db80911..f8d9d5f7f4 100644 --- a/plugins/app-backend/src/service/appPlugin.ts +++ b/plugins/app-backend/src/service/appPlugin.ts @@ -28,7 +28,7 @@ import { ConfigSchema } from '@backstage/config-loader'; /** * The App plugin is responsible for serving the frontend app bundle and static assets. - * @alpha + * @public */ export const appPlugin = createBackendPlugin({ pluginId: 'app', diff --git a/plugins/catalog-backend/report-alpha.api.md b/plugins/catalog-backend/report-alpha.api.md index 74f1e7d1b4..59155670ba 100644 --- a/plugins/catalog-backend/report-alpha.api.md +++ b/plugins/catalog-backend/report-alpha.api.md @@ -74,10 +74,6 @@ export type CatalogPermissionRule< TParams extends PermissionRuleParams = PermissionRuleParams, > = PermissionRule; -// @alpha -const catalogPlugin: BackendFeature; -export default catalogPlugin; - // @alpha export const createCatalogConditionalDecision: ( permission: ResourcePermission<'catalog-entity'>, @@ -91,6 +87,10 @@ export const createCatalogPermissionRule: < rule: PermissionRule, ) => PermissionRule; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + // @alpha export const permissionRules: { hasAnnotation: PermissionRule< @@ -146,5 +146,9 @@ export const permissionRules: { >; }; +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". + // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend/report.api.md b/plugins/catalog-backend/report.api.md index dcd0319c49..9294c71377 100644 --- a/plugins/catalog-backend/report.api.md +++ b/plugins/catalog-backend/report.api.md @@ -212,6 +212,10 @@ export type CatalogPermissionRuleInput< TParams extends PermissionRuleParams = PermissionRuleParams, > = PermissionRule; +// @public +const catalogPlugin: BackendFeature; +export default catalogPlugin; + // @public export interface CatalogProcessingEngine { // (undocumented) @@ -350,10 +354,6 @@ export type EntityProviderMutation = EntityProviderMutation_2; // @public @deprecated (undocumented) export type EntityRelationSpec = EntityRelationSpec_2; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public (undocumented) export class FileReaderProcessor implements CatalogProcessor_2 { // (undocumented) @@ -521,7 +521,6 @@ export class UrlReaderProcessor implements CatalogProcessor_2 { // src/deprecated.d.ts:207:22 - (ae-undocumented) Missing documentation for "defaultCatalogCollatorEntityTransformer". // src/deprecated.d.ts:212:1 - (ae-undocumented) Missing documentation for "DefaultCatalogCollatorFactoryOptions". // src/deprecated.d.ts:217:1 - (ae-undocumented) Missing documentation for "CatalogCollatorEntityTransformer". -// src/index.d.ts:14:15 - (ae-undocumented) Missing documentation for "_feature". // src/processing/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "start". // src/processing/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "stop". // src/processors/AnnotateLocationEntityProcessor.d.ts:6:1 - (ae-undocumented) Missing documentation for "AnnotateLocationEntityProcessor". diff --git a/plugins/catalog-backend/src/alpha.ts b/plugins/catalog-backend/src/alpha.ts index f85ef02c80..4d40b8733e 100644 --- a/plugins/catalog-backend/src/alpha.ts +++ b/plugins/catalog-backend/src/alpha.ts @@ -14,5 +14,10 @@ * limitations under the License. */ +import { catalogPlugin } from './service/CatalogPlugin'; + +/** @alpha */ +const _feature = catalogPlugin; +export default _feature; + export * from './permissions'; -export { catalogPlugin as default } from './service/CatalogPlugin'; diff --git a/plugins/catalog-backend/src/index.ts b/plugins/catalog-backend/src/index.ts index a55a5eb687..3de6cea22e 100644 --- a/plugins/catalog-backend/src/index.ts +++ b/plugins/catalog-backend/src/index.ts @@ -14,14 +14,13 @@ * limitations under the License. */ -import { catalogPlugin as feature } from './service/CatalogPlugin'; - /** * The Backstage backend plugin that provides the Backstage catalog * * @packageDocumentation */ +export { catalogPlugin as default } from './service/CatalogPlugin'; export * from './processors'; export * from './processing'; export * from './search'; @@ -29,7 +28,3 @@ export * from './service'; export * from './deprecated'; export * from './constants'; export * from './util'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/catalog-backend/src/service/CatalogPlugin.ts b/plugins/catalog-backend/src/service/CatalogPlugin.ts index 269100e586..e36e4e1333 100644 --- a/plugins/catalog-backend/src/service/CatalogPlugin.ts +++ b/plugins/catalog-backend/src/service/CatalogPlugin.ts @@ -170,7 +170,7 @@ class CatalogModelExtensionPointImpl implements CatalogModelExtensionPoint { /** * Catalog plugin - * @alpha + * @public */ export const catalogPlugin = createBackendPlugin({ pluginId: 'catalog', diff --git a/plugins/events-backend/report-alpha.api.md b/plugins/events-backend/report-alpha.api.md index ef881006e4..c9f56bd226 100644 --- a/plugins/events-backend/report-alpha.api.md +++ b/plugins/events-backend/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const eventsPlugin: BackendFeature; -export default eventsPlugin; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend/report.api.md b/plugins/events-backend/report.api.md index 8d39a28774..e7a33deb07 100644 --- a/plugins/events-backend/report.api.md +++ b/plugins/events-backend/report.api.md @@ -43,9 +43,9 @@ export class EventsBackend { start(): Promise; } -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const eventsPlugin: BackendFeature; +export default eventsPlugin; // @public export class HttpPostIngressEventPublisher { @@ -64,7 +64,6 @@ export class HttpPostIngressEventPublisher { // Warnings were encountered during analysis: // -// src/index.d.ts:9:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/DefaultEventBroker.d.ts:21:5 - (ae-undocumented) Missing documentation for "publish". // src/service/DefaultEventBroker.d.ts:22:5 - (ae-undocumented) Missing documentation for "subscribe". // src/service/EventsBackend.d.ts:14:5 - (ae-undocumented) Missing documentation for "setEventBroker". diff --git a/plugins/events-backend/src/alpha.ts b/plugins/events-backend/src/alpha.ts index 2d40694987..8e55d4e134 100644 --- a/plugins/events-backend/src/alpha.ts +++ b/plugins/events-backend/src/alpha.ts @@ -14,4 +14,8 @@ * limitations under the License. */ -export { eventsPlugin as default } from './service/EventsPlugin'; +import { eventsPlugin } from './service/EventsPlugin'; + +/** @alpha */ +const _feature = eventsPlugin; +export default _feature; diff --git a/plugins/events-backend/src/index.ts b/plugins/events-backend/src/index.ts index 425de752fd..6663f59393 100644 --- a/plugins/events-backend/src/index.ts +++ b/plugins/events-backend/src/index.ts @@ -14,17 +14,12 @@ * limitations under the License. */ -import { eventsPlugin as feature } from './service/EventsPlugin'; - /** * The Backstage backend plugin "events" that provides the event management. * * @packageDocumentation */ +export { eventsPlugin as default } from './service/EventsPlugin'; export * from './deprecated'; export { HttpPostIngressEventPublisher } from './service/http'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/events-backend/src/service/EventsPlugin.ts b/plugins/events-backend/src/service/EventsPlugin.ts index 1369ee98ca..10af3798ec 100644 --- a/plugins/events-backend/src/service/EventsPlugin.ts +++ b/plugins/events-backend/src/service/EventsPlugin.ts @@ -63,7 +63,7 @@ class EventsExtensionPointImpl implements EventsExtensionPoint { /** * Events plugin * - * @alpha + * @public */ export const eventsPlugin = createBackendPlugin({ pluginId: 'events', diff --git a/plugins/kubernetes-backend/report-alpha.api.md b/plugins/kubernetes-backend/report-alpha.api.md index f6da905f30..b4c4df2287 100644 --- a/plugins/kubernetes-backend/report-alpha.api.md +++ b/plugins/kubernetes-backend/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const kubernetesPlugin: BackendFeature; -export default kubernetesPlugin; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/kubernetes-backend/report.api.md b/plugins/kubernetes-backend/report.api.md index 694d0b2695..9bcef16843 100644 --- a/plugins/kubernetes-backend/report.api.md +++ b/plugins/kubernetes-backend/report.api.md @@ -122,10 +122,6 @@ export type DispatchStrategyOptions = { }; }; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public @deprecated (undocumented) export type FetchResponseWrapper = k8sAuthTypes.FetchResponseWrapper; @@ -337,6 +333,10 @@ export interface KubernetesObjectsProviderOptions { // @public @deprecated (undocumented) export type KubernetesObjectTypes = k8sAuthTypes.KubernetesObjectTypes; +// @public +const kubernetesPlugin: BackendFeature; +export default kubernetesPlugin; + // @public export class KubernetesProxy { constructor(options: KubernetesProxyOptions); @@ -472,7 +472,6 @@ export type SigningCreds = { // src/auth/ServiceAccountStrategy.d.ts:9:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". // src/auth/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "AuthenticationStrategy". // src/auth/types.d.ts:9:1 - (ae-undocumented) Missing documentation for "KubernetesCredential". -// src/index.d.ts:10:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/KubernetesBuilder.d.ts:14:1 - (ae-undocumented) Missing documentation for "KubernetesEnvironment". // src/service/KubernetesBuilder.d.ts:15:5 - (ae-undocumented) Missing documentation for "logger". // src/service/KubernetesBuilder.d.ts:16:5 - (ae-undocumented) Missing documentation for "config". diff --git a/plugins/kubernetes-backend/src/alpha.ts b/plugins/kubernetes-backend/src/alpha.ts index 9171964f7c..90e0a819ac 100644 --- a/plugins/kubernetes-backend/src/alpha.ts +++ b/plugins/kubernetes-backend/src/alpha.ts @@ -13,4 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { kubernetesPlugin as default } from './plugin'; + +import { kubernetesPlugin as feature } from './plugin'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/kubernetes-backend/src/index.ts b/plugins/kubernetes-backend/src/index.ts index 186337cb81..87e77cac32 100644 --- a/plugins/kubernetes-backend/src/index.ts +++ b/plugins/kubernetes-backend/src/index.ts @@ -14,18 +14,13 @@ * limitations under the License. */ -import { kubernetesPlugin as feature } from './plugin'; - /** * A Backstage backend plugin that integrates towards Kubernetes * * @packageDocumentation */ +export { kubernetesPlugin as default } from './plugin'; export * from './auth'; export * from './service'; export * from './types'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/kubernetes-backend/src/plugin.ts b/plugins/kubernetes-backend/src/plugin.ts index 284fa2e5e2..83b2c66b5c 100644 --- a/plugins/kubernetes-backend/src/plugin.ts +++ b/plugins/kubernetes-backend/src/plugin.ts @@ -139,9 +139,8 @@ class AuthStrategy implements KubernetesAuthStrategyExtensionPoint { /** * This is the backend plugin that provides the Kubernetes integration. - * @alpha + * @public */ - export const kubernetesPlugin = createBackendPlugin({ pluginId: 'kubernetes', register(env) { diff --git a/plugins/permission-backend/report-alpha.api.md b/plugins/permission-backend/report-alpha.api.md index d0a10b6b3a..e2d43b0195 100644 --- a/plugins/permission-backend/report-alpha.api.md +++ b/plugins/permission-backend/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const permissionPlugin: BackendFeature; -export default permissionPlugin; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/permission-backend/report.api.md b/plugins/permission-backend/report.api.md index 78e08d9873..fd559c4a6a 100644 --- a/plugins/permission-backend/report.api.md +++ b/plugins/permission-backend/report.api.md @@ -17,9 +17,9 @@ import { UserInfoService } from '@backstage/backend-plugin-api'; // @public @deprecated export function createRouter(options: RouterOptions): Promise; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const permissionPlugin: BackendFeature; +export default permissionPlugin; // @public @deprecated export interface RouterOptions { @@ -43,7 +43,6 @@ export interface RouterOptions { // Warnings were encountered during analysis: // -// src/index.d.ts:7:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "logger". // src/service/router.d.ts:14:5 - (ae-undocumented) Missing documentation for "discovery". // src/service/router.d.ts:15:5 - (ae-undocumented) Missing documentation for "policy". diff --git a/plugins/permission-backend/src/alpha.ts b/plugins/permission-backend/src/alpha.ts index c0283c6fd0..519482333d 100644 --- a/plugins/permission-backend/src/alpha.ts +++ b/plugins/permission-backend/src/alpha.ts @@ -14,4 +14,8 @@ * limitations under the License. */ -export { permissionPlugin as default } from './plugin'; +import { permissionPlugin as feature } from './plugin'; + +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/permission-backend/src/index.ts b/plugins/permission-backend/src/index.ts index 29fca17cf3..b6d3366d37 100644 --- a/plugins/permission-backend/src/index.ts +++ b/plugins/permission-backend/src/index.ts @@ -14,14 +14,9 @@ * limitations under the License. */ -import { permissionPlugin as feature } from './plugin'; - /** * Backend for Backstage authorization and permissions. * @packageDocumentation */ +export { permissionPlugin as default } from './plugin'; export * from './service'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/permission-backend/src/plugin.ts b/plugins/permission-backend/src/plugin.ts index f0130e4812..6a3fb35fd3 100644 --- a/plugins/permission-backend/src/plugin.ts +++ b/plugins/permission-backend/src/plugin.ts @@ -39,7 +39,7 @@ class PolicyExtensionPointImpl implements PolicyExtensionPoint { /** * Permission plugin * - * @alpha + * @public */ export const permissionPlugin = createBackendPlugin({ pluginId: 'permission', diff --git a/plugins/proxy-backend/report-alpha.api.md b/plugins/proxy-backend/report-alpha.api.md index e6d161655d..a32524352e 100644 --- a/plugins/proxy-backend/report-alpha.api.md +++ b/plugins/proxy-backend/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const _default: BackendFeature; -export default _default; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/proxy-backend/report.api.md b/plugins/proxy-backend/report.api.md index f299986239..0a68a03cfe 100644 --- a/plugins/proxy-backend/report.api.md +++ b/plugins/proxy-backend/report.api.md @@ -12,9 +12,9 @@ import { RootConfigService } from '@backstage/backend-plugin-api'; // @public @deprecated export function createRouter(options: RouterOptions): Promise; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const proxyPlugin: BackendFeature; +export default proxyPlugin; // @public @deprecated (undocumented) export interface RouterOptions { @@ -32,7 +32,6 @@ export interface RouterOptions { // Warnings were encountered during analysis: // -// src/index.d.ts:8:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/router.d.ts:9:1 - (ae-undocumented) Missing documentation for "RouterOptions". // src/service/router.d.ts:10:5 - (ae-undocumented) Missing documentation for "logger". // src/service/router.d.ts:11:5 - (ae-undocumented) Missing documentation for "config". diff --git a/plugins/proxy-backend/src/alpha.ts b/plugins/proxy-backend/src/alpha.ts index 339e42cd94..6efe450ac3 100644 --- a/plugins/proxy-backend/src/alpha.ts +++ b/plugins/proxy-backend/src/alpha.ts @@ -14,36 +14,8 @@ * limitations under the License. */ -import { loggerToWinstonLogger } from '@backstage/backend-common'; -import { - createBackendPlugin, - coreServices, -} from '@backstage/backend-plugin-api'; -import { createRouterInternal } from './service/router'; +import { proxyPlugin } from './plugin'; -/** - * The proxy backend plugin. - * - * @alpha - */ -export default createBackendPlugin({ - pluginId: 'proxy', - register(env) { - env.registerInit({ - deps: { - config: coreServices.rootConfig, - discovery: coreServices.discovery, - logger: coreServices.logger, - httpRouter: coreServices.httpRouter, - }, - async init({ config, discovery, logger, httpRouter }) { - await createRouterInternal({ - config, - discovery, - logger: loggerToWinstonLogger(logger), - httpRouterService: httpRouter, - }); - }, - }); - }, -}); +/** @alpha */ +const _feature = proxyPlugin; +export default _feature; diff --git a/plugins/proxy-backend/src/index.ts b/plugins/proxy-backend/src/index.ts index 4da38f069c..ae0b6235f9 100644 --- a/plugins/proxy-backend/src/index.ts +++ b/plugins/proxy-backend/src/index.ts @@ -14,16 +14,11 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - /** * A Backstage backend plugin that helps you set up proxy endpoints in the backend * * @packageDocumentation */ +export { proxyPlugin as default } from './plugin'; export * from './service'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/proxy-backend/src/plugin.ts b/plugins/proxy-backend/src/plugin.ts new file mode 100644 index 0000000000..1039a6a3e8 --- /dev/null +++ b/plugins/proxy-backend/src/plugin.ts @@ -0,0 +1,49 @@ +/* + * Copyright 2023 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 { loggerToWinstonLogger } from '@backstage/backend-common'; +import { + createBackendPlugin, + coreServices, +} from '@backstage/backend-plugin-api'; +import { createRouterInternal } from './service/router'; + +/** + * The proxy backend plugin. + * + * @public + */ +export const proxyPlugin = createBackendPlugin({ + pluginId: 'proxy', + register(env) { + env.registerInit({ + deps: { + config: coreServices.rootConfig, + discovery: coreServices.discovery, + logger: coreServices.logger, + httpRouter: coreServices.httpRouter, + }, + async init({ config, discovery, logger, httpRouter }) { + await createRouterInternal({ + config, + discovery, + logger: loggerToWinstonLogger(logger), + httpRouterService: httpRouter, + }); + }, + }); + }, +}); diff --git a/plugins/scaffolder-backend/report-alpha.api.md b/plugins/scaffolder-backend/report-alpha.api.md index d53ce7a4e4..89d4fecd8c 100644 --- a/plugins/scaffolder-backend/report-alpha.api.md +++ b/plugins/scaffolder-backend/report-alpha.api.md @@ -26,6 +26,10 @@ export const createScaffolderTemplateConditionalDecision: ( conditions: PermissionCriteria>, ) => ConditionalPolicyDecision; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + // @alpha export const scaffolderActionConditions: Conditions<{ hasActionId: PermissionRule< @@ -77,10 +81,6 @@ export const scaffolderActionConditions: Conditions<{ >; }>; -// @alpha -const scaffolderPlugin: BackendFeature; -export default scaffolderPlugin; - // @alpha export const scaffolderTemplateConditions: Conditions<{ hasTag: PermissionRule< @@ -95,6 +95,7 @@ export const scaffolderTemplateConditions: Conditions<{ // Warnings were encountered during analysis: // +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/conditionExports.d.ts:48:22 - (ae-undocumented) Missing documentation for "createScaffolderActionConditionalDecision". // (No @packageDocumentation comment for this package) diff --git a/plugins/scaffolder-backend/report.api.md b/plugins/scaffolder-backend/report.api.md index 979c8ddad3..d3dddc21e9 100644 --- a/plugins/scaffolder-backend/report.api.md +++ b/plugins/scaffolder-backend/report.api.md @@ -505,10 +505,6 @@ export type DatabaseTaskStoreOptions = { // @public @deprecated export const executeShellCommand: typeof executeShellCommand_2; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public @deprecated export const fetchContents: typeof fetchContents_2; @@ -565,6 +561,10 @@ export type RunCommandOptions = ExecuteShellCommandOptions; // @public @deprecated export const ScaffolderEntitiesProcessor: typeof ScaffolderEntitiesProcessor_2; +// @public +const scaffolderPlugin: BackendFeature; +export default scaffolderPlugin; + // @public @deprecated export type SerializedTask = SerializedTask_2; @@ -851,7 +851,6 @@ export type TemplatePermissionRuleInput< // src/deprecated.d.ts:13:22 - (ae-undocumented) Missing documentation for "createTemplateAction". // src/deprecated.d.ts:18:1 - (ae-undocumented) Missing documentation for "TaskSecrets". // src/deprecated.d.ts:23:1 - (ae-undocumented) Missing documentation for "TemplateAction". -// src/index.d.ts:10:15 - (ae-undocumented) Missing documentation for "_feature". // src/lib/templating/SecureTemplater.d.ts:6:1 - (ae-undocumented) Missing documentation for "TemplateFilter". // src/lib/templating/SecureTemplater.d.ts:11:1 - (ae-undocumented) Missing documentation for "TemplateGlobal". // src/scaffolder/actions/TemplateActionRegistry.d.ts:8:5 - (ae-undocumented) Missing documentation for "register". diff --git a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts index cf0f557639..17f7480a7d 100644 --- a/plugins/scaffolder-backend/src/ScaffolderPlugin.ts +++ b/plugins/scaffolder-backend/src/ScaffolderPlugin.ts @@ -54,7 +54,7 @@ import { createRouter } from './service/router'; /** * Scaffolder plugin * - * @alpha + * @public */ export const scaffolderPlugin = createBackendPlugin({ pluginId: 'scaffolder', diff --git a/plugins/scaffolder-backend/src/alpha.ts b/plugins/scaffolder-backend/src/alpha.ts index 4c4885413b..7d1d8fe0ef 100644 --- a/plugins/scaffolder-backend/src/alpha.ts +++ b/plugins/scaffolder-backend/src/alpha.ts @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { scaffolderPlugin } from './ScaffolderPlugin'; + +/** @alpha */ +const _feature = scaffolderPlugin; +export default _feature; export * from './service'; -export { scaffolderPlugin as default } from './ScaffolderPlugin'; diff --git a/plugins/scaffolder-backend/src/index.ts b/plugins/scaffolder-backend/src/index.ts index e53a9a9044..dddd42d83f 100644 --- a/plugins/scaffolder-backend/src/index.ts +++ b/plugins/scaffolder-backend/src/index.ts @@ -14,20 +14,15 @@ * limitations under the License. */ -import { scaffolderPlugin as feature } from './ScaffolderPlugin'; - /** * The Backstage backend plugin that helps you create new things * * @packageDocumentation */ +export { scaffolderPlugin as default } from './ScaffolderPlugin'; export * from './scaffolder'; export * from './service/router'; export * from './lib'; -/** @public */ -const _feature = feature; -export default _feature; - export * from './deprecated'; diff --git a/plugins/search-backend/dev/index.ts b/plugins/search-backend/dev/index.ts index 9c108c0de1..f03689d63c 100644 --- a/plugins/search-backend/dev/index.ts +++ b/plugins/search-backend/dev/index.ts @@ -17,5 +17,5 @@ import { createBackend } from '@backstage/backend-defaults'; const backend = createBackend(); -backend.add(import('../src/alpha')); +backend.add(import('../src/plugin')); backend.start(); diff --git a/plugins/search-backend/report-alpha.api.md b/plugins/search-backend/report-alpha.api.md index 8221359a36..9cae91f291 100644 --- a/plugins/search-backend/report-alpha.api.md +++ b/plugins/search-backend/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const _default: BackendFeature; -export default _default; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend/report.api.md b/plugins/search-backend/report.api.md index e770c0276e..e1cf271dc9 100644 --- a/plugins/search-backend/report.api.md +++ b/plugins/search-backend/report.api.md @@ -18,9 +18,9 @@ import { SearchEngine } from '@backstage/plugin-search-backend-node'; // @public @deprecated (undocumented) export function createRouter(options: RouterOptions): Promise; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const _default: BackendFeature; +export default _default; // @public @deprecated (undocumented) export type RouterOptions = { @@ -36,7 +36,6 @@ export type RouterOptions = { // Warnings were encountered during analysis: // -// src/index.d.ts:8:15 - (ae-undocumented) Missing documentation for "_feature". // src/service/router.d.ts:11:1 - (ae-undocumented) Missing documentation for "RouterOptions". // src/service/router.d.ts:25:1 - (ae-undocumented) Missing documentation for "createRouter". ``` diff --git a/plugins/search-backend/src/alpha.ts b/plugins/search-backend/src/alpha.ts index 3a3ba82c3e..a8c814004b 100644 --- a/plugins/search-backend/src/alpha.ts +++ b/plugins/search-backend/src/alpha.ts @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Backstage Authors + * Copyright 2024 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,140 +14,8 @@ * limitations under the License. */ -import { - coreServices, - createBackendPlugin, -} from '@backstage/backend-plugin-api'; -import { - LunrSearchEngine, - RegisterCollatorParameters, - RegisterDecoratorParameters, - SearchEngine, -} from '@backstage/plugin-search-backend-node'; -import { - SearchEngineRegistryExtensionPoint, - searchEngineRegistryExtensionPoint, - searchIndexRegistryExtensionPoint, - SearchIndexRegistryExtensionPoint, - searchIndexServiceRef, -} from '@backstage/plugin-search-backend-node/alpha'; +import { default as feature } from './plugin'; -import { createRouter } from './service/router'; - -class SearchIndexRegistry implements SearchIndexRegistryExtensionPoint { - private collators: RegisterCollatorParameters[] = []; - private decorators: RegisterDecoratorParameters[] = []; - - public addCollator(options: RegisterCollatorParameters): void { - this.collators.push(options); - } - - public addDecorator(options: RegisterDecoratorParameters): void { - this.decorators.push(options); - } - - public getCollators(): RegisterCollatorParameters[] { - return this.collators; - } - - public getDecorators(): RegisterDecoratorParameters[] { - return this.decorators; - } -} - -class SearchEngineRegistry implements SearchEngineRegistryExtensionPoint { - private searchEngine: SearchEngine | null = null; - - public setSearchEngine(searchEngine: SearchEngine): void { - if (this.searchEngine) { - throw new Error('Multiple Search engines is not supported at this time'); - } - this.searchEngine = searchEngine; - } - - public getSearchEngine(): SearchEngine | null { - return this.searchEngine; - } -} - -/** - * The Search plugin is responsible for starting search indexing processes and return search results. - * @alpha - */ -export default createBackendPlugin({ - pluginId: 'search', - register(env) { - const searchIndexRegistry = new SearchIndexRegistry(); - env.registerExtensionPoint( - searchIndexRegistryExtensionPoint, - searchIndexRegistry, - ); - - const searchEngineRegistry = new SearchEngineRegistry(); - env.registerExtensionPoint( - searchEngineRegistryExtensionPoint, - searchEngineRegistry, - ); - - env.registerInit({ - deps: { - logger: coreServices.logger, - config: coreServices.rootConfig, - discovery: coreServices.discovery, - permissions: coreServices.permissions, - auth: coreServices.auth, - http: coreServices.httpRouter, - httpAuth: coreServices.httpAuth, - lifecycle: coreServices.rootLifecycle, - searchIndexService: searchIndexServiceRef, - }, - async init({ - config, - logger, - discovery, - permissions, - auth, - http, - httpAuth, - lifecycle, - searchIndexService, - }) { - let searchEngine = searchEngineRegistry.getSearchEngine(); - if (!searchEngine) { - searchEngine = new LunrSearchEngine({ - logger, - }); - } - - const collators = searchIndexRegistry.getCollators(); - const decorators = searchIndexRegistry.getDecorators(); - searchIndexService.init({ - searchEngine: searchEngine!, - collators, - decorators, - }); - - lifecycle.addStartupHook(async () => { - await searchIndexService.start(); - }); - - lifecycle.addShutdownHook(async () => { - await searchIndexService.stop(); - }); - - const router = await createRouter({ - config, - discovery, - permissions, - auth, - httpAuth, - logger, - engine: searchEngine, - types: searchIndexService.getDocumentTypes(), - }); - - http.use(router); - }, - }); - }, -}); +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/search-backend/src/index.ts b/plugins/search-backend/src/index.ts index 69c2b1483d..2bd58730b1 100644 --- a/plugins/search-backend/src/index.ts +++ b/plugins/search-backend/src/index.ts @@ -14,16 +14,11 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - /** * The Backstage backend plugin that provides your backstage app with search * * @packageDocumentation */ +export { default } from './plugin'; export * from './service/router'; - -/** @public */ -const _feature = feature; -export default _feature; diff --git a/plugins/search-backend/src/alpha.test.ts b/plugins/search-backend/src/plugin.test.ts similarity index 96% rename from plugins/search-backend/src/alpha.test.ts rename to plugins/search-backend/src/plugin.test.ts index dfe80987d4..905d384bb1 100644 --- a/plugins/search-backend/src/alpha.test.ts +++ b/plugins/search-backend/src/plugin.test.ts @@ -16,7 +16,7 @@ import { startTestBackend } from '@backstage/backend-test-utils'; import request from 'supertest'; -import searchPlugin from './alpha'; +import searchPlugin from './plugin'; describe('searchPlugin', () => { it('should serve search results on query endpoint', async () => { diff --git a/plugins/search-backend/src/plugin.ts b/plugins/search-backend/src/plugin.ts new file mode 100644 index 0000000000..6f4f0dc4cb --- /dev/null +++ b/plugins/search-backend/src/plugin.ts @@ -0,0 +1,153 @@ +/* + * Copyright 2023 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 { + coreServices, + createBackendPlugin, +} from '@backstage/backend-plugin-api'; +import { + LunrSearchEngine, + RegisterCollatorParameters, + RegisterDecoratorParameters, + SearchEngine, +} from '@backstage/plugin-search-backend-node'; +import { + SearchEngineRegistryExtensionPoint, + searchEngineRegistryExtensionPoint, + searchIndexRegistryExtensionPoint, + SearchIndexRegistryExtensionPoint, + searchIndexServiceRef, +} from '@backstage/plugin-search-backend-node/alpha'; + +import { createRouter } from './service/router'; + +class SearchIndexRegistry implements SearchIndexRegistryExtensionPoint { + private collators: RegisterCollatorParameters[] = []; + private decorators: RegisterDecoratorParameters[] = []; + + public addCollator(options: RegisterCollatorParameters): void { + this.collators.push(options); + } + + public addDecorator(options: RegisterDecoratorParameters): void { + this.decorators.push(options); + } + + public getCollators(): RegisterCollatorParameters[] { + return this.collators; + } + + public getDecorators(): RegisterDecoratorParameters[] { + return this.decorators; + } +} + +class SearchEngineRegistry implements SearchEngineRegistryExtensionPoint { + private searchEngine: SearchEngine | null = null; + + public setSearchEngine(searchEngine: SearchEngine): void { + if (this.searchEngine) { + throw new Error('Multiple Search engines is not supported at this time'); + } + this.searchEngine = searchEngine; + } + + public getSearchEngine(): SearchEngine | null { + return this.searchEngine; + } +} + +/** + * The Search plugin is responsible for starting search indexing processes and return search results. + * @public + */ +export default createBackendPlugin({ + pluginId: 'search', + register(env) { + const searchIndexRegistry = new SearchIndexRegistry(); + env.registerExtensionPoint( + searchIndexRegistryExtensionPoint, + searchIndexRegistry, + ); + + const searchEngineRegistry = new SearchEngineRegistry(); + env.registerExtensionPoint( + searchEngineRegistryExtensionPoint, + searchEngineRegistry, + ); + + env.registerInit({ + deps: { + logger: coreServices.logger, + config: coreServices.rootConfig, + discovery: coreServices.discovery, + permissions: coreServices.permissions, + auth: coreServices.auth, + http: coreServices.httpRouter, + httpAuth: coreServices.httpAuth, + lifecycle: coreServices.rootLifecycle, + searchIndexService: searchIndexServiceRef, + }, + async init({ + config, + logger, + discovery, + permissions, + auth, + http, + httpAuth, + lifecycle, + searchIndexService, + }) { + let searchEngine = searchEngineRegistry.getSearchEngine(); + if (!searchEngine) { + searchEngine = new LunrSearchEngine({ + logger, + }); + } + + const collators = searchIndexRegistry.getCollators(); + const decorators = searchIndexRegistry.getDecorators(); + searchIndexService.init({ + searchEngine: searchEngine!, + collators, + decorators, + }); + + lifecycle.addStartupHook(async () => { + await searchIndexService.start(); + }); + + lifecycle.addShutdownHook(async () => { + await searchIndexService.stop(); + }); + + const router = await createRouter({ + config, + discovery, + permissions, + auth, + httpAuth, + logger, + engine: searchEngine, + types: searchIndexService.getDocumentTypes(), + }); + + http.use(router); + }, + }); + }, +}); diff --git a/plugins/techdocs-backend/report-alpha.api.md b/plugins/techdocs-backend/report-alpha.api.md index 9074c87138..d97dc13982 100644 --- a/plugins/techdocs-backend/report-alpha.api.md +++ b/plugins/techdocs-backend/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const techdocsPlugin: BackendFeature; -export default techdocsPlugin; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/techdocs-backend/report.api.md b/plugins/techdocs-backend/report.api.md index f61518b587..569df8ee7c 100644 --- a/plugins/techdocs-backend/report.api.md +++ b/plugins/techdocs-backend/report.api.md @@ -54,10 +54,6 @@ export const DefaultTechDocsCollatorFactory: typeof DefaultTechDocsCollatorFacto // @public @deprecated (undocumented) export type DocsBuildStrategy = DocsBuildStrategy_2; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; - // @public export type OutOfTheBoxDeploymentOptions = { preparers: PreparerBuilder; @@ -116,14 +112,17 @@ export type TechDocsCollatorOptions = { // @public @deprecated (undocumented) export type TechDocsDocument = TechDocsDocument_2; +// @public +const techdocsPlugin: BackendFeature; +export default techdocsPlugin; + export * from '@backstage/plugin-techdocs-node'; // Warnings were encountered during analysis: // -// src/index.d.ts:13:15 - (ae-undocumented) Missing documentation for "_feature". -// src/index.d.ts:19:1 - (ae-undocumented) Missing documentation for "DocsBuildStrategy". -// src/index.d.ts:24:1 - (ae-undocumented) Missing documentation for "ShouldBuildParameters". -// src/index.d.ts:31:1 - (ae-undocumented) Missing documentation for "TechDocsDocument". +// src/index.d.ts:17:1 - (ae-undocumented) Missing documentation for "DocsBuildStrategy". +// src/index.d.ts:22:1 - (ae-undocumented) Missing documentation for "ShouldBuildParameters". +// src/index.d.ts:29:1 - (ae-undocumented) Missing documentation for "TechDocsDocument". // src/search/DefaultTechDocsCollator.d.ts:32:5 - (ae-undocumented) Missing documentation for "type". // src/search/DefaultTechDocsCollator.d.ts:33:5 - (ae-undocumented) Missing documentation for "visibilityPermission". // src/search/DefaultTechDocsCollator.d.ts:35:5 - (ae-undocumented) Missing documentation for "fromConfig". diff --git a/plugins/techdocs-backend/src/alpha.ts b/plugins/techdocs-backend/src/alpha.ts index 7ac39bde91..2c69426759 100644 --- a/plugins/techdocs-backend/src/alpha.ts +++ b/plugins/techdocs-backend/src/alpha.ts @@ -14,4 +14,8 @@ * limitations under the License. */ -export { techdocsPlugin as default } from './plugin'; +import { techdocsPlugin } from './plugin'; + +/** @alpha */ +const _feature = techdocsPlugin; +export default _feature; diff --git a/plugins/techdocs-backend/src/index.ts b/plugins/techdocs-backend/src/index.ts index eb047ec4f0..c5fbf10c60 100644 --- a/plugins/techdocs-backend/src/index.ts +++ b/plugins/techdocs-backend/src/index.ts @@ -25,8 +25,8 @@ import { DocsBuildStrategy as _DocsBuildStrategy, TechDocsDocument as _TechDocsDocument, } from '@backstage/plugin-techdocs-node'; -import { techdocsPlugin as feature } from './plugin'; +export { techdocsPlugin as default } from './plugin'; export { createRouter } from './service'; export type { RouterOptions, @@ -43,10 +43,6 @@ export type { TechDocsCollatorOptions, } from './search'; -/** @public */ -const _feature = feature; -export default _feature; - /** * @public * @deprecated import from `@backstage/plugin-techdocs-node` instead diff --git a/plugins/techdocs-backend/src/plugin.ts b/plugins/techdocs-backend/src/plugin.ts index 9b5ae21a52..13b2e73563 100644 --- a/plugins/techdocs-backend/src/plugin.ts +++ b/plugins/techdocs-backend/src/plugin.ts @@ -44,7 +44,7 @@ import * as winston from 'winston'; /** * The TechDocs plugin is responsible for serving and building documentation for any entity. - * @alpha + * @public */ export const techdocsPlugin = createBackendPlugin({ pluginId: 'techdocs', diff --git a/plugins/user-settings-backend/dev/index.ts b/plugins/user-settings-backend/dev/index.ts index 43c75d24df..7180ff5baa 100644 --- a/plugins/user-settings-backend/dev/index.ts +++ b/plugins/user-settings-backend/dev/index.ts @@ -17,5 +17,5 @@ import { createBackend } from '@backstage/backend-defaults'; const backend = createBackend(); -backend.add(import('../src/alpha')); +backend.add(import('../src/plugin')); backend.start(); diff --git a/plugins/user-settings-backend/report-alpha.api.md b/plugins/user-settings-backend/report-alpha.api.md index 6fe4f10fe7..02c93f9aee 100644 --- a/plugins/user-settings-backend/report-alpha.api.md +++ b/plugins/user-settings-backend/report-alpha.api.md @@ -5,9 +5,13 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -// @alpha -const _default: BackendFeature; -export default _default; +// @alpha (undocumented) +const _feature: BackendFeature; +export default _feature; + +// Warnings were encountered during analysis: +// +// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/user-settings-backend/report.api.md b/plugins/user-settings-backend/report.api.md index df35f0cd82..cbbd8d5d6d 100644 --- a/plugins/user-settings-backend/report.api.md +++ b/plugins/user-settings-backend/report.api.md @@ -12,9 +12,9 @@ import { SignalsService } from '@backstage/plugin-signals-node'; // @public @deprecated export function createRouter(options: RouterOptions): Promise; -// @public (undocumented) -const _feature: BackendFeature; -export default _feature; +// @public +const _default: BackendFeature; +export default _default; // @public @deprecated export type RouterOptions = { @@ -23,9 +23,5 @@ export type RouterOptions = { signals?: SignalsService; }; -// Warnings were encountered during analysis: -// -// src/index.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/user-settings-backend/src/alpha.ts b/plugins/user-settings-backend/src/alpha.ts index ea24389e46..a8c814004b 100644 --- a/plugins/user-settings-backend/src/alpha.ts +++ b/plugins/user-settings-backend/src/alpha.ts @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Backstage Authors + * Copyright 2024 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,37 +14,8 @@ * limitations under the License. */ -import { - coreServices, - createBackendPlugin, -} from '@backstage/backend-plugin-api'; -import { createRouterInternal } from './service/router'; -import { signalsServiceRef } from '@backstage/plugin-signals-node'; -import { DatabaseUserSettingsStore } from './database/DatabaseUserSettingsStore'; +import { default as feature } from './plugin'; -/** - * The user settings backend plugin. - * - * @alpha - */ -export default createBackendPlugin({ - pluginId: 'user-settings', - register(env) { - env.registerInit({ - deps: { - database: coreServices.database, - httpAuth: coreServices.httpAuth, - httpRouter: coreServices.httpRouter, - signals: signalsServiceRef, - }, - async init({ database, httpAuth, httpRouter, signals }) { - const userSettingsStore = await DatabaseUserSettingsStore.create({ - database, - }); - httpRouter.use( - await createRouterInternal({ userSettingsStore, httpAuth, signals }), - ); - }, - }); - }, -}); +/** @alpha */ +const _feature = feature; +export default _feature; diff --git a/plugins/user-settings-backend/src/index.ts b/plugins/user-settings-backend/src/index.ts index 3728c573ed..daf59c47e0 100644 --- a/plugins/user-settings-backend/src/index.ts +++ b/plugins/user-settings-backend/src/index.ts @@ -14,11 +14,6 @@ * limitations under the License. */ -import { default as feature } from './alpha'; - -/** @public */ -const _feature = feature; -export default _feature; - +export { default } from './plugin'; export * from './deprecated'; export * from './database'; diff --git a/plugins/user-settings-backend/src/plugin.ts b/plugins/user-settings-backend/src/plugin.ts new file mode 100644 index 0000000000..26fd3de908 --- /dev/null +++ b/plugins/user-settings-backend/src/plugin.ts @@ -0,0 +1,50 @@ +/* + * Copyright 2023 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 { + coreServices, + createBackendPlugin, +} from '@backstage/backend-plugin-api'; +import { createRouterInternal } from './service/router'; +import { signalsServiceRef } from '@backstage/plugin-signals-node'; +import { DatabaseUserSettingsStore } from './database/DatabaseUserSettingsStore'; + +/** + * The user settings backend plugin. + * + * @public + */ +export default createBackendPlugin({ + pluginId: 'user-settings', + register(env) { + env.registerInit({ + deps: { + database: coreServices.database, + httpAuth: coreServices.httpAuth, + httpRouter: coreServices.httpRouter, + signals: signalsServiceRef, + }, + async init({ database, httpAuth, httpRouter, signals }) { + const userSettingsStore = await DatabaseUserSettingsStore.create({ + database, + }); + httpRouter.use( + await createRouterInternal({ userSettingsStore, httpAuth, signals }), + ); + }, + }); + }, +}); From 96a3eba552a5337fc0ba7f61d6059913070111c9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Oct 2024 09:56:15 +0200 Subject: [PATCH 122/268] plugins/{kubernetes,techdocs}-backend: fix circular imports Signed-off-by: Patrik Oldsberg --- plugins/kubernetes-backend/src/plugin.ts | 2 +- plugins/techdocs-backend/src/plugin.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/kubernetes-backend/src/plugin.ts b/plugins/kubernetes-backend/src/plugin.ts index 83b2c66b5c..44d5df6484 100644 --- a/plugins/kubernetes-backend/src/plugin.ts +++ b/plugins/kubernetes-backend/src/plugin.ts @@ -20,7 +20,7 @@ import { } from '@backstage/backend-plugin-api'; import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; -import { KubernetesBuilder } from '@backstage/plugin-kubernetes-backend'; +import { KubernetesBuilder } from './service'; import { type AuthenticationStrategy, diff --git a/plugins/techdocs-backend/src/plugin.ts b/plugins/techdocs-backend/src/plugin.ts index 13b2e73563..c7d6ae5259 100644 --- a/plugins/techdocs-backend/src/plugin.ts +++ b/plugins/techdocs-backend/src/plugin.ts @@ -38,7 +38,7 @@ import { techdocsPreparerExtensionPoint, techdocsPublisherExtensionPoint, } from '@backstage/plugin-techdocs-node'; -import { createRouter } from '@backstage/plugin-techdocs-backend'; +import { createRouter } from './service'; import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; import * as winston from 'winston'; From ff27933a1748f13c5d7f0f06dcd6f10dcf0b5102 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 9 Oct 2024 16:11:32 +0200 Subject: [PATCH 123/268] chore: added some more default api implementations, and default sign in page Signed-off-by: blam --- plugins/app/package.json | 1 + plugins/app/src/defaultApis.ts | 21 ++++++++++++++++ .../app/src/extensions/DefaultSignInPage.tsx | 25 +++++++++++++++++++ plugins/app/src/extensions/index.ts | 1 + plugins/app/src/plugin.ts | 2 ++ 5 files changed, 50 insertions(+) create mode 100644 plugins/app/src/extensions/DefaultSignInPage.tsx diff --git a/plugins/app/package.json b/plugins/app/package.json index d45f08b5df..a14e1eab43 100644 --- a/plugins/app/package.json +++ b/plugins/app/package.json @@ -40,6 +40,7 @@ "@backstage/core-components": "workspace:^", "@backstage/core-plugin-api": "workspace:^", "@backstage/frontend-plugin-api": "workspace:^", + "@backstage/integration-react": "workspace:^", "@backstage/plugin-permission-react": "workspace:^", "@backstage/theme": "workspace:^", "@material-ui/core": "^4.9.13", diff --git a/plugins/app/src/defaultApis.ts b/plugins/app/src/defaultApis.ts index 85c89a6278..b4f6fa0b48 100644 --- a/plugins/app/src/defaultApis.ts +++ b/plugins/app/src/defaultApis.ts @@ -61,6 +61,11 @@ import { vmwareCloudAuthApiRef, } from '@backstage/core-plugin-api'; import { ApiBlueprint } from '@backstage/frontend-plugin-api'; +import { + ScmAuth, + ScmIntegrationsApi, + scmIntegrationsApiRef, +} from '@backstage/integration-react'; import { permissionApiRef, IdentityPermissionApi, @@ -380,4 +385,20 @@ export const apis = [ }), }, }), + ApiBlueprint.make({ + name: 'scm-auth', + params: { + factory: ScmAuth.createDefaultApiFactory(), + }, + }), + ApiBlueprint.make({ + name: 'scm-integrations', + params: { + factory: createApiFactory({ + api: scmIntegrationsApiRef, + deps: { configApi: configApiRef }, + factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi), + }), + }, + }), ] as const; diff --git a/plugins/app/src/extensions/DefaultSignInPage.tsx b/plugins/app/src/extensions/DefaultSignInPage.tsx new file mode 100644 index 0000000000..29b384c7a2 --- /dev/null +++ b/plugins/app/src/extensions/DefaultSignInPage.tsx @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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 { SignInPageBlueprint } from '@backstage/frontend-plugin-api'; +import { SignInPage } from '@backstage/core-components'; + +export const DefaultSignInPage = SignInPageBlueprint.make({ + params: { + loader: async () => props => + , + }, +}); diff --git a/plugins/app/src/extensions/index.ts b/plugins/app/src/extensions/index.ts index 157f7ddb62..22b020a441 100644 --- a/plugins/app/src/extensions/index.ts +++ b/plugins/app/src/extensions/index.ts @@ -24,6 +24,7 @@ export { ComponentsApi } from './ComponentsApi'; export { IconsApi } from './IconsApi'; export { FeatureFlagsApi } from './FeatureFlagsApi'; export { TranslationsApi } from './TranslationsApi'; +export { DefaultSignInPage } from './DefaultSignInPage'; export { DefaultProgressComponent, DefaultErrorBoundaryComponent, diff --git a/plugins/app/src/plugin.ts b/plugins/app/src/plugin.ts index ff0c69faec..18c412bf77 100644 --- a/plugins/app/src/plugin.ts +++ b/plugins/app/src/plugin.ts @@ -34,6 +34,7 @@ import { DefaultErrorBoundaryComponent, oauthRequestDialogAppRootElement, alertDisplayAppRootElement, + DefaultSignInPage, } from './extensions'; import { apis } from './defaultApis'; @@ -58,6 +59,7 @@ export const appPlugin = createFrontendPlugin({ DefaultProgressComponent, DefaultNotFoundErrorPageComponent, DefaultErrorBoundaryComponent, + DefaultSignInPage, oauthRequestDialogAppRootElement, alertDisplayAppRootElement, ], From 65d7b507b49a2165bc56ac7e80176710c1035a7f Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 9 Oct 2024 16:14:39 +0200 Subject: [PATCH 124/268] chore: updating api-reports Signed-off-by: blam --- plugins/app/report.api.md | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/plugins/app/report.api.md b/plugins/app/report.api.md index 1ff398a346..208f9dcfb0 100644 --- a/plugins/app/report.api.md +++ b/plugins/app/report.api.md @@ -383,6 +383,21 @@ const appPlugin: FrontendPlugin< factory: AnyApiFactory; }; }>; + 'sign-in-page:app': ExtensionDefinition<{ + kind: 'sign-in-page'; + name: undefined; + config: {}; + configInput: {}; + output: ConfigurableExtensionDataRef< + ComponentType, + 'core.sign-in-page.component', + {} + >; + inputs: {}; + params: { + loader: () => Promise>; + }; + }>; 'app-root-element:app/oauth-request-dialog': ExtensionDefinition<{ kind: 'app-root-element'; name: 'oauth-request-dialog'; @@ -705,6 +720,36 @@ const appPlugin: FrontendPlugin< factory: AnyApiFactory; }; }>; + 'api:app/scm-auth': ExtensionDefinition<{ + kind: 'api'; + name: 'scm-auth'; + config: {}; + configInput: {}; + output: ConfigurableExtensionDataRef< + AnyApiFactory, + 'core.api.factory', + {} + >; + inputs: {}; + params: { + factory: AnyApiFactory; + }; + }>; + 'api:app/scm-integrations': ExtensionDefinition<{ + kind: 'api'; + name: 'scm-integrations'; + config: {}; + configInput: {}; + output: ConfigurableExtensionDataRef< + AnyApiFactory, + 'core.api.factory', + {} + >; + inputs: {}; + params: { + factory: AnyApiFactory; + }; + }>; } >; export default appPlugin; From b36be7a3ed9d073a86bf2403f198d1a78f2ca9c3 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 9 Oct 2024 16:28:34 +0200 Subject: [PATCH 125/268] chore: changeset Signed-off-by: blam --- .changeset/pretty-pans-exist.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pretty-pans-exist.md diff --git a/.changeset/pretty-pans-exist.md b/.changeset/pretty-pans-exist.md new file mode 100644 index 0000000000..e9ccdda0e0 --- /dev/null +++ b/.changeset/pretty-pans-exist.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-app': patch +--- + +Added missing default `SignInPageExtension` which by default uses guest auth, missing `ApiExtensions` for `scmAuth` From 374d3f70406f114234a6e3eddbf4daeda380f247 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 9 Oct 2024 16:33:06 +0200 Subject: [PATCH 126/268] chore: need a yarn.lock Signed-off-by: blam --- .../frontend-defaults/src/createApp.test.tsx | 17 ++++++++++++++++- .../src/app/renderInTestApp.tsx | 3 +++ yarn.lock | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/frontend-defaults/src/createApp.test.tsx b/packages/frontend-defaults/src/createApp.test.tsx index 06872a5691..899d5d1640 100644 --- a/packages/frontend-defaults/src/createApp.test.tsx +++ b/packages/frontend-defaults/src/createApp.test.tsx @@ -29,9 +29,17 @@ import { CreateAppFeatureLoader, createApp } from './createApp'; import { mockApis, renderWithEffects } from '@backstage/test-utils'; import React from 'react'; import { featureFlagsApiRef, useApi } from '@backstage/core-plugin-api'; -import appPlugin from '@backstage/plugin-app'; +import { default as appPluginOriginal } from '@backstage/plugin-app'; describe('createApp', () => { + const appPlugin = appPluginOriginal.withOverrides({ + extensions: [ + appPluginOriginal + .getExtension('sign-in-page:app') + .override({ disabled: true }), + ], + }); + it('should allow themes to be installed', async () => { const app = createApp({ configLoader: async () => ({ @@ -98,6 +106,7 @@ describe('createApp', () => { }), ], }), + appPlugin, ], }); @@ -231,6 +240,7 @@ describe('createApp', () => { const app = createApp({ configLoader: async () => ({ config: mockApis.config() }), features: [ + appPlugin, createFrontendPlugin({ id: 'my-plugin', extensions: [ @@ -277,6 +287,8 @@ describe('createApp', () => { + + themes [ @@ -317,6 +329,9 @@ describe('createApp', () => { ] + signInPage [ + + ] ] diff --git a/packages/frontend-test-utils/src/app/renderInTestApp.tsx b/packages/frontend-test-utils/src/app/renderInTestApp.tsx index e53566a118..7f03921077 100644 --- a/packages/frontend-test-utils/src/app/renderInTestApp.tsx +++ b/packages/frontend-test-utils/src/app/renderInTestApp.tsx @@ -96,6 +96,9 @@ const NavItem = (props: { const appPluginOverride = appPlugin.withOverrides({ extensions: [ + appPlugin.getExtension('sign-in-page:app').override({ + disabled: true, + }), appPlugin.getExtension('app/nav').override({ output: [coreExtensionData.reactElement], factory(_originalFactory, { inputs }) { diff --git a/yarn.lock b/yarn.lock index f8618cba94..f50c38ad17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4978,6 +4978,7 @@ __metadata: "@backstage/dev-utils": "workspace:^" "@backstage/frontend-plugin-api": "workspace:^" "@backstage/frontend-test-utils": "workspace:^" + "@backstage/integration-react": "workspace:^" "@backstage/plugin-permission-react": "workspace:^" "@backstage/theme": "workspace:^" "@material-ui/core": ^4.9.13 From 47aea432092261f65b68e9a14471f275002f9b82 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 11:17:22 +0200 Subject: [PATCH 127/268] chore: cleanup app-next a little bit Signed-off-by: blam --- packages/app-next/src/App.tsx | 32 ----------------- .../app-next/src/overrides/SignInPage.tsx | 35 ------------------- 2 files changed, 67 deletions(-) delete mode 100644 packages/app-next/src/overrides/SignInPage.tsx diff --git a/packages/app-next/src/App.tsx b/packages/app-next/src/App.tsx index 79adc13daf..1992d5b35f 100644 --- a/packages/app-next/src/App.tsx +++ b/packages/app-next/src/App.tsx @@ -26,7 +26,6 @@ import homePlugin, { import { coreExtensionData, createExtension, - ApiBlueprint, createFrontendModule, } from '@backstage/frontend-plugin-api'; import { @@ -41,14 +40,7 @@ import { convertLegacyApp } from '@backstage/core-compat-api'; import { FlatRoutes } from '@backstage/core-app-api'; import { Route } from 'react-router'; import { CatalogImportPage } from '@backstage/plugin-catalog-import'; -import { createApiFactory, configApiRef } from '@backstage/core-plugin-api'; -import { - ScmAuth, - ScmIntegrationsApi, - scmIntegrationsApiRef, -} from '@backstage/integration-react'; import kubernetesPlugin from '@backstage/plugin-kubernetes/alpha'; -import { signInPageModule } from './overrides/SignInPage'; import { convertLegacyPlugin } from '@backstage/core-compat-api'; import { convertLegacyPageExtension } from '@backstage/core-compat-api'; import { convertLegacyEntityContentExtension } from '@backstage/plugin-catalog-react/alpha'; @@ -118,28 +110,6 @@ const customHomePageModule = createFrontendModule({ ], }); -const scmModule = createFrontendModule({ - pluginId: 'app', - extensions: [ - ApiBlueprint.make({ - name: 'scm-auth', - params: { - factory: ScmAuth.createDefaultApiFactory(), - }, - }), - ApiBlueprint.make({ - name: 'scm-integrations', - params: { - factory: createApiFactory({ - api: scmIntegrationsApiRef, - deps: { configApi: configApiRef }, - factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi), - }), - }, - }), - ], -}); - const notFoundErrorPageModule = createFrontendModule({ pluginId: 'app', extensions: [notFoundErrorPage], @@ -159,8 +129,6 @@ const app = createApp({ homePlugin, appVisualizerPlugin, kubernetesPlugin, - signInPageModule, - scmModule, notFoundErrorPageModule, customHomePageModule, ...collectedLegacyPlugins, diff --git a/packages/app-next/src/overrides/SignInPage.tsx b/packages/app-next/src/overrides/SignInPage.tsx deleted file mode 100644 index f1e37a241b..0000000000 --- a/packages/app-next/src/overrides/SignInPage.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2024 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 { SignInPage } from '@backstage/core-components'; -import { - SignInPageBlueprint, - createFrontendModule, -} from '@backstage/frontend-plugin-api'; - -const signInPage = SignInPageBlueprint.make({ - name: 'guest', - params: { - loader: async () => props => - , - }, -}); - -export const signInPageModule = createFrontendModule({ - pluginId: 'app', - extensions: [signInPage], -}); From 666d5b14314abb0cf2c3d294128acbd7c898af69 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 11:18:14 +0200 Subject: [PATCH 128/268] chore: new changeset Signed-off-by: blam --- .changeset/chilly-meals-sniff.md | 5 +++++ packages/app-next/src/index-public-experimental.tsx | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .changeset/chilly-meals-sniff.md diff --git a/.changeset/chilly-meals-sniff.md b/.changeset/chilly-meals-sniff.md new file mode 100644 index 0000000000..6776f93154 --- /dev/null +++ b/.changeset/chilly-meals-sniff.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-test-utils': patch +--- + +Disable the built-in `SignInPage` in `createExtensionTester` in order to not mess with existing tests diff --git a/packages/app-next/src/index-public-experimental.tsx b/packages/app-next/src/index-public-experimental.tsx index f258a660e3..16535dae98 100644 --- a/packages/app-next/src/index-public-experimental.tsx +++ b/packages/app-next/src/index-public-experimental.tsx @@ -15,11 +15,8 @@ */ import ReactDOM from 'react-dom/client'; -import { signInPageModule } from './overrides/SignInPage'; import { createPublicSignInApp } from '@backstage/frontend-defaults'; -const app = createPublicSignInApp({ - features: [signInPageModule], -}); +const app = createPublicSignInApp(); ReactDOM.createRoot(document.getElementById('root')!).render(app.createRoot()); From 2107965ad55f2793d067b142ab0e7ff265902fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 14 Oct 2024 12:17:01 +0200 Subject: [PATCH 129/268] nerf incremental log levels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/nasty-geese-repeat.md | 5 +++++ .../src/engine/IncrementalIngestionEngine.ts | 10 +++++----- .../src/service/IncrementalCatalogBuilder.ts | 2 -- 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 .changeset/nasty-geese-repeat.md diff --git a/.changeset/nasty-geese-repeat.md b/.changeset/nasty-geese-repeat.md new file mode 100644 index 0000000000..b000231057 --- /dev/null +++ b/.changeset/nasty-geese-repeat.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch +--- + +Turn down the logging level on most "all is well" type log messages diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts b/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts index 7a7b1d681d..4f9e205cfe 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts @@ -67,13 +67,13 @@ export class IncrementalIngestionEngine await this.manager.clearFinishedIngestions( this.options.provider.getProviderName(), ); - this.options.logger.info( + this.options.logger.debug( `incremental-engine: Ingestion ${ingestionId} rest period complete. Ingestion will start again`, ); await this.manager.setProviderComplete(ingestionId); } else { - this.options.logger.info( + this.options.logger.debug( `incremental-engine: Ingestion '${ingestionId}' rest period continuing`, ); } @@ -92,7 +92,7 @@ export class IncrementalIngestionEngine ); } else { await this.manager.setProviderInterstitial(ingestionId); - this.options.logger.info( + this.options.logger.debug( `incremental-engine: Ingestion '${ingestionId}' continuing`, ); } @@ -140,7 +140,7 @@ export class IncrementalIngestionEngine ); await this.manager.setProviderIngesting(ingestionId); } else { - this.options.logger.info( + this.options.logger.debug( `incremental-engine: Ingestion '${ingestionId}' backoff continuing`, ); } @@ -167,7 +167,7 @@ export class IncrementalIngestionEngine const providerName = this.options.provider.getProviderName(); const record = await this.manager.getCurrentIngestionRecord(providerName); if (record) { - this.options.logger.info( + this.options.logger.debug( `incremental-engine: Ingestion record found: '${record.id}'`, ); return { diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/service/IncrementalCatalogBuilder.ts b/plugins/catalog-backend-module-incremental-ingestion/src/service/IncrementalCatalogBuilder.ts index 59cdf32391..a31076c6fd 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/service/IncrementalCatalogBuilder.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/service/IncrementalCatalogBuilder.ts @@ -89,8 +89,6 @@ export class IncrementalCatalogBuilder { entityProvider: provider.getProviderName(), }); - logger.info(`Connecting`); - engine = new IncrementalIngestionEngine({ ...options, ready, From f98ca6919574a9c877b805ee6a708973ff9ade19 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Oct 2024 14:01:44 +0200 Subject: [PATCH 130/268] cli: remove test code Signed-off-by: Patrik Oldsberg --- packages/cli/src/commands/repo/test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/cli/src/commands/repo/test.ts b/packages/cli/src/commands/repo/test.ts index 87f8e004b0..1d59ba3d63 100644 --- a/packages/cli/src/commands/repo/test.ts +++ b/packages/cli/src/commands/repo/test.ts @@ -241,7 +241,6 @@ export async function command(opts: OptionValues, cmd: Command): Promise { return; } - selectedProjects = selectedProjects.filter(pkg => pkg.includes('app')); args.push('--selectProjects', ...selectedProjects); } From 1acd16ecbea406bded68cbc194d1e99ff0306ee5 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 10 Oct 2024 09:41:07 +0200 Subject: [PATCH 131/268] feat: added the ability to disable catalog processing Signed-off-by: blam --- plugins/catalog-backend/config.d.ts | 16 +++++++++++++++- .../catalog-backend/src/service/CatalogPlugin.ts | 12 ++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/plugins/catalog-backend/config.d.ts b/plugins/catalog-backend/config.d.ts index 8bab83d4b4..57b31305c4 100644 --- a/plugins/catalog-backend/config.d.ts +++ b/plugins/catalog-backend/config.d.ts @@ -164,7 +164,6 @@ export interface Config { /** * The interval at which the catalog should process its entities. - * * @remarks * * Example: @@ -186,5 +185,20 @@ export interface Config { * housing catalog-info files. */ processingInterval?: HumanDuration; + /** + * If the processing engine should be started or not, defaults to true. + * @remarks + * + * Example: + * + * ```yaml + * catalog: + * processingInterval: false + * ``` + * + * This will enable or disable the processing of entities in the Catalog. This can be useful + * to use with Read Replica deployments of the catalog. + */ + processingEnabled?: boolean; }; } diff --git a/plugins/catalog-backend/src/service/CatalogPlugin.ts b/plugins/catalog-backend/src/service/CatalogPlugin.ts index e36e4e1333..b39898afb2 100644 --- a/plugins/catalog-backend/src/service/CatalogPlugin.ts +++ b/plugins/catalog-backend/src/service/CatalogPlugin.ts @@ -42,6 +42,7 @@ import { import { merge } from 'lodash'; import { Permission } from '@backstage/plugin-permission-common'; import { ForwardedError } from '@backstage/errors'; +import { constrainedMemory } from 'node:process'; class CatalogLocationsExtensionPointImpl implements CatalogLocationsExtensionPoint @@ -301,10 +302,13 @@ export const catalogPlugin = createBackendPlugin({ const { processingEngine, router } = await builder.build(); - lifecycle.addStartupHook(async () => { - await processingEngine.start(); - }); - lifecycle.addShutdownHook(() => processingEngine.stop()); + if (config.getOptionalBoolean('catalog.processingEnabled') ?? true) { + lifecycle.addStartupHook(async () => { + await processingEngine.start(); + }); + lifecycle.addShutdownHook(() => processingEngine.stop()); + } + httpRouter.use(router); }, }); From d1cf90ac31f22383e2a2d08dfd512a95e0700582 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 10 Oct 2024 09:44:11 +0200 Subject: [PATCH 132/268] chore: add changeset Signed-off-by: blam Signed-off-by: blam --- .changeset/silly-ligers-tan.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/silly-ligers-tan.md diff --git a/.changeset/silly-ligers-tan.md b/.changeset/silly-ligers-tan.md new file mode 100644 index 0000000000..d5b666a07b --- /dev/null +++ b/.changeset/silly-ligers-tan.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Adds the ability to disable catalog processing with `catalog.processingEnabled` config flag From e79dcef6e1673197f8c2c3527eb767713b7206a6 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 11:59:04 +0200 Subject: [PATCH 133/268] chore: support processingInterval as false Signed-off-by: blam --- .changeset/silly-ligers-tan.md | 2 +- plugins/catalog-backend/config.d.ts | 10 ++++++++-- plugins/catalog-backend/src/service/CatalogBuilder.ts | 9 +++++++++ plugins/catalog-backend/src/service/CatalogPlugin.ts | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.changeset/silly-ligers-tan.md b/.changeset/silly-ligers-tan.md index d5b666a07b..6b9097497d 100644 --- a/.changeset/silly-ligers-tan.md +++ b/.changeset/silly-ligers-tan.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-backend': patch --- -Adds the ability to disable catalog processing with `catalog.processingEnabled` config flag +Adds the ability to disable catalog processing `catalog.processingInterval: false` in `app-config` diff --git a/plugins/catalog-backend/config.d.ts b/plugins/catalog-backend/config.d.ts index 57b31305c4..2f8ec3f230 100644 --- a/plugins/catalog-backend/config.d.ts +++ b/plugins/catalog-backend/config.d.ts @@ -173,6 +173,13 @@ export interface Config { * processingInterval: { minutes: 30 } * ``` * + * or to disabled processing: + * + * ```yaml + * catalog: + * processingInterval: false + * ``` + * * Note that this is only a suggested minimum, and the actual interval may * be longer. Internally, the catalog will scale up this number by a small * factor and choose random numbers in that range to spread out the load. If @@ -184,7 +191,7 @@ export interface Config { * systems that are queried by processors, such as version control systems * housing catalog-info files. */ - processingInterval?: HumanDuration; + processingInterval?: HumanDuration | false; /** * If the processing engine should be started or not, defaults to true. * @remarks @@ -199,6 +206,5 @@ export interface Config { * This will enable or disable the processing of entities in the Catalog. This can be useful * to use with Read Replica deployments of the catalog. */ - processingEnabled?: boolean; }; } diff --git a/plugins/catalog-backend/src/service/CatalogBuilder.ts b/plugins/catalog-backend/src/service/CatalogBuilder.ts index c404bfaa0d..31ec40b887 100644 --- a/plugins/catalog-backend/src/service/CatalogBuilder.ts +++ b/plugins/catalog-backend/src/service/CatalogBuilder.ts @@ -843,9 +843,18 @@ export class CatalogBuilder { }); } + if (!Boolean(config.get('catalog.processingInterval'))) { + return () => { + throw new Error( + 'catalog.processingInterval is set to false, processing is disabled.', + ); + }; + } + const duration = readDurationFromConfig(config, { key: processingIntervalKey, }); + const seconds = Math.max( 1, Math.round(durationToMilliseconds(duration) / 1000), diff --git a/plugins/catalog-backend/src/service/CatalogPlugin.ts b/plugins/catalog-backend/src/service/CatalogPlugin.ts index b39898afb2..98c99e38dc 100644 --- a/plugins/catalog-backend/src/service/CatalogPlugin.ts +++ b/plugins/catalog-backend/src/service/CatalogPlugin.ts @@ -302,7 +302,7 @@ export const catalogPlugin = createBackendPlugin({ const { processingEngine, router } = await builder.build(); - if (config.getOptionalBoolean('catalog.processingEnabled') ?? true) { + if (config.get('catalog.processingInterval') ?? true) { lifecycle.addStartupHook(async () => { await processingEngine.start(); }); From 09aa2b14495774b78ad475fd87bcce9ac0f9121a Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 12:02:29 +0200 Subject: [PATCH 134/268] chore: fix extra config docs Signed-off-by: blam Signed-off-by: blam --- plugins/catalog-backend/config.d.ts | 14 -------------- .../catalog-backend/src/service/CatalogPlugin.ts | 1 - 2 files changed, 15 deletions(-) diff --git a/plugins/catalog-backend/config.d.ts b/plugins/catalog-backend/config.d.ts index 2f8ec3f230..1ab107ef10 100644 --- a/plugins/catalog-backend/config.d.ts +++ b/plugins/catalog-backend/config.d.ts @@ -192,19 +192,5 @@ export interface Config { * housing catalog-info files. */ processingInterval?: HumanDuration | false; - /** - * If the processing engine should be started or not, defaults to true. - * @remarks - * - * Example: - * - * ```yaml - * catalog: - * processingInterval: false - * ``` - * - * This will enable or disable the processing of entities in the Catalog. This can be useful - * to use with Read Replica deployments of the catalog. - */ }; } diff --git a/plugins/catalog-backend/src/service/CatalogPlugin.ts b/plugins/catalog-backend/src/service/CatalogPlugin.ts index 98c99e38dc..dfe415afa6 100644 --- a/plugins/catalog-backend/src/service/CatalogPlugin.ts +++ b/plugins/catalog-backend/src/service/CatalogPlugin.ts @@ -42,7 +42,6 @@ import { import { merge } from 'lodash'; import { Permission } from '@backstage/plugin-permission-common'; import { ForwardedError } from '@backstage/errors'; -import { constrainedMemory } from 'node:process'; class CatalogLocationsExtensionPointImpl implements CatalogLocationsExtensionPoint From b4520883c6ecb43eacfd7c2e9fd13b29d6a74e26 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Mon, 14 Oct 2024 13:38:08 +0100 Subject: [PATCH 135/268] Fix Dockerfile deprecated syntax. ``` 1 warning found (use docker --debug to expand): - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 48) ``` Signed-off-by: Brian Fletcher --- .changeset/shaggy-weeks-hunt.md | 5 +++++ docs/deployment/docker.md | 4 ++-- .../templates/default-app/packages/backend/Dockerfile | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/shaggy-weeks-hunt.md diff --git a/.changeset/shaggy-weeks-hunt.md b/.changeset/shaggy-weeks-hunt.md new file mode 100644 index 0000000000..2b007f6944 --- /dev/null +++ b/.changeset/shaggy-weeks-hunt.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Tweak `Dockerfile` to fix deprecated syntax. diff --git a/docs/deployment/docker.md b/docs/deployment/docker.md index 7a17f09ad6..afab8ef54d 100644 --- a/docs/deployment/docker.md +++ b/docs/deployment/docker.md @@ -90,7 +90,7 @@ COPY --chown=node:node .yarnrc.yml ./ ENV NODE_ENV=production # This disables node snapshot for Node 20 to work with the Scaffolder -ENV NODE_OPTIONS "--no-node-snapshot" +ENV NODE_OPTIONS="--no-node-snapshot" # Copy repo skeleton first, to avoid unnecessary docker cache invalidation. # The skeleton contains the package.json of each package in the monorepo, @@ -287,7 +287,7 @@ COPY --chown=node:node examples ./examples ENV NODE_ENV=production # This disables node snapshot for Node 20 to work with the Scaffolder -ENV NODE_OPTIONS "--no-node-snapshot" +ENV NODE_OPTIONS="--no-node-snapshot" CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"] ``` diff --git a/packages/create-app/templates/default-app/packages/backend/Dockerfile b/packages/create-app/templates/default-app/packages/backend/Dockerfile index 09024eb44f..6a4c257afb 100644 --- a/packages/create-app/templates/default-app/packages/backend/Dockerfile +++ b/packages/create-app/templates/default-app/packages/backend/Dockerfile @@ -45,7 +45,7 @@ COPY --chown=node:node .yarnrc.yml ./ ENV NODE_ENV=production # This disables node snapshot for Node 20 to work with the Scaffolder -ENV NODE_OPTIONS "--no-node-snapshot" +ENV NODE_OPTIONS="--no-node-snapshot" # Copy repo skeleton first, to avoid unnecessary docker cache invalidation. # The skeleton contains the package.json of each package in the monorepo, From 1ac09e47c66b0e0b4d57b3d26a36de2c525b7115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 14 Oct 2024 14:50:13 +0200 Subject: [PATCH 136/268] add two more faq entries for the catalog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- docs/features/software-catalog/faq.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/features/software-catalog/faq.md b/docs/features/software-catalog/faq.md index d44414c1a7..a8a1a30379 100644 --- a/docs/features/software-catalog/faq.md +++ b/docs/features/software-catalog/faq.md @@ -24,3 +24,21 @@ Doing on-demand user creation _is_ technically possible by writing custom [entit On the technical side, this is unwanted complexity. You need to implement and maintain a custom provider, instead of what usually amounts to a very easily set-up batch ingestion schedule with providers that come out of the box. Also even if you do this, the catalog is an eventually consistent engine. The user that the provider feeds into the system is not guaranteed to appear immediately. Your experience will likely be only partially functional at bootstrapping time which may have unwanted side effects. On the user experience side, a Backstage experience without complete organizational data is a serious hindrance to getting the full power out of the tool. Your users won't be able to click on owners and seeing who they are and what teams they belong to. They won't be able to find out what the communications paths are when they need to reach you or your managers when something goes wrong or they have a feature request. They can't get an overview of what teams own and how they relate to each other. It will be a much more barren experience. Organizational data is highly valuable to have centrally available, complete and correct. + +## Can I call the catalog itself from inside a processor / provider? + +Any backend module, including those that provide processors and entity providers to the catalog, are technically able to get hold of a catalog client via the `catalogServiceRef` from `@backstage/plugin-catalog-node`. However, it is almost never the right thing to do - especially from processors - and we strongly discourage from doing so. + +The catalog processing loop is a very high-speed system where your entire catalog cluster collaborates to race through all entities at the highest possible rate. The ideal processor does an absolute minimum of work, and immediately relinquishes control back. Performing asynchronous requests to external systems - including the catalog - from processors, can quickly become overwhelming for that external system and starve their resources if they aren't prepared to deal with very high rates of small requests. It also significantly slows down the procesing loop, when each step needs to wait for responses. This can lead to work "piling up" in the catalog and delays in seeing entities get updated. The [life of an entity](./life-of-an-entity.md) article shows the sequence of events that happen when an entity goes from original ingestion, through processing, and to becoming final entities. + +See also [the related validation topic](#can-i-validate-relations-in-processors). + +## Can I validate relations in processors? + +Processors are responsible for generating relations from the entity body - see the [life of an entity](./life-of-an-entity.md) article for more details. It's tempting to put rules in your processors that mark entities as invalid if they have a relation to some other entity that does not exist. For example, a `Component` entity that declares a `spec.owner` to a team that has been disbanded. We strongly discourage from doing this type of "hard" validation in processors, for two reasons. + +First, performance. As is described [here](#can-i-call-the-catalog-itself-from-inside-a-processor--provider), you should avoid calling out to the catalog for any reason in processors, including for checking whether a target entity exists. Besides the performance issues, it can also lead to data races where hidden dependencies between entities lead to them never properly settling, or flickering back and forth between states for hard-to-debug reasons. + +Second, user experience. The catalog is an eventually consistent system that constantly tries to mirror external realities. Users make changes in catalog-info files, or things update in external systems, and those changes get streamed in and settle over time inside the catalog. But throwing an error in a processor, instantly aborts processing of that entity and stops its ingestion. Now imagine being a large organization where these changes happen maybe hundreds of times per day. Owners of catalog-info files will constantly be surprised by their files "breaking" in ingestion, maybe a very long time after they were initially created - they were valid at their time of creation and haven't been touched since! This is very frustrating and slows down your users because things break silently for reasons out of your control. + +There are cases where it's fine to throw hard validation errors in processors. Notably, when it doesn't pass a schema test at all and readers of the catalog data will break if the data was let through. Setting the owner to be a number instead of a string could be such an example. From ded5c39017da14d225e3692b21faafbba7932c99 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:07:05 +0000 Subject: [PATCH 137/268] chore(deps): update github/codeql-action action to v3.26.13 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- .github/workflows/sync_snyk-monitor.yml | 2 +- .github/workflows/verify_codeql.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 23799a9a6b..ec00a3a6b8 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 with: sarif_file: results.sarif diff --git a/.github/workflows/sync_snyk-monitor.yml b/.github/workflows/sync_snyk-monitor.yml index f746a8c339..008010472b 100644 --- a/.github/workflows/sync_snyk-monitor.yml +++ b/.github/workflows/sync_snyk-monitor.yml @@ -58,6 +58,6 @@ jobs: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} NODE_OPTIONS: --max-old-space-size=7168 - name: Upload Snyk report - uses: github/codeql-action/upload-sarif@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 with: sarif_file: snyk.sarif diff --git a/.github/workflows/verify_codeql.yml b/.github/workflows/verify_codeql.yml index c77b65929b..22eb62d4c0 100644 --- a/.github/workflows/verify_codeql.yml +++ b/.github/workflows/verify_codeql.yml @@ -55,7 +55,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -66,7 +66,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/autobuild@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -80,4 +80,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13 From 4aad556a5ebd1b77474e436adc0f2c6a50040af8 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 15:20:25 +0200 Subject: [PATCH 138/268] chore: woops - this should be optional Signed-off-by: blam --- plugins/catalog-backend/src/service/CatalogPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-backend/src/service/CatalogPlugin.ts b/plugins/catalog-backend/src/service/CatalogPlugin.ts index dfe415afa6..4da0b612cd 100644 --- a/plugins/catalog-backend/src/service/CatalogPlugin.ts +++ b/plugins/catalog-backend/src/service/CatalogPlugin.ts @@ -301,7 +301,7 @@ export const catalogPlugin = createBackendPlugin({ const { processingEngine, router } = await builder.build(); - if (config.get('catalog.processingInterval') ?? true) { + if (config.getOptional('catalog.processingInterval') ?? true) { lifecycle.addStartupHook(async () => { await processingEngine.start(); }); From a19ce000c24fbeb06df48bbedf2262be6f102f25 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Oct 2024 14:50:05 +0200 Subject: [PATCH 139/268] backend-test-utils: allow createMockDirectory to be called in individual tests Signed-off-by: Patrik Oldsberg --- .changeset/popular-items-retire.md | 5 ++ .../src/filesystem/MockDirectory.ts | 48 ++++++++++++++----- 2 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 .changeset/popular-items-retire.md diff --git a/.changeset/popular-items-retire.md b/.changeset/popular-items-retire.md new file mode 100644 index 0000000000..2b737d9710 --- /dev/null +++ b/.changeset/popular-items-retire.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-test-utils': patch +--- + +The `createMockDirectory` cleanup strategy has been changed, no longer requiring it to be called outside individual tests. diff --git a/packages/backend-test-utils/src/filesystem/MockDirectory.ts b/packages/backend-test-utils/src/filesystem/MockDirectory.ts index 39518f5d9c..3ceeb7dc77 100644 --- a/packages/backend-test-utils/src/filesystem/MockDirectory.ts +++ b/packages/backend-test-utils/src/filesystem/MockDirectory.ts @@ -362,6 +362,34 @@ export interface CreateMockDirectoryOptions { content?: MockDirectoryContent; } +const cleanupCallbacks = new Array<() => void>(); + +let registered = false; +function registerTestHooks() { + if (typeof afterAll !== 'function') { + return; + } + if (registered) { + return; + } + registered = true; + + afterAll(async () => { + for (const callback of cleanupCallbacks) { + try { + callback(); + } catch (error) { + console.error( + `Failed to clean up mock directory after tests, ${error}`, + ); + } + } + cleanupCallbacks.length = 0; + }); +} + +registerTestHooks(); + /** * Creates a new temporary mock directory that will be removed after the tests have completed. * @@ -410,18 +438,14 @@ export function createMockDirectory( process.on('beforeExit', mocker.remove); } - try { - afterAll(() => { - if (origTmpdir) { - os.tmpdir = origTmpdir; - } - if (needsCleanup) { - mocker.remove(); - } - }); - } catch { - /* ignore */ - } + cleanupCallbacks.push(() => { + if (origTmpdir) { + os.tmpdir = origTmpdir; + } + if (needsCleanup) { + mocker.remove(); + } + }); if (options?.content) { mocker.setContent(options.content); From ac0dd751cd62f99bdd49ea181caf22b231417162 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Oct 2024 14:51:00 +0200 Subject: [PATCH 140/268] cli: update scaffolder-module template Signed-off-by: Patrik Oldsberg --- .../scaffolder-module/package.json.hbs | 4 ++- .../src/actions/example.test.ts | 24 ++++++++++++++ .../src/actions/{example => }/example.ts | 10 ++++-- .../src/actions/example/example.test.ts | 32 ------------------- .../src/actions/example/index.ts | 7 ---- .../scaffolder-module/src/actions/index.ts | 1 - .../scaffolder-module/src/index.ts.hbs | 2 +- .../src/{actions/example => }/module.ts | 6 ++-- 8 files changed, 38 insertions(+), 48 deletions(-) create mode 100644 packages/cli/templates/scaffolder-module/src/actions/example.test.ts rename packages/cli/templates/scaffolder-module/src/actions/{example => }/example.ts (77%) delete mode 100644 packages/cli/templates/scaffolder-module/src/actions/example/example.test.ts delete mode 100644 packages/cli/templates/scaffolder-module/src/actions/example/index.ts delete mode 100644 packages/cli/templates/scaffolder-module/src/actions/index.ts rename packages/cli/templates/scaffolder-module/src/{actions/example => }/module.ts (77%) diff --git a/packages/cli/templates/scaffolder-module/package.json.hbs b/packages/cli/templates/scaffolder-module/package.json.hbs index a6e6b5c5bc..25cd8616f2 100644 --- a/packages/cli/templates/scaffolder-module/package.json.hbs +++ b/packages/cli/templates/scaffolder-module/package.json.hbs @@ -29,10 +29,12 @@ "postpack": "backstage-cli package postpack" }, "dependencies": { + "@backstage/backend-plugin-api": "{{versionQuery '@backstage/backend-plugin-api'}}", "@backstage/plugin-scaffolder-node": "{{versionQuery '@backstage/plugin-scaffolder-node'}}" }, "devDependencies": { - "@backstage/cli": "{{versionQuery '@backstage/cli'}}" + "@backstage/cli": "{{versionQuery '@backstage/cli'}}", + "@backstage/plugin-scaffolder-node-test-utils": "{{versionQuery '@backstage/plugin-scaffolder-node-test-utils'}}" }, "files": [ "dist" diff --git a/packages/cli/templates/scaffolder-module/src/actions/example.test.ts b/packages/cli/templates/scaffolder-module/src/actions/example.test.ts new file mode 100644 index 0000000000..2e6020c240 --- /dev/null +++ b/packages/cli/templates/scaffolder-module/src/actions/example.test.ts @@ -0,0 +1,24 @@ +import { createExampleAction } from './example'; +import {createMockActionContext} from '@backstage/plugin-scaffolder-node-test-utils' + +describe('createExampleAction', () => { + it('should call action', async () => { + const action = createExampleAction(); + + await expect(action.handler(createMockActionContext({ + input: { + myParameter: 'test', + }, + }))).resolves.toBeUndefined() + }); + + it('should fail when passing foo', async () => { + const action = createExampleAction(); + + await expect(action.handler(createMockActionContext({ + input: { + myParameter: 'foo', + }, + }))).rejects.toThrow("myParameter cannot be 'foo'") + }); +}); diff --git a/packages/cli/templates/scaffolder-module/src/actions/example/example.ts b/packages/cli/templates/scaffolder-module/src/actions/example.ts similarity index 77% rename from packages/cli/templates/scaffolder-module/src/actions/example/example.ts rename to packages/cli/templates/scaffolder-module/src/actions/example.ts index 2b05c7fe38..7e47a89bcc 100644 --- a/packages/cli/templates/scaffolder-module/src/actions/example/example.ts +++ b/packages/cli/templates/scaffolder-module/src/actions/example.ts @@ -9,14 +9,14 @@ import { createTemplateAction } from '@backstage/plugin-scaffolder-node'; * * @public */ -export function createAcmeExampleAction() { +export function createExampleAction() { // For more information on how to define custom actions, see // https://backstage.io/docs/features/software-templates/writing-custom-actions return createTemplateAction<{ myParameter: string; }>({ id: 'acme:example', - description: 'Runs Yeoman on an installed Yeoman generator', + description: 'Runs an example action', schema: { input: { type: 'object', @@ -24,7 +24,7 @@ export function createAcmeExampleAction() { properties: { myParameter: { title: 'An example parameter', - description: 'This is the schema for our example parameter', + description: "This is an example parameter, don't set it to foo", type: 'string', }, }, @@ -35,6 +35,10 @@ export function createAcmeExampleAction() { `Running example template with parameters: ${ctx.input.myParameter}`, ); + if (ctx.input.myParameter === 'foo') { + throw new Error(`myParameter cannot be 'foo'`); + } + await new Promise(resolve => setTimeout(resolve, 1000)); }, }); diff --git a/packages/cli/templates/scaffolder-module/src/actions/example/example.test.ts b/packages/cli/templates/scaffolder-module/src/actions/example/example.test.ts deleted file mode 100644 index d0e5374f3f..0000000000 --- a/packages/cli/templates/scaffolder-module/src/actions/example/example.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { PassThrough } from 'stream'; -import { createAcmeExampleAction } from './example'; - -describe('acme:example', () => { - afterEach(() => { - jest.resetAllMocks(); - }); - - it('should call action', async () => { - const action = createAcmeExampleAction(); - - const logger = { info: jest.fn() }; - - await action.handler({ - input: { - myParameter: 'test', - }, - workspacePath: '/tmp', - logger: logger as any, - logStream: new PassThrough(), - output: jest.fn(), - createTemporaryDirectory() { - // Usage of createMockDirectory is recommended for testing of filesystem operations - throw new Error('Not implemented'); - }, - }); - - expect(logger.info).toHaveBeenCalledWith( - 'Running example template with parameters: test', - ); - }); -}); diff --git a/packages/cli/templates/scaffolder-module/src/actions/example/index.ts b/packages/cli/templates/scaffolder-module/src/actions/example/index.ts deleted file mode 100644 index 06ce5befc0..0000000000 --- a/packages/cli/templates/scaffolder-module/src/actions/example/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { scaffolderModule } from './module'; - -/* - @deprecated - this way of importing modules will soon be unsupported, and you should use `backend.add(import(...))` instead. -*/ -export { createAcmeExampleAction } from './example'; -export default scaffolderModule; diff --git a/packages/cli/templates/scaffolder-module/src/actions/index.ts b/packages/cli/templates/scaffolder-module/src/actions/index.ts deleted file mode 100644 index ab6642ebb0..0000000000 --- a/packages/cli/templates/scaffolder-module/src/actions/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './example'; diff --git a/packages/cli/templates/scaffolder-module/src/index.ts.hbs b/packages/cli/templates/scaffolder-module/src/index.ts.hbs index 3690e43b8e..58d5da4a57 100644 --- a/packages/cli/templates/scaffolder-module/src/index.ts.hbs +++ b/packages/cli/templates/scaffolder-module/src/index.ts.hbs @@ -5,4 +5,4 @@ * @packageDocumentation */ -export * from './actions'; +export { scaffolderModule as default } from './module'; diff --git a/packages/cli/templates/scaffolder-module/src/actions/example/module.ts b/packages/cli/templates/scaffolder-module/src/module.ts similarity index 77% rename from packages/cli/templates/scaffolder-module/src/actions/example/module.ts rename to packages/cli/templates/scaffolder-module/src/module.ts index 238268dcec..56ec38ac33 100644 --- a/packages/cli/templates/scaffolder-module/src/actions/example/module.ts +++ b/packages/cli/templates/scaffolder-module/src/module.ts @@ -1,12 +1,12 @@ import { createBackendModule } from "@backstage/backend-plugin-api"; import { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha'; -import { createAcmeExampleAction } from "./example"; +import { createExampleAction } from "./actions/example"; /** * A backend module that registers the action into the scaffolder */ export const scaffolderModule = createBackendModule({ - moduleId: 'acme:example', + moduleId: 'example-action', pluginId: 'scaffolder', register({ registerInit }) { registerInit({ @@ -14,7 +14,7 @@ export const scaffolderModule = createBackendModule({ scaffolderActions: scaffolderActionsExtensionPoint }, async init({ scaffolderActions}) { - scaffolderActions.addActions(createAcmeExampleAction()); + scaffolderActions.addActions(createExampleAction()); } }); }, From 888f968cd369ef399679f4b34682b82022aaa350 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Oct 2024 15:12:39 +0200 Subject: [PATCH 141/268] backend-test-utils: keep OS tmpdir cleanup in an `afterAll` callback Signed-off-by: Patrik Oldsberg --- .../src/filesystem/MockDirectory.ts | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/backend-test-utils/src/filesystem/MockDirectory.ts b/packages/backend-test-utils/src/filesystem/MockDirectory.ts index 3ceeb7dc77..a1d616d8e0 100644 --- a/packages/backend-test-utils/src/filesystem/MockDirectory.ts +++ b/packages/backend-test-utils/src/filesystem/MockDirectory.ts @@ -349,8 +349,11 @@ class MockDirectoryImpl { */ export interface CreateMockDirectoryOptions { /** - * In addition to creating a temporary directory, also mock `os.tmpdir()` to return the - * mock directory path until the end of the test suite. + * In addition to creating a temporary directory, also mock `os.tmpdir()` to + * return the mock directory path until the end of the test suite. + * + * When this option is provided the `createMockDirectory` call must happen in + * a scope where calling `afterAll` from Jest is allowed * * @returns */ @@ -438,14 +441,15 @@ export function createMockDirectory( process.on('beforeExit', mocker.remove); } - cleanupCallbacks.push(() => { - if (origTmpdir) { + if (needsCleanup) { + cleanupCallbacks.push(() => mocker.remove()); + } + + if (origTmpdir) { + afterAll(() => { os.tmpdir = origTmpdir; - } - if (needsCleanup) { - mocker.remove(); - } - }); + }); + } if (options?.content) { mocker.setContent(options.content); From 9625a971f17b8c46faba3579eefdb24b59fa8f17 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Oct 2024 15:15:38 +0200 Subject: [PATCH 142/268] changesets: changeset for scaffolder-module cli template update Signed-off-by: Patrik Oldsberg --- .changeset/cyan-suits-battle.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/cyan-suits-battle.md diff --git a/.changeset/cyan-suits-battle.md b/.changeset/cyan-suits-battle.md new file mode 100644 index 0000000000..ac8b9eb811 --- /dev/null +++ b/.changeset/cyan-suits-battle.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +The `scaffolder-module` template has been updated to use a more modern layout and new testing utilities for scaffolder actions. From fc8f25030ded36472c0f315808cbe2d79d53b886 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Oct 2024 15:31:31 +0200 Subject: [PATCH 143/268] cli: update scaffolder-module template test + fixes Signed-off-by: Patrik Oldsberg --- packages/cli/package.json | 1 + packages/cli/src/lib/new/factories/scaffolderModule.test.ts | 2 -- packages/cli/src/lib/version.ts | 2 ++ yarn.lock | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index ef75a3f3b4..15ac0e5eb3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -174,6 +174,7 @@ "@backstage/plugin-auth-backend-module-guest-provider": "workspace:^", "@backstage/plugin-catalog-node": "workspace:^", "@backstage/plugin-scaffolder-node": "workspace:^", + "@backstage/plugin-scaffolder-node-test-utils": "workspace:^", "@backstage/test-utils": "workspace:^", "@backstage/theme": "workspace:^", "@rspack/core": "^1.0.10", diff --git a/packages/cli/src/lib/new/factories/scaffolderModule.test.ts b/packages/cli/src/lib/new/factories/scaffolderModule.test.ts index bdcd8b6bdc..160177f5c0 100644 --- a/packages/cli/src/lib/new/factories/scaffolderModule.test.ts +++ b/packages/cli/src/lib/new/factories/scaffolderModule.test.ts @@ -93,10 +93,8 @@ describe('scaffolderModule factory', () => { 'templating README.md.hbs', 'templating package.json.hbs', 'templating index.ts.hbs', - 'copying index.ts', 'copying example.test.ts', 'copying example.ts', - 'copying index.ts', 'copying module.ts', 'Installing:', `moving plugins${sep}scaffolder-backend-module-test`, diff --git a/packages/cli/src/lib/version.ts b/packages/cli/src/lib/version.ts index fb4a7105c3..51826ef681 100644 --- a/packages/cli/src/lib/version.ts +++ b/packages/cli/src/lib/version.ts @@ -44,6 +44,7 @@ import { version as devUtils } from '../../../../packages/dev-utils/package.json import { version as errors } from '../../../../packages/errors/package.json'; import { version as testUtils } from '../../../../packages/test-utils/package.json'; import { version as scaffolderNode } from '../../../../plugins/scaffolder-node/package.json'; +import { version as scaffolderNodeTestUtils } from '../../../../plugins/scaffolder-node-test-utils/package.json'; import { version as authBackend } from '../../../../plugins/auth-backend/package.json'; import { version as authBackendModuleGuestProvider } from '../../../../plugins/auth-backend-module-guest-provider/package.json'; import { version as catalogNode } from '../../../../plugins/catalog-node/package.json'; @@ -65,6 +66,7 @@ export const packageVersions: Record = { '@backstage/test-utils': testUtils, '@backstage/theme': theme, '@backstage/plugin-scaffolder-node': scaffolderNode, + '@backstage/plugin-scaffolder-node-test-utils': scaffolderNodeTestUtils, '@backstage/plugin-auth-backend': authBackend, '@backstage/plugin-auth-backend-module-guest-provider': authBackendModuleGuestProvider, diff --git a/yarn.lock b/yarn.lock index b41d59faec..7a429aa92e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3930,6 +3930,7 @@ __metadata: "@backstage/plugin-auth-backend-module-guest-provider": "workspace:^" "@backstage/plugin-catalog-node": "workspace:^" "@backstage/plugin-scaffolder-node": "workspace:^" + "@backstage/plugin-scaffolder-node-test-utils": "workspace:^" "@backstage/release-manifests": "workspace:^" "@backstage/test-utils": "workspace:^" "@backstage/theme": "workspace:^" From 307c8ab6b6bfc69b167fbf32f4b9d4a9d388e1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 14 Oct 2024 15:49:18 +0200 Subject: [PATCH 144/268] Update packages/backend-dynamic-feature-service/src/features/features.test.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../src/features/features.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend-dynamic-feature-service/src/features/features.test.ts b/packages/backend-dynamic-feature-service/src/features/features.test.ts index 851e1d0578..791b806f54 100644 --- a/packages/backend-dynamic-feature-service/src/features/features.test.ts +++ b/packages/backend-dynamic-feature-service/src/features/features.test.ts @@ -238,7 +238,7 @@ describe('dynamicPluginsFeatureLoader', () => { dynamicPluginsFeatureLoader({ moduleLoader: jestFreeTypescriptAwareModuleLoader, }), - import('@backstage/plugin-app-backend/alpha'), + import('@backstage/plugin-app-backend'), ], }); From d3668d7f2f29ad8f811ea59d97ebab00028d1101 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:07:41 +0000 Subject: [PATCH 145/268] chore(deps): update dependency msw to v2.4.11 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2329011b15..64c3a32d7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35042,8 +35042,8 @@ __metadata: linkType: hard "msw@npm:^2.0.0, msw@npm:^2.0.8": - version: 2.4.9 - resolution: "msw@npm:2.4.9" + version: 2.4.11 + resolution: "msw@npm:2.4.11" dependencies: "@bundled-es-modules/cookie": ^2.0.0 "@bundled-es-modules/statuses": ^1.0.1 @@ -35057,10 +35057,10 @@ __metadata: graphql: ^16.8.1 headers-polyfill: ^4.0.2 is-node-process: ^1.2.0 - outvariant: ^1.4.2 + outvariant: ^1.4.3 path-to-regexp: ^6.3.0 strict-event-emitter: ^0.5.1 - type-fest: ^4.9.0 + type-fest: ^4.26.1 yargs: ^17.7.2 peerDependencies: typescript: ">= 4.8.x" @@ -35069,7 +35069,7 @@ __metadata: optional: true bin: msw: cli/index.js - checksum: add5a614ce58f5e75c65afcb59b76d0d807b9103b7fb3aaf23efd6ebd82d79415ecd9bc55dd48bcc4c31ec7ce196a75ace46d94224f0a80567c89a190e367ba8 + checksum: f58634f5b7e7c1b69fd7d4f0d6ca09169719b8829e01f6bf5c4517b9c3159738d4a0cbd1b8c8b080fced82bf692edf72a064b419feb863f2d7e82ec852cf694b languageName: node linkType: hard @@ -36365,7 +36365,7 @@ __metadata: languageName: node linkType: hard -"outvariant@npm:^1.2.1, outvariant@npm:^1.4.0, outvariant@npm:^1.4.2, outvariant@npm:^1.4.3": +"outvariant@npm:^1.2.1, outvariant@npm:^1.4.0, outvariant@npm:^1.4.3": version: 1.4.3 resolution: "outvariant@npm:1.4.3" checksum: 4a3551fb2b45309e585eebf88bad094dbe56ac6d3a28d59dd2e4050b431aa2beb6097a0763fce3cd82ca0f077026f380a9b60fffc306aaf430141421e7a7b6ed @@ -43417,10 +43417,10 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^4.9.0": - version: 4.9.0 - resolution: "type-fest@npm:4.9.0" - checksum: 73383de23237b399a70397a53101152548846d919aebcc7d8733000c6c354dc2632fe37c4a70b8571b79fdbfa099e2d8304c5ac56b3254780acff93e4c7a797f +"type-fest@npm:^4.26.1": + version: 4.26.1 + resolution: "type-fest@npm:4.26.1" + checksum: 7188db3bca82afa62c69a8043fb7c5eb74e63c45e7e28efb986da1629d844286f7181bc5a8185f38989fffff0d6c96be66fd13529b01932d1b6ebe725181d31a languageName: node linkType: hard From 18c504045703efaee7d1c679e6650952377d4bd6 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Oct 2024 16:11:52 +0200 Subject: [PATCH 146/268] cli: link to logger service docs in backend plugin template Signed-off-by: Patrik Oldsberg --- .../src/services/TodoListService/createTodoListService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/templates/default-backend-plugin/src/services/TodoListService/createTodoListService.ts b/packages/cli/templates/default-backend-plugin/src/services/TodoListService/createTodoListService.ts index 90f6ad8d9e..aab006c45d 100644 --- a/packages/cli/templates/default-backend-plugin/src/services/TodoListService/createTodoListService.ts +++ b/packages/cli/templates/default-backend-plugin/src/services/TodoListService/createTodoListService.ts @@ -77,7 +77,9 @@ export async function createTodoListService({ storedTodos.push(newTodo); // TEMPLATE NOTE: - // The second argument of the logger methods can be used to pass structured metadata + // The second argument of the logger methods can be used to pass + // structured metadata. You can read more about the logger service here: + // https://backstage.io/docs/backend-system/core-services/logger logger.info('Created new todo item', { id, title, createdBy }); return newTodo; From f63ea9a58362fb53c23a9b112997df6217c7d85b Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 16:26:09 +0200 Subject: [PATCH 147/268] bug: fixing issue with type inference for ParamKeys Signed-off-by: blam --- packages/core-plugin-api/report.api.md | 8 +++-- .../src/routing/ExternalRouteRef.test.ts | 2 +- .../src/routing/RouteRef.test.ts | 30 +++++++++++++++++-- .../src/routing/SubRouteRef.test.ts | 2 +- packages/core-plugin-api/src/routing/types.ts | 8 +++-- 5 files changed, 42 insertions(+), 8 deletions(-) diff --git a/packages/core-plugin-api/report.api.md b/packages/core-plugin-api/report.api.md index 06333c1fb4..ab31693b1e 100644 --- a/packages/core-plugin-api/report.api.md +++ b/packages/core-plugin-api/report.api.md @@ -613,9 +613,13 @@ export type OptionalParams< > = Params[keyof Params] extends never ? undefined : Params; // @public @deprecated -export type ParamKeys = keyof Params extends never +export type ParamKeys = [AnyRouteRefParams] extends [ + Params, +] + ? string[] + : keyof Params extends never ? [] - : (keyof Params)[]; + : Array; // @public @deprecated export type ParamNames = diff --git a/packages/core-plugin-api/src/routing/ExternalRouteRef.test.ts b/packages/core-plugin-api/src/routing/ExternalRouteRef.test.ts index f6e072f760..05e7a23d5d 100644 --- a/packages/core-plugin-api/src/routing/ExternalRouteRef.test.ts +++ b/packages/core-plugin-api/src/routing/ExternalRouteRef.test.ts @@ -87,7 +87,7 @@ describe('ExternalRouteRef', () => { const _3 = createExternalRouteRef({ id: '3', params: ['x', 'y'] }); // @ts-expect-error validateType<{ x: string }, any>(_3); - // extra z, we validate this at runtime instead + // @ts-expect-error validateType<{ x: string; y: string; z: string }, any>(_3); validateType<{ x: string; y: string }, false>(_3); diff --git a/packages/core-plugin-api/src/routing/RouteRef.test.ts b/packages/core-plugin-api/src/routing/RouteRef.test.ts index 5314957a25..58013261ab 100644 --- a/packages/core-plugin-api/src/routing/RouteRef.test.ts +++ b/packages/core-plugin-api/src/routing/RouteRef.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { AnyParams, RouteRef } from './types'; +import { AnyParams, RouteRef, ParamKeys } from './types'; import { createRouteRef } from './RouteRef'; describe('RouteRef', () => { @@ -54,7 +54,7 @@ describe('RouteRef', () => { validateType(_2); // @ts-expect-error validateType<{ x: string; z: string }>(_2); - // extra z, we validate this at runtime instead + // @ts-expect-error validateType<{ x: string; y: string; z: string }>(_2); validateType<{ x: string; y: string }>(_2); @@ -71,4 +71,30 @@ describe('RouteRef', () => { // To avoid complains about missing expectations and unused vars expect([_1, _2, _3, _4].join('')).toEqual(expect.any(String)); }); + + it('should properly infer param keys', () => { + function validateType(_test: T) {} + + validateType>(['x', 'y']); + + // @ts-expect-error + validateType>(['asd']); + validateType>([]); + + // @ts-expect-error + validateType>([1]); + validateType>(['migrationId']); + + // @ts-expect-error + validateType>([1]); + validateType>([ + 'migrationId', + ]); + + // @ts-expect-error + validateType>(['asd']); + validateType>([]); + + expect(true).toBeDefined(); + }); }); diff --git a/packages/core-plugin-api/src/routing/SubRouteRef.test.ts b/packages/core-plugin-api/src/routing/SubRouteRef.test.ts index cec00de025..1db429e178 100644 --- a/packages/core-plugin-api/src/routing/SubRouteRef.test.ts +++ b/packages/core-plugin-api/src/routing/SubRouteRef.test.ts @@ -102,7 +102,7 @@ describe('SubRouteRef', () => { validateType<{ x: string; z: string }>(_2); // @ts-expect-error validateType<{ y: string }>(_2); - // extra z, we validate this at runtime instead + // @ts-expect-error validateType<{ x: string; y: string; z: string }>(_2); validateType<{ x: string; y: string }>(_2); diff --git a/packages/core-plugin-api/src/routing/types.ts b/packages/core-plugin-api/src/routing/types.ts index 32f26f19c1..4598574afb 100644 --- a/packages/core-plugin-api/src/routing/types.ts +++ b/packages/core-plugin-api/src/routing/types.ts @@ -35,9 +35,13 @@ export type AnyParams = AnyRouteRefParams; * @public * @deprecated this type is deprecated and will be removed in the future */ -export type ParamKeys = keyof Params extends never +export type ParamKeys = [AnyRouteRefParams] extends [ + Params, +] + ? string[] + : keyof Params extends never ? [] - : (keyof Params)[]; + : Array; /** * Optional route params. From 39001f409125fc33814c89ba994f83fd544a7fec Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 16:27:53 +0200 Subject: [PATCH 148/268] chore: changeset Signed-off-by: blam --- .changeset/thin-doors-rule.md | 5 +++++ packages/core-plugin-api/src/routing/RouteRef.test.ts | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .changeset/thin-doors-rule.md diff --git a/.changeset/thin-doors-rule.md b/.changeset/thin-doors-rule.md new file mode 100644 index 0000000000..20823bb79f --- /dev/null +++ b/.changeset/thin-doors-rule.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-plugin-api': patch +--- + +Fixing issue with types for `ParamKeys` leading to type mismatches across versions diff --git a/packages/core-plugin-api/src/routing/RouteRef.test.ts b/packages/core-plugin-api/src/routing/RouteRef.test.ts index 58013261ab..489900d892 100644 --- a/packages/core-plugin-api/src/routing/RouteRef.test.ts +++ b/packages/core-plugin-api/src/routing/RouteRef.test.ts @@ -78,21 +78,19 @@ describe('RouteRef', () => { validateType>(['x', 'y']); // @ts-expect-error - validateType>(['asd']); + validateType>(['foo']); validateType>([]); // @ts-expect-error validateType>([1]); - validateType>(['migrationId']); + validateType>(['foo']); // @ts-expect-error validateType>([1]); - validateType>([ - 'migrationId', - ]); + validateType>(['foo']); // @ts-expect-error - validateType>(['asd']); + validateType>(['foo']); validateType>([]); expect(true).toBeDefined(); From 88a007056602262d42a2803d2971c4866b7420c8 Mon Sep 17 00:00:00 2001 From: BanerjeeAgniva <90470431+BanerjeeAgniva@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:11:38 +0530 Subject: [PATCH 149/268] docs(analytics): add Generic HTTP as a community-supported analytics tool Signed-off-by: Agniva Banerjee Signed-off-by: BanerjeeAgniva <90470431+BanerjeeAgniva@users.noreply.github.com> --- docs/plugins/analytics.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/plugins/analytics.md b/docs/plugins/analytics.md index 10a7421057..a936a0f399 100644 --- a/docs/plugins/analytics.md +++ b/docs/plugins/analytics.md @@ -41,6 +41,7 @@ choice below. | [New Relic Browser][newrelic-browser] | Community ✅ | | [Matomo][matomo] | Community ✅ | | [Quantum Metric][qm] | Community ✅ | +| [Generic HTTP][generic-http] | Community ✅ | To suggest an integration, please [open an issue][add-tool] for the analytics tool your organization uses. Or jump to [Writing Integrations][int-howto] to From 31f54a673f9d9b26a7ff8f77acb64ba07ef6a676 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 16:47:46 +0200 Subject: [PATCH 150/268] fix: fixing the checking of the reports with new format Signed-off-by: blam --- .../repo-tools/src/commands/api-reports/api-extractor.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/repo-tools/src/commands/api-reports/api-extractor.ts b/packages/repo-tools/src/commands/api-reports/api-extractor.ts index 90c5c40fdd..c1075f92c1 100644 --- a/packages/repo-tools/src/commands/api-reports/api-extractor.ts +++ b/packages/repo-tools/src/commands/api-reports/api-extractor.ts @@ -240,6 +240,8 @@ export async function createTemporaryTsConfig(includedPackageDirs: string[]) { } export async function countApiReportWarnings(reportPath: string) { + console.log(reportPath); + try { const content = await fs.readFile(reportPath, 'utf8'); const lines = content.split('\n'); @@ -406,7 +408,7 @@ export async function runApiExtraction({ const suffix = packageEntryPoint.name === 'index' ? '' : `-${packageEntryPoint.name}`; const reportFileName = `report${suffix}`; - const reportPath = resolvePath(projectFolder, reportFileName); + const reportPath = resolvePath(projectFolder, `${reportFileName}.api.md`); const warningCountBefore = await countApiReportWarnings(reportPath); @@ -602,6 +604,9 @@ export async function runApiExtraction({ } const warningCountAfter = await countApiReportWarnings(reportPath); + + console.log({ warningCountAfter, warningCountBefore, warnings }); + if (noBail) { console.log(`Skipping warnings check for ${packageDir}`); } From 35e735bb55e23cc925491543c1b1656c8e8deaec Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 16:49:27 +0200 Subject: [PATCH 151/268] chore: add changeset Signed-off-by: blam --- .changeset/pink-sheep-dress.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pink-sheep-dress.md diff --git a/.changeset/pink-sheep-dress.md b/.changeset/pink-sheep-dress.md new file mode 100644 index 0000000000..949604cde2 --- /dev/null +++ b/.changeset/pink-sheep-dress.md @@ -0,0 +1,5 @@ +--- +'@backstage/repo-tools': patch +--- + +Fix issues with warnings not being reported due to bad filename path when reading report From 49a3ae195d5f432114a73f8533cb6e7f0689a5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 14 Oct 2024 16:57:30 +0200 Subject: [PATCH 152/268] set a higher timeout for a feature service test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../src/features/features.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/backend-dynamic-feature-service/src/features/features.test.ts b/packages/backend-dynamic-feature-service/src/features/features.test.ts index 791b806f54..ad46b0c5f8 100644 --- a/packages/backend-dynamic-feature-service/src/features/features.test.ts +++ b/packages/backend-dynamic-feature-service/src/features/features.test.ts @@ -32,6 +32,9 @@ import * as winston from 'winston'; import { MESSAGE } from 'triple-beam'; import { overridePackagePathResolution } from '@backstage/backend-plugin-api/testUtils'; +// these can get a bit slow in CI +jest.setTimeout(60_000); + async function jestFreeTypescriptAwareModuleLoader( logger: LoggerService, dontBootstrap: boolean = false, From 77bd69fd89a3f2e5a8852db0bcd5466d01e8250c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:18:40 +0000 Subject: [PATCH 153/268] chore(deps): update dependency vite to v5.4.9 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 62200b5aec..109915af0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44538,8 +44538,8 @@ __metadata: linkType: hard "vite@npm:^5.0.0": - version: 5.4.8 - resolution: "vite@npm:5.4.8" + version: 5.4.9 + resolution: "vite@npm:5.4.9" dependencies: esbuild: ^0.21.3 fsevents: ~2.3.3 @@ -44576,7 +44576,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: b5686ff76a60d53092dc13a5c1e5627165226b8e3da7736931adf87bbe58d383bca386383cea134750108c2d42750c916db3f2314ac90a9477d693950145f140 + checksum: d3229e0618ece284af0478ec09c474a7a70ac369920716afdb6ebed8e320fd17a17c60afddba0d436698fe4837474cccd057c3e7d8270281b57506b78c5fbb8c languageName: node linkType: hard From fc01ce7e779a26d59f076096ffbfcfd362befd07 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 14 Oct 2024 17:56:00 +0200 Subject: [PATCH 154/268] chore: fix api-reports warnings Signed-off-by: blam --- package.json | 2 +- .../app-next-example-plugin/report.api.md | 5 - packages/backend-app-api/report-alpha.api.md | 4 - packages/backend-app-api/report.api.md | 10 - .../backend-defaults/report-discovery.api.md | 5 - .../backend-defaults/report-rootConfig.api.md | 6 - .../backend-defaults/report-rootHealth.api.md | 4 - .../report-rootHttpRouter.api.md | 23 --- .../backend-defaults/report-rootLogger.api.md | 14 -- .../backend-defaults/report-scheduler.api.md | 4 - .../backend-defaults/report-urlReader.api.md | 73 ------- packages/backend-defaults/report.api.md | 4 - .../urlReader/lib/GitlabUrlReader.ts | 3 +- .../report.api.md | 71 ------- packages/backend-openapi-utils/report.api.md | 80 -------- .../backend-plugin-api/report-alpha.api.md | 5 - .../report-testUtils.api.md | 5 - packages/backend-plugin-api/report.api.md | 44 ----- packages/backend-test-utils/report.api.md | 80 -------- .../catalog-client/report-testUtils.api.md | 17 -- packages/catalog-client/report.api.md | 9 - packages/catalog-model/report.api.md | 48 ----- packages/cli-node/report.api.md | 24 --- packages/config-loader/report.api.md | 28 --- packages/core-app-api/report.api.md | 66 ------- packages/core-compat-api/report.api.md | 7 - packages/core-components/report-alpha.api.md | 4 - packages/core-components/report.api.md | 179 ------------------ packages/core-plugin-api/report-alpha.api.md | 31 --- packages/core-plugin-api/report.api.md | 4 - packages/dev-utils/report.api.md | 6 - packages/errors/report.api.md | 12 -- packages/frontend-app-api/report.api.md | 4 - packages/frontend-defaults/report.api.md | 6 - packages/frontend-plugin-api/report.api.md | 102 ---------- packages/frontend-test-utils/report.api.md | 16 -- packages/integration-aws-node/report.api.md | 4 - packages/integration/report.api.md | 123 ------------ .../src/commands/api-reports/api-extractor.ts | 5 +- packages/test-utils/report-alpha.api.md | 7 - packages/test-utils/report.api.md | 29 --- packages/theme/report.api.md | 26 --- packages/yarn-plugin/report.api.md | 4 - .../report.api.md | 4 - plugins/api-docs/report-alpha.api.md | 4 - plugins/api-docs/report.api.md | 34 ---- plugins/app-backend/report-alpha.api.md | 4 - plugins/app-backend/report.api.md | 9 - plugins/app-visualizer/report.api.md | 4 - plugins/app/report.api.md | 4 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 6 - .../report.api.md | 8 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 6 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 4 - .../report.api.md | 6 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 8 - .../report.api.md | 8 - plugins/auth-backend/report.api.md | 64 ------- plugins/auth-node/report.api.md | 124 ------------ plugins/bitbucket-cloud-common/report.api.md | 150 --------------- .../report-alpha.api.md | 4 - .../catalog-backend-module-aws/report.api.md | 13 -- .../report-alpha.api.md | 4 - .../report.api.md | 8 - .../report.api.md | 6 - .../report-alpha.api.md | 4 - .../report.api.md | 7 - .../report-alpha.api.md | 4 - .../report.api.md | 16 -- .../catalog-backend-module-gcp/report.api.md | 8 - .../report-alpha.api.md | 4 - .../report.api.md | 9 - .../report-alpha.api.md | 4 - .../report.api.md | 37 ---- .../src/providers/GithubEntityProvider.ts | 6 - .../report-alpha.api.md | 4 - .../report.api.md | 25 --- .../GitlabDiscoveryEntityProvider.ts | 4 +- .../report-alpha.api.md | 18 -- .../report.api.md | 8 - .../src/alpha.ts | 9 - .../src/run.ts | 7 +- .../catalog-backend-module-ldap/report.api.md | 9 - .../report-alpha.api.md | 20 -- .../report.api.md | 10 - .../src/alpha.ts | 11 -- .../src/microsoftGraph/client.ts | 2 +- .../report.api.md | 9 - .../report.api.md | 8 - .../src/providers/PuppetDbEntityProvider.ts | 11 +- .../report.api.md | 6 - .../report.api.md | 5 - plugins/catalog-backend/report-alpha.api.md | 4 - plugins/catalog-backend/report.api.md | 81 -------- plugins/catalog-common/report.api.md | 12 -- plugins/catalog-graph/report-alpha.api.md | 4 - plugins/catalog-graph/report.api.md | 7 - plugins/catalog-import/report-alpha.api.md | 4 - plugins/catalog-import/report.api.md | 42 ---- plugins/catalog-node/report-alpha.api.md | 20 -- plugins/catalog-node/report.api.md | 18 -- plugins/catalog-react/report-alpha.api.md | 6 - plugins/catalog-react/report.api.md | 114 ----------- .../report.api.md | 4 - plugins/catalog/report-alpha.api.md | 5 - plugins/catalog/report.api.md | 127 ------------- plugins/config-schema/report.api.md | 11 -- plugins/devtools-backend/report.api.md | 15 -- plugins/devtools-common/report.api.md | 16 -- plugins/devtools/report-alpha.api.md | 4 - plugins/devtools/report.api.md | 10 - .../report-alpha.api.md | 4 - .../report.api.md | 5 - .../report-alpha.api.md | 5 - .../events-backend-module-azure/report.api.md | 5 - .../report-alpha.api.md | 5 - .../report.api.md | 5 - .../report-alpha.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 5 - .../report.api.md | 5 - .../events-backend-test-utils/report.api.md | 23 --- plugins/events-backend/report-alpha.api.md | 4 - plugins/events-backend/report.api.md | 10 - plugins/events-node/report-alpha.api.md | 9 - plugins/events-node/report.api.md | 22 --- plugins/home-react/report.api.md | 11 -- plugins/home/report-alpha.api.md | 5 - plugins/home/report.api.md | 30 --- .../kubernetes-backend/report-alpha.api.md | 4 - plugins/kubernetes-backend/report.api.md | 114 ----------- plugins/kubernetes-cluster/report.api.md | 5 - plugins/kubernetes-common/report.api.md | 136 ------------- plugins/kubernetes-node/report.api.md | 56 ------ plugins/kubernetes-react/report.api.md | 169 ----------------- plugins/kubernetes/report-alpha.api.md | 4 - plugins/kubernetes/report.api.md | 7 - .../report.api.md | 11 -- plugins/notifications-common/report.api.md | 12 -- plugins/notifications-node/report.api.md | 16 -- plugins/notifications/report.api.md | 24 --- plugins/org-react/report.api.md | 4 - plugins/org/report-alpha.api.md | 4 - plugins/org/report.api.md | 15 -- .../permission-backend/report-alpha.api.md | 4 - plugins/permission-backend/report.api.md | 11 -- plugins/permission-common/report.api.md | 4 - plugins/permission-node/report.api.md | 7 - plugins/permission-react/report.api.md | 6 - plugins/proxy-backend/report-alpha.api.md | 4 - plugins/proxy-backend/report.api.md | 9 - .../report.api.md | 7 - .../report.api.md | 4 - .../report.api.md | 9 - .../report.api.md | 4 - .../scaffolder-backend/report-alpha.api.md | 5 - plugins/scaffolder-backend/report.api.md | 113 ----------- plugins/scaffolder-common/report.api.md | 11 -- plugins/scaffolder-node/report-alpha.api.md | 12 -- plugins/scaffolder-node/report.api.md | 47 ----- plugins/scaffolder-react/report-alpha.api.md | 53 +----- plugins/scaffolder-react/report.api.md | 45 ----- .../src/next/components/Stepper/index.ts | 6 +- plugins/scaffolder/report-alpha.api.md | 10 - plugins/scaffolder/report.api.md | 52 ----- .../report-alpha.api.md | 16 -- .../report.api.md | 10 - .../src/alpha.ts | 11 +- .../report-alpha.api.md | 17 -- .../report.api.md | 97 ---------- .../src/alpha.ts | 11 +- .../report-alpha.api.md | 4 - .../report.api.md | 8 - .../report-alpha.api.md | 4 - .../search-backend-module-pg/report.api.md | 47 ----- .../report.api.md | 10 - .../report-alpha.api.md | 18 -- .../report.api.md | 18 -- .../src/alpha.ts | 11 +- .../search-backend-node/report-alpha.api.md | 6 - plugins/search-backend-node/report.api.md | 20 -- plugins/search-backend/report-alpha.api.md | 4 - plugins/search-backend/report.api.md | 5 - plugins/search-common/report.api.md | 20 -- plugins/search-react/report-alpha.api.md | 7 - plugins/search-react/report.api.md | 21 -- plugins/search/report-alpha.api.md | 7 - plugins/search/report.api.md | 15 -- plugins/signals-backend/report.api.md | 13 -- plugins/signals-node/report.api.md | 12 -- plugins/signals-react/report.api.md | 9 - plugins/signals/report.api.md | 10 - plugins/techdocs-backend/report-alpha.api.md | 4 - plugins/techdocs-backend/report.api.md | 13 -- plugins/techdocs-common/report.api.md | 5 - plugins/techdocs-node/report.api.md | 14 -- plugins/techdocs-react/report.api.md | 13 -- plugins/techdocs/report-alpha.api.md | 5 - plugins/techdocs/report.api.md | 32 ---- .../user-settings-backend/report-alpha.api.md | 4 - plugins/user-settings-common/report.api.md | 4 - plugins/user-settings/report-alpha.api.md | 6 - plugins/user-settings/report.api.md | 32 ---- 216 files changed, 28 insertions(+), 4221 deletions(-) diff --git a/package.json b/package.json index edd114834c..c750f223b2 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build:all": "backstage-cli repo build --all", "build:api-docs": "LANG=en_EN yarn build:api-reports --docs --exclude 'plugins/@(adr|adr-backend|adr-common|airbrake|airbrake-backend|allure|analytics-module-ga|analytics-module-ga4|analytics-module-newrelic-browser|apache-airflow|api-docs|api-docs-module-protoc-gen-doc|apollo-explorer|app-visualizer|azure-devops|azure-devops-backend|azure-devops-common|azure-sites|azure-sites-backend|azure-sites-common|badges|badges-backend|bazaar|bazaar-backend|bitbucket-cloud-common|bitrise|catalog-graph|catalog-graphql|catalog-import|catalog-unprocessed-entities|cicd-statistics|cicd-statistics-module-gitlab|circleci|cloudbuild|code-climate|code-coverage|code-coverage-backend|codescene|config-schema|cost-insights|cost-insights-common|dynatrace|entity-feedback|entity-feedback-backend|entity-feedback-common|entity-validation|example-todo-list|example-todo-list-backend|example-todo-list-common|firehydrant|fossa|gcalendar|gcp-projects|git-release-manager|github-actions|github-deployments|github-issues|github-pull-requests-board|gitops-profiles|gocd|graphiql|graphql-backend|graphql-voyager|ilert|jenkins|jenkins-backend|jenkins-common|kafka|kafka-backend|lighthouse|lighthouse-backend|lighthouse-common|linguist|linguist-backend|linguist-common|microsoft-calendar|newrelic|newrelic-dashboard|nomad|nomad-backend|octopus-deploy|opencost|pagerduty|periskop|periskop-backend|playlist|playlist-backend|playlist-common|proxy-backend|puppetdb|rollbar|rollbar-backend|sentry|shortcuts|splunk-on-call|stack-overflow|stack-overflow-backend|stackstorm|tech-radar|tech-radar-2|todo|todo-backend|xcmetrics)'", "build:api-reports": "yarn build:api-reports:only --tsc", - "build:api-reports:only": "NODE_OPTIONS=--max-old-space-size=8192 backstage-repo-tools api-reports --allow-warnings 'packages/backend-app-api,packages/core-components,plugins/+(catalog|catalog-import|git-release-manager|jenkins|kubernetes)' -o ae-wrong-input-file-type --validate-release-tags", + "build:api-reports:only": "NODE_OPTIONS=--max-old-space-size=8192 backstage-repo-tools api-reports --allow-warnings 'packages/backend-app-api,packages/core-components,plugins/+(catalog|catalog-import|git-release-manager|jenkins|kubernetes)' -o ae-undocumented,ae-wrong-input-file-type --validate-release-tags", "build:backend": "yarn workspace example-backend build", "build:knip-reports": "backstage-repo-tools knip-reports", "build:plugins-report": "node ./scripts/build-plugins-report", diff --git a/packages/app-next-example-plugin/report.api.md b/packages/app-next-example-plugin/report.api.md index 3094fee56e..1fc58dfc17 100644 --- a/packages/app-next-example-plugin/report.api.md +++ b/packages/app-next-example-plugin/report.api.md @@ -52,10 +52,5 @@ export default examplePlugin; // @public (undocumented) export const ExampleSidebarItem: () => React_2.JSX.Element; -// Warnings were encountered during analysis: -// -// src/ExampleSidebarItem.d.ts:3:22 - (ae-undocumented) Missing documentation for "ExampleSidebarItem". -// src/plugin.d.ts:22:22 - (ae-undocumented) Missing documentation for "examplePlugin". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-app-api/report-alpha.api.md b/packages/backend-app-api/report-alpha.api.md index e3f11bb800..163cc325a1 100644 --- a/packages/backend-app-api/report-alpha.api.md +++ b/packages/backend-app-api/report-alpha.api.md @@ -13,9 +13,5 @@ export const featureDiscoveryServiceFactory: ServiceFactory< 'singleton' >; -// Warnings were encountered during analysis: -// -// src/alpha/featureDiscoveryServiceFactory.d.ts:5:22 - (ae-undocumented) Missing documentation for "featureDiscoveryServiceFactory". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-app-api/report.api.md b/packages/backend-app-api/report.api.md index ec32ec9b67..88fa34e6e4 100644 --- a/packages/backend-app-api/report.api.md +++ b/packages/backend-app-api/report.api.md @@ -32,14 +32,4 @@ export interface CreateSpecializedBackendOptions { // (undocumented) defaultServiceFactories: ServiceFactory[]; } - -// Warnings were encountered during analysis: -// -// src/wiring/createSpecializedBackend.d.ts:5:1 - (ae-undocumented) Missing documentation for "createSpecializedBackend". -// src/wiring/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "Backend". -// src/wiring/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "add". -// src/wiring/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "start". -// src/wiring/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "stop". -// src/wiring/types.d.ts:15:1 - (ae-undocumented) Missing documentation for "CreateSpecializedBackendOptions". -// src/wiring/types.d.ts:16:5 - (ae-undocumented) Missing documentation for "defaultServiceFactories". ``` diff --git a/packages/backend-defaults/report-discovery.api.md b/packages/backend-defaults/report-discovery.api.md index e39d281b4e..d168d33a71 100644 --- a/packages/backend-defaults/report-discovery.api.md +++ b/packages/backend-defaults/report-discovery.api.md @@ -23,10 +23,5 @@ export class HostDiscovery implements DiscoveryService { getExternalBaseUrl(pluginId: string): Promise; } -// Warnings were encountered during analysis: -// -// src/entrypoints/discovery/HostDiscovery.d.ts:44:5 - (ae-undocumented) Missing documentation for "getBaseUrl". -// src/entrypoints/discovery/HostDiscovery.d.ts:45:5 - (ae-undocumented) Missing documentation for "getExternalBaseUrl". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-defaults/report-rootConfig.api.md b/packages/backend-defaults/report-rootConfig.api.md index 6c65d00a3b..2935ad1128 100644 --- a/packages/backend-defaults/report-rootConfig.api.md +++ b/packages/backend-defaults/report-rootConfig.api.md @@ -31,11 +31,5 @@ export const rootConfigServiceFactory: (( ) => ServiceFactory) & ServiceFactory; -// Warnings were encountered during analysis: -// -// src/entrypoints/rootConfig/createConfigSecretEnumerator.d.ts:5:1 - (ae-undocumented) Missing documentation for "createConfigSecretEnumerator". -// src/entrypoints/rootConfig/rootConfigServiceFactory.d.ts:20:5 - (ae-undocumented) Missing documentation for "watch". -// src/entrypoints/rootConfig/rootConfigServiceFactory.d.ts:26:22 - (ae-undocumented) Missing documentation for "rootConfigServiceFactory". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-defaults/report-rootHealth.api.md b/packages/backend-defaults/report-rootHealth.api.md index fa09590c26..b26de7cfda 100644 --- a/packages/backend-defaults/report-rootHealth.api.md +++ b/packages/backend-defaults/report-rootHealth.api.md @@ -13,9 +13,5 @@ export const rootHealthServiceFactory: ServiceFactory< 'singleton' >; -// Warnings were encountered during analysis: -// -// src/entrypoints/rootHealth/rootHealthServiceFactory.d.ts:5:22 - (ae-undocumented) Missing documentation for "rootHealthServiceFactory". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-defaults/report-rootHttpRouter.api.md b/packages/backend-defaults/report-rootHttpRouter.api.md index 9a435f5c27..3686f25a12 100644 --- a/packages/backend-defaults/report-rootHttpRouter.api.md +++ b/packages/backend-defaults/report-rootHttpRouter.api.md @@ -154,28 +154,5 @@ export const rootHttpRouterServiceFactory: (( ) => ServiceFactory) & ServiceFactory; -// Warnings were encountered during analysis: -// -// src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.d.ts:23:5 - (ae-undocumented) Missing documentation for "create". -// src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.d.ts:25:5 - (ae-undocumented) Missing documentation for "use". -// src/entrypoints/rootHttpRouter/DefaultRootHttpRouter.d.ts:26:5 - (ae-undocumented) Missing documentation for "handler". -// src/entrypoints/rootHttpRouter/createHealthRouter.d.ts:6:1 - (ae-undocumented) Missing documentation for "createHealthRouter". -// src/entrypoints/rootHttpRouter/http/MiddlewareFactory.d.ts:9:5 - (ae-undocumented) Missing documentation for "config". -// src/entrypoints/rootHttpRouter/http/MiddlewareFactory.d.ts:10:5 - (ae-undocumented) Missing documentation for "logger". -// src/entrypoints/rootHttpRouter/http/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "start". -// src/entrypoints/rootHttpRouter/http/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "stop". -// src/entrypoints/rootHttpRouter/http/types.d.ts:11:5 - (ae-undocumented) Missing documentation for "port". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:9:1 - (ae-undocumented) Missing documentation for "RootHttpRouterConfigureContext". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:10:5 - (ae-undocumented) Missing documentation for "app". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:11:5 - (ae-undocumented) Missing documentation for "server". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:12:5 - (ae-undocumented) Missing documentation for "middleware". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:13:5 - (ae-undocumented) Missing documentation for "routes". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:14:5 - (ae-undocumented) Missing documentation for "config". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:15:5 - (ae-undocumented) Missing documentation for "logger". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:16:5 - (ae-undocumented) Missing documentation for "lifecycle". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:17:5 - (ae-undocumented) Missing documentation for "healthRouter". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:18:5 - (ae-undocumented) Missing documentation for "applyDefaults". -// src/entrypoints/rootHttpRouter/rootHttpRouterServiceFactory.d.ts:38:22 - (ae-undocumented) Missing documentation for "rootHttpRouterServiceFactory". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-defaults/report-rootLogger.api.md b/packages/backend-defaults/report-rootLogger.api.md index 59b6242095..b353039c03 100644 --- a/packages/backend-defaults/report-rootLogger.api.md +++ b/packages/backend-defaults/report-rootLogger.api.md @@ -51,19 +51,5 @@ export interface WinstonLoggerOptions { transports?: transport[]; } -// Warnings were encountered during analysis: -// -// src/entrypoints/rootLogger/WinstonLogger.d.ts:8:1 - (ae-undocumented) Missing documentation for "WinstonLoggerOptions". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:9:5 - (ae-undocumented) Missing documentation for "meta". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:10:5 - (ae-undocumented) Missing documentation for "level". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:11:5 - (ae-undocumented) Missing documentation for "format". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:12:5 - (ae-undocumented) Missing documentation for "transports". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:37:5 - (ae-undocumented) Missing documentation for "error". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:38:5 - (ae-undocumented) Missing documentation for "warn". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:39:5 - (ae-undocumented) Missing documentation for "info". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:40:5 - (ae-undocumented) Missing documentation for "debug". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:41:5 - (ae-undocumented) Missing documentation for "child". -// src/entrypoints/rootLogger/WinstonLogger.d.ts:42:5 - (ae-undocumented) Missing documentation for "addRedactions". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-defaults/report-scheduler.api.md b/packages/backend-defaults/report-scheduler.api.md index 7d886e539c..9879ad7c97 100644 --- a/packages/backend-defaults/report-scheduler.api.md +++ b/packages/backend-defaults/report-scheduler.api.md @@ -26,9 +26,5 @@ export const schedulerServiceFactory: ServiceFactory< 'singleton' >; -// Warnings were encountered during analysis: -// -// src/entrypoints/scheduler/lib/DefaultSchedulerService.d.ts:8:5 - (ae-undocumented) Missing documentation for "create". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-defaults/report-urlReader.api.md b/packages/backend-defaults/report-urlReader.api.md index 77f0d5ccbd..f8b8db2954 100644 --- a/packages/backend-defaults/report-urlReader.api.md +++ b/packages/backend-defaults/report-urlReader.api.md @@ -447,78 +447,5 @@ export type UrlReadersOptions = { factories?: ReaderFactory[]; }; -// Warnings were encountered during analysis: -// -// src/entrypoints/urlReader/lib/AwsS3UrlReader.d.ts:28:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/AwsS3UrlReader.d.ts:40:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/AwsS3UrlReader.d.ts:41:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/AwsS3UrlReader.d.ts:42:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/AwsS3UrlReader.d.ts:43:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/AwsS3UrlReader.d.ts:44:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/AzureUrlReader.d.ts:14:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/AzureUrlReader.d.ts:19:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/AzureUrlReader.d.ts:20:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/AzureUrlReader.d.ts:21:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/AzureUrlReader.d.ts:22:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/AzureUrlReader.d.ts:23:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.d.ts:14:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.d.ts:18:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.d.ts:19:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.d.ts:20:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.d.ts:21:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.d.ts:22:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/BitbucketServerUrlReader.d.ts:14:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/BitbucketServerUrlReader.d.ts:18:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/BitbucketServerUrlReader.d.ts:19:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/BitbucketServerUrlReader.d.ts:20:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/BitbucketServerUrlReader.d.ts:21:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/BitbucketServerUrlReader.d.ts:22:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/BitbucketUrlReader.d.ts:17:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/BitbucketUrlReader.d.ts:21:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/BitbucketUrlReader.d.ts:22:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/BitbucketUrlReader.d.ts:23:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/BitbucketUrlReader.d.ts:24:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/BitbucketUrlReader.d.ts:25:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/FetchUrlReader.d.ts:24:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/FetchUrlReader.d.ts:25:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/FetchUrlReader.d.ts:26:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/FetchUrlReader.d.ts:27:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/FetchUrlReader.d.ts:28:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/GerritUrlReader.d.ts:29:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/GerritUrlReader.d.ts:33:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/GerritUrlReader.d.ts:34:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/GerritUrlReader.d.ts:35:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/GerritUrlReader.d.ts:36:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/GerritUrlReader.d.ts:37:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/GiteaUrlReader.d.ts:14:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/GiteaUrlReader.d.ts:18:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/GiteaUrlReader.d.ts:19:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/GiteaUrlReader.d.ts:20:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/GiteaUrlReader.d.ts:21:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/GiteaUrlReader.d.ts:22:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/GithubUrlReader.d.ts:20:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/GithubUrlReader.d.ts:25:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/GithubUrlReader.d.ts:27:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/GithubUrlReader.d.ts:28:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/GithubUrlReader.d.ts:29:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/GithubUrlReader.d.ts:30:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/GitlabUrlReader.d.ts:14:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/GitlabUrlReader.d.ts:18:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/GitlabUrlReader.d.ts:19:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/GitlabUrlReader.d.ts:20:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/GitlabUrlReader.d.ts:21:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/GitlabUrlReader.d.ts:31:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/entrypoints/urlReader/lib/GitlabUrlReader.d.ts:32:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/entrypoints/urlReader/lib/GitlabUrlReader.d.ts:35:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/HarnessUrlReader.d.ts:15:5 - (ae-undocumented) Missing documentation for "factory". -// src/entrypoints/urlReader/lib/HarnessUrlReader.d.ts:19:5 - (ae-undocumented) Missing documentation for "read". -// src/entrypoints/urlReader/lib/HarnessUrlReader.d.ts:20:5 - (ae-undocumented) Missing documentation for "readUrl". -// src/entrypoints/urlReader/lib/HarnessUrlReader.d.ts:21:5 - (ae-undocumented) Missing documentation for "readTree". -// src/entrypoints/urlReader/lib/HarnessUrlReader.d.ts:22:5 - (ae-undocumented) Missing documentation for "search". -// src/entrypoints/urlReader/lib/HarnessUrlReader.d.ts:23:5 - (ae-undocumented) Missing documentation for "toString". -// src/entrypoints/urlReader/lib/types.d.ts:74:5 - (ae-undocumented) Missing documentation for "fromTarArchive". -// src/entrypoints/urlReader/lib/types.d.ts:81:5 - (ae-undocumented) Missing documentation for "fromZipArchive". -// src/entrypoints/urlReader/lib/types.d.ts:82:5 - (ae-undocumented) Missing documentation for "fromReadableArray". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-defaults/report.api.md b/packages/backend-defaults/report.api.md index 9878336d27..def38beda7 100644 --- a/packages/backend-defaults/report.api.md +++ b/packages/backend-defaults/report.api.md @@ -11,8 +11,4 @@ export function createBackend(): Backend; // @public export const discoveryFeatureLoader: BackendFeature; - -// Warnings were encountered during analysis: -// -// src/CreateBackend.d.ts:6:1 - (ae-undocumented) Missing documentation for "createBackend". ``` diff --git a/packages/backend-defaults/src/entrypoints/urlReader/lib/GitlabUrlReader.ts b/packages/backend-defaults/src/entrypoints/urlReader/lib/GitlabUrlReader.ts index 35123da851..f5050cca5e 100644 --- a/packages/backend-defaults/src/entrypoints/urlReader/lib/GitlabUrlReader.ts +++ b/packages/backend-defaults/src/entrypoints/urlReader/lib/GitlabUrlReader.ts @@ -273,8 +273,7 @@ export class GitlabUrlReader implements UrlReaderService { * * E.g. `catalog/foo/*.yaml` will return `catalog/foo`. * - * @param globPattern the glob pattern - * @private + * @param globPattern - the glob pattern */ private getStaticPart(globPattern: string) { const segments = globPattern.split('/'); diff --git a/packages/backend-dynamic-feature-service/report.api.md b/packages/backend-dynamic-feature-service/report.api.md index edbe48b263..7003b3bc2c 100644 --- a/packages/backend-dynamic-feature-service/report.api.md +++ b/packages/backend-dynamic-feature-service/report.api.md @@ -293,76 +293,5 @@ export interface ScannedPluginPackage { manifest: ScannedPluginManifest; } -// Warnings were encountered during analysis: -// -// src/features/features.d.ts:7:1 - (ae-undocumented) Missing documentation for "DynamicPluginsFeatureLoaderOptions". -// src/loader/types.d.ts:4:1 - (ae-undocumented) Missing documentation for "ModuleLoader". -// src/loader/types.d.ts:5:5 - (ae-undocumented) Missing documentation for "bootstrap". -// src/loader/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "load". -// src/manager/plugin-manager.d.ts:10:1 - (ae-undocumented) Missing documentation for "DynamicPluginManagerOptions". -// src/manager/plugin-manager.d.ts:11:5 - (ae-undocumented) Missing documentation for "config". -// src/manager/plugin-manager.d.ts:12:5 - (ae-undocumented) Missing documentation for "logger". -// src/manager/plugin-manager.d.ts:13:5 - (ae-undocumented) Missing documentation for "preferAlpha". -// src/manager/plugin-manager.d.ts:14:5 - (ae-undocumented) Missing documentation for "moduleLoader". -// src/manager/plugin-manager.d.ts:19:1 - (ae-undocumented) Missing documentation for "DynamicPluginManager". -// src/manager/plugin-manager.d.ts:23:5 - (ae-undocumented) Missing documentation for "create". -// src/manager/plugin-manager.d.ts:27:5 - (ae-undocumented) Missing documentation for "availablePackages". -// src/manager/plugin-manager.d.ts:28:5 - (ae-undocumented) Missing documentation for "addBackendPlugin". -// src/manager/plugin-manager.d.ts:31:5 - (ae-undocumented) Missing documentation for "backendPlugins". -// src/manager/plugin-manager.d.ts:34:5 - (ae-undocumented) Missing documentation for "frontendPlugins". -// src/manager/plugin-manager.d.ts:37:5 - (ae-undocumented) Missing documentation for "plugins". -// src/manager/plugin-manager.d.ts:40:5 - (ae-undocumented) Missing documentation for "getScannedPackage". -// src/manager/plugin-manager.d.ts:45:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceRef". -// src/manager/plugin-manager.d.ts:49:1 - (ae-undocumented) Missing documentation for "DynamicPluginsFactoryOptions". -// src/manager/plugin-manager.d.ts:50:5 - (ae-undocumented) Missing documentation for "moduleLoader". -// src/manager/plugin-manager.d.ts:56:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceFactoryWithOptions". -// src/manager/plugin-manager.d.ts:61:22 - (ae-undocumented) Missing documentation for "dynamicPluginsServiceFactory". -// src/manager/plugin-manager.d.ts:66:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFeatureDiscoveryServiceFactory". -// src/manager/plugin-manager.d.ts:71:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFeatureDiscoveryLoader". -// src/manager/types.d.ts:28:1 - (ae-undocumented) Missing documentation for "LegacyPluginEnvironment". -// src/manager/types.d.ts:46:1 - (ae-undocumented) Missing documentation for "DynamicPluginProvider". -// src/manager/types.d.ts:47:5 - (ae-undocumented) Missing documentation for "plugins". -// src/manager/types.d.ts:50:5 - (ae-undocumented) Missing documentation for "getScannedPackage". -// src/manager/types.d.ts:55:1 - (ae-undocumented) Missing documentation for "BackendPluginProvider". -// src/manager/types.d.ts:56:5 - (ae-undocumented) Missing documentation for "backendPlugins". -// src/manager/types.d.ts:63:1 - (ae-undocumented) Missing documentation for "FrontendPluginProvider". -// src/manager/types.d.ts:64:5 - (ae-undocumented) Missing documentation for "frontendPlugins". -// src/manager/types.d.ts:71:1 - (ae-undocumented) Missing documentation for "BaseDynamicPlugin". -// src/manager/types.d.ts:72:5 - (ae-undocumented) Missing documentation for "name". -// src/manager/types.d.ts:73:5 - (ae-undocumented) Missing documentation for "version". -// src/manager/types.d.ts:74:5 - (ae-undocumented) Missing documentation for "role". -// src/manager/types.d.ts:75:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:76:5 - (ae-undocumented) Missing documentation for "failure". -// src/manager/types.d.ts:81:1 - (ae-undocumented) Missing documentation for "DynamicPlugin". -// src/manager/types.d.ts:85:1 - (ae-undocumented) Missing documentation for "FrontendDynamicPlugin". -// src/manager/types.d.ts:86:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:91:1 - (ae-undocumented) Missing documentation for "BackendDynamicPlugin". -// src/manager/types.d.ts:92:5 - (ae-undocumented) Missing documentation for "platform". -// src/manager/types.d.ts:93:5 - (ae-undocumented) Missing documentation for "installer". -// src/manager/types.d.ts:98:1 - (ae-undocumented) Missing documentation for "BackendDynamicPluginInstaller". -// src/manager/types.d.ts:102:1 - (ae-undocumented) Missing documentation for "NewBackendPluginInstaller". -// src/manager/types.d.ts:103:5 - (ae-undocumented) Missing documentation for "kind". -// src/manager/types.d.ts:104:5 - (ae-undocumented) Missing documentation for "install". -// src/manager/types.d.ts:117:1 - (ae-undocumented) Missing documentation for "LegacyBackendPluginInstaller". -// src/manager/types.d.ts:118:5 - (ae-undocumented) Missing documentation for "kind". -// src/manager/types.d.ts:119:5 - (ae-undocumented) Missing documentation for "router". -// src/manager/types.d.ts:123:5 - (ae-undocumented) Missing documentation for "catalog". -// src/manager/types.d.ts:124:5 - (ae-undocumented) Missing documentation for "scaffolder". -// src/manager/types.d.ts:125:5 - (ae-undocumented) Missing documentation for "search". -// src/manager/types.d.ts:126:5 - (ae-undocumented) Missing documentation for "events". -// src/manager/types.d.ts:127:5 - (ae-undocumented) Missing documentation for "permissions". -// src/manager/types.d.ts:134:1 - (ae-undocumented) Missing documentation for "isBackendDynamicPluginInstaller". -// src/scanner/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "ScannedPluginPackage". -// src/scanner/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "location". -// src/scanner/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "manifest". -// src/scanner/types.d.ts:12:1 - (ae-undocumented) Missing documentation for "ScannedPluginManifest". -// src/schemas/frontend.d.ts:5:22 - (ae-undocumented) Missing documentation for "dynamicPluginsFrontendSchemas". -// src/schemas/rootLogger.d.ts:5:1 - (ae-undocumented) Missing documentation for "DynamicPluginsRootLoggerFactoryOptions". -// src/schemas/rootLogger.d.ts:10:22 - (ae-undocumented) Missing documentation for "dynamicPluginsRootLoggerServiceFactory". -// src/schemas/schemas.d.ts:7:1 - (ae-undocumented) Missing documentation for "DynamicPluginsSchemasService". -// src/schemas/schemas.d.ts:8:5 - (ae-undocumented) Missing documentation for "addDynamicPluginsSchemas". -// src/schemas/schemas.d.ts:21:1 - (ae-undocumented) Missing documentation for "DynamicPluginsSchemasOptions". -// src/schemas/schemas.d.ts:37:22 - (ae-undocumented) Missing documentation for "dynamicPluginsSchemasServiceFactory". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-openapi-utils/report.api.md b/packages/backend-openapi-utils/report.api.md index f543a9cfb7..2f660cd0d6 100644 --- a/packages/backend-openapi-utils/report.api.md +++ b/packages/backend-openapi-utils/report.api.md @@ -722,84 +722,4 @@ export const wrapInOpenApiTestServer: (app: Express_2) => Server | Express_2; // @public export function wrapServer(app: Express_2): Promise; - -// Warnings were encountered during analysis: -// -// src/router.d.ts:8:5 - (ae-undocumented) Missing documentation for "get". -// src/router.d.ts:9:5 - (ae-undocumented) Missing documentation for "post". -// src/router.d.ts:10:5 - (ae-undocumented) Missing documentation for "all". -// src/router.d.ts:11:5 - (ae-undocumented) Missing documentation for "put". -// src/router.d.ts:12:5 - (ae-undocumented) Missing documentation for "delete". -// src/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "patch". -// src/router.d.ts:14:5 - (ae-undocumented) Missing documentation for "options". -// src/router.d.ts:15:5 - (ae-undocumented) Missing documentation for "head". -// src/types/common.d.ts:14:1 - (ae-undocumented) Missing documentation for "PathDoc". -// src/types/common.d.ts:60:1 - (ae-undocumented) Missing documentation for "DocPathTemplate". -// src/types/common.d.ts:64:1 - (ae-undocumented) Missing documentation for "DocPathMethod". -// src/types/common.d.ts:68:1 - (ae-undocumented) Missing documentation for "DocPathTemplateMethod". -// src/types/common.d.ts:72:1 - (ae-undocumented) Missing documentation for "MethodAwareDocPath". -// src/types/common.d.ts:78:1 - (ae-undocumented) Missing documentation for "DocOperation". -// src/types/common.d.ts:82:1 - (ae-undocumented) Missing documentation for "ComponentTypes". -// src/types/common.d.ts:86:1 - (ae-undocumented) Missing documentation for "ComponentRef". -// src/types/common.d.ts:92:1 - (ae-undocumented) Missing documentation for "SchemaRef". -// src/types/common.d.ts:100:1 - (ae-undocumented) Missing documentation for "ObjectWithContentSchema". -// src/types/common.d.ts:114:1 - (ae-undocumented) Missing documentation for "LastOf". -// src/types/common.d.ts:118:1 - (ae-undocumented) Missing documentation for "Push". -// src/types/common.d.ts:122:1 - (ae-undocumented) Missing documentation for "TuplifyUnion". -// src/types/common.d.ts:126:1 - (ae-undocumented) Missing documentation for "ConvertAll". -// src/types/common.d.ts:134:1 - (ae-undocumented) Missing documentation for "UnknownIfNever". -// src/types/common.d.ts:138:1 - (ae-undocumented) Missing documentation for "ToTypeSafe". -// src/types/common.d.ts:142:1 - (ae-undocumented) Missing documentation for "DiscriminateUnion". -// src/types/common.d.ts:146:1 - (ae-undocumented) Missing documentation for "MapDiscriminatedUnion". -// src/types/common.d.ts:152:1 - (ae-undocumented) Missing documentation for "PickOptionalKeys". -// src/types/common.d.ts:160:1 - (ae-undocumented) Missing documentation for "PickRequiredKeys". -// src/types/common.d.ts:168:1 - (ae-undocumented) Missing documentation for "OptionalMap". -// src/types/common.d.ts:176:1 - (ae-undocumented) Missing documentation for "RequiredMap". -// src/types/common.d.ts:184:1 - (ae-undocumented) Missing documentation for "FullMap". -// src/types/common.d.ts:190:1 - (ae-undocumented) Missing documentation for "Filter". -// src/types/express.d.ts:21:5 - (ae-undocumented) Missing documentation for "__call". -// src/types/express.d.ts:22:5 - (ae-undocumented) Missing documentation for "__call". -// src/types/immutable.d.ts:18:1 - (ae-undocumented) Missing documentation for "ImmutableObject". -// src/types/immutable.d.ts:24:1 - (ae-undocumented) Missing documentation for "ImmutableReferenceObject". -// src/types/immutable.d.ts:28:1 - (ae-undocumented) Missing documentation for "ImmutableOpenAPIObject". -// src/types/immutable.d.ts:32:1 - (ae-undocumented) Missing documentation for "ImmutableContentObject". -// src/types/immutable.d.ts:36:1 - (ae-undocumented) Missing documentation for "ImmutableRequestBodyObject". -// src/types/immutable.d.ts:40:1 - (ae-undocumented) Missing documentation for "ImmutableResponseObject". -// src/types/immutable.d.ts:44:1 - (ae-undocumented) Missing documentation for "ImmutableParameterObject". -// src/types/immutable.d.ts:48:1 - (ae-undocumented) Missing documentation for "HeaderObject". -// src/types/immutable.d.ts:49:5 - (ae-undocumented) Missing documentation for "in". -// src/types/immutable.d.ts:50:5 - (ae-undocumented) Missing documentation for "style". -// src/types/immutable.d.ts:55:1 - (ae-undocumented) Missing documentation for "ImmutableHeaderObject". -// src/types/immutable.d.ts:59:1 - (ae-undocumented) Missing documentation for "CookieObject". -// src/types/immutable.d.ts:60:5 - (ae-undocumented) Missing documentation for "in". -// src/types/immutable.d.ts:61:5 - (ae-undocumented) Missing documentation for "style". -// src/types/immutable.d.ts:66:1 - (ae-undocumented) Missing documentation for "ImmutableCookieObject". -// src/types/immutable.d.ts:70:1 - (ae-undocumented) Missing documentation for "QueryObject". -// src/types/immutable.d.ts:71:5 - (ae-undocumented) Missing documentation for "in". -// src/types/immutable.d.ts:72:5 - (ae-undocumented) Missing documentation for "style". -// src/types/immutable.d.ts:77:1 - (ae-undocumented) Missing documentation for "ImmutableQueryObject". -// src/types/immutable.d.ts:81:1 - (ae-undocumented) Missing documentation for "PathObject". -// src/types/immutable.d.ts:82:5 - (ae-undocumented) Missing documentation for "in". -// src/types/immutable.d.ts:83:5 - (ae-undocumented) Missing documentation for "style". -// src/types/immutable.d.ts:88:1 - (ae-undocumented) Missing documentation for "ImmutablePathObject". -// src/types/immutable.d.ts:92:1 - (ae-undocumented) Missing documentation for "ImmutableSchemaObject". -// src/types/params.d.ts:7:1 - (ae-undocumented) Missing documentation for "DocParameter". -// src/types/params.d.ts:16:1 - (ae-undocumented) Missing documentation for "DocParameters". -// src/types/params.d.ts:22:1 - (ae-undocumented) Missing documentation for "ParameterSchema". -// src/types/params.d.ts:26:1 - (ae-undocumented) Missing documentation for "MapToSchema". -// src/types/params.d.ts:32:1 - (ae-undocumented) Missing documentation for "ParametersSchema". -// src/types/params.d.ts:36:1 - (ae-undocumented) Missing documentation for "HeaderSchema". -// src/types/params.d.ts:40:1 - (ae-undocumented) Missing documentation for "CookieSchema". -// src/types/params.d.ts:44:1 - (ae-undocumented) Missing documentation for "PathSchema". -// src/types/params.d.ts:48:1 - (ae-undocumented) Missing documentation for "QuerySchema". -// src/types/requests.d.ts:9:1 - (ae-undocumented) Missing documentation for "RequestBody". -// src/types/requests.d.ts:13:1 - (ae-undocumented) Missing documentation for "RequestBodySchema". -// src/types/responses.d.ts:9:1 - (ae-undocumented) Missing documentation for "Response". -// src/types/responses.d.ts:13:1 - (ae-undocumented) Missing documentation for "ResponseSchemas". -// src/utility.d.ts:5:1 - (ae-undocumented) Missing documentation for "Response". -// src/utility.d.ts:9:1 - (ae-undocumented) Missing documentation for "Request". -// src/utility.d.ts:13:1 - (ae-undocumented) Missing documentation for "HeaderParameters". -// src/utility.d.ts:17:1 - (ae-undocumented) Missing documentation for "CookieParameters". -// src/utility.d.ts:21:1 - (ae-undocumented) Missing documentation for "PathParameters". -// src/utility.d.ts:25:1 - (ae-undocumented) Missing documentation for "QueryParameters". ``` diff --git a/packages/backend-plugin-api/report-alpha.api.md b/packages/backend-plugin-api/report-alpha.api.md index 29c74e7ade..dea357502e 100644 --- a/packages/backend-plugin-api/report-alpha.api.md +++ b/packages/backend-plugin-api/report-alpha.api.md @@ -21,10 +21,5 @@ export const featureDiscoveryServiceRef: ServiceRef< 'singleton' >; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:1 - (ae-undocumented) Missing documentation for "FeatureDiscoveryService". -// src/alpha.d.ts:4:5 - (ae-undocumented) Missing documentation for "getBackendFeatures". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-plugin-api/report-testUtils.api.md b/packages/backend-plugin-api/report-testUtils.api.md index 8f2f871e90..8c9bba8398 100644 --- a/packages/backend-plugin-api/report-testUtils.api.md +++ b/packages/backend-plugin-api/report-testUtils.api.md @@ -22,10 +22,5 @@ export interface PackagePathResolutionOverride { restore(): void; } -// Warnings were encountered during analysis: -// -// src/testUtils.d.ts:2:1 - (ae-undocumented) Missing documentation for "PackagePathResolutionOverride". -// src/testUtils.d.ts:7:1 - (ae-undocumented) Missing documentation for "OverridePackagePathResolutionOptions". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/backend-plugin-api/report.api.md b/packages/backend-plugin-api/report.api.md index e03179e851..89dfe40dd9 100644 --- a/packages/backend-plugin-api/report.api.md +++ b/packages/backend-plugin-api/report.api.md @@ -735,48 +735,4 @@ export type UrlReaderServiceSearchResponseFile = { export interface UserInfoService { getUserInfo(credentials: BackstageCredentials): Promise; } - -// Warnings were encountered during analysis: -// -// src/services/definitions/HttpRouterService.d.ts:8:5 - (ae-undocumented) Missing documentation for "path". -// src/services/definitions/HttpRouterService.d.ts:9:5 - (ae-undocumented) Missing documentation for "allow". -// src/services/definitions/LifecycleService.d.ts:5:1 - (ae-undocumented) Missing documentation for "LifecycleServiceStartupHook". -// src/services/definitions/LifecycleService.d.ts:9:1 - (ae-undocumented) Missing documentation for "LifecycleServiceStartupOptions". -// src/services/definitions/LifecycleService.d.ts:18:1 - (ae-undocumented) Missing documentation for "LifecycleServiceShutdownHook". -// src/services/definitions/LifecycleService.d.ts:22:1 - (ae-undocumented) Missing documentation for "LifecycleServiceShutdownOptions". -// src/services/definitions/LoggerService.d.ts:10:5 - (ae-undocumented) Missing documentation for "error". -// src/services/definitions/LoggerService.d.ts:11:5 - (ae-undocumented) Missing documentation for "warn". -// src/services/definitions/LoggerService.d.ts:12:5 - (ae-undocumented) Missing documentation for "info". -// src/services/definitions/LoggerService.d.ts:13:5 - (ae-undocumented) Missing documentation for "debug". -// src/services/definitions/LoggerService.d.ts:14:5 - (ae-undocumented) Missing documentation for "child". -// src/services/definitions/PermissionsService.d.ts:9:5 - (ae-undocumented) Missing documentation for "credentials". -// src/services/definitions/RootHealthService.d.ts:5:1 - (ae-undocumented) Missing documentation for "RootHealthService". -// src/services/definitions/UserInfoService.d.ts:9:5 - (ae-undocumented) Missing documentation for "userEntityRef". -// src/services/definitions/UserInfoService.d.ts:10:5 - (ae-undocumented) Missing documentation for "ownershipEntityRefs". -// src/services/system/types.d.ts:35:1 - (ae-undocumented) Missing documentation for "ServiceFactory". -// src/services/system/types.d.ts:36:5 - (ae-undocumented) Missing documentation for "service". -// src/services/system/types.d.ts:39:1 - (ae-undocumented) Missing documentation for "ServiceRefOptions". -// src/services/system/types.d.ts:40:5 - (ae-undocumented) Missing documentation for "id". -// src/services/system/types.d.ts:41:5 - (ae-undocumented) Missing documentation for "scope". -// src/services/system/types.d.ts:42:5 - (ae-undocumented) Missing documentation for "multiton". -// src/services/system/types.d.ts:43:5 - (ae-undocumented) Missing documentation for "defaultFactory". -// src/services/system/types.d.ts:76:1 - (ae-undocumented) Missing documentation for "RootServiceFactoryOptions". -// src/services/system/types.d.ts:90:5 - (ae-undocumented) Missing documentation for "service". -// src/services/system/types.d.ts:91:5 - (ae-undocumented) Missing documentation for "deps". -// src/services/system/types.d.ts:92:5 - (ae-undocumented) Missing documentation for "factory". -// src/services/system/types.d.ts:95:1 - (ae-undocumented) Missing documentation for "PluginServiceFactoryOptions". -// src/services/system/types.d.ts:109:5 - (ae-undocumented) Missing documentation for "service". -// src/services/system/types.d.ts:110:5 - (ae-undocumented) Missing documentation for "deps". -// src/services/system/types.d.ts:111:5 - (ae-undocumented) Missing documentation for "createRootContext". -// src/services/system/types.d.ts:112:5 - (ae-undocumented) Missing documentation for "factory". -// src/types.d.ts:2:1 - (ae-undocumented) Missing documentation for "BackendFeature". -// src/types.d.ts:3:5 - (ae-undocumented) Missing documentation for "$$type". -// src/wiring/createBackendFeatureLoader.d.ts:10:5 - (ae-undocumented) Missing documentation for "deps". -// src/wiring/createBackendFeatureLoader.d.ts:13:5 - (ae-undocumented) Missing documentation for "loader". -// src/wiring/createBackendModule.d.ts:21:5 - (ae-undocumented) Missing documentation for "register". -// src/wiring/createBackendPlugin.d.ts:17:5 - (ae-undocumented) Missing documentation for "register". -// src/wiring/types.d.ts:30:5 - (ae-undocumented) Missing documentation for "registerExtensionPoint". -// src/wiring/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "registerInit". -// src/wiring/types.d.ts:44:5 - (ae-undocumented) Missing documentation for "registerExtensionPoint". -// src/wiring/types.d.ts:45:5 - (ae-undocumented) Missing documentation for "registerInit". ``` diff --git a/packages/backend-test-utils/report.api.md b/packages/backend-test-utils/report.api.md index d9c1c4c721..263435c920 100644 --- a/packages/backend-test-utils/report.api.md +++ b/packages/backend-test-utils/report.api.md @@ -474,84 +474,4 @@ export class TestDatabases { // (undocumented) supports(id: TestDatabaseId): boolean; } - -// Warnings were encountered during analysis: -// -// src/cache/TestCaches.d.ts:27:5 - (ae-undocumented) Missing documentation for "setDefaults". -// src/cache/TestCaches.d.ts:31:5 - (ae-undocumented) Missing documentation for "supports". -// src/cache/TestCaches.d.ts:32:5 - (ae-undocumented) Missing documentation for "eachSupportedId". -// src/database/TestDatabases.d.ts:29:5 - (ae-undocumented) Missing documentation for "setDefaults". -// src/database/TestDatabases.d.ts:33:5 - (ae-undocumented) Missing documentation for "supports". -// src/database/TestDatabases.d.ts:34:5 - (ae-undocumented) Missing documentation for "eachSupportedId". -// src/next/services/mockCredentials.d.ts:17:1 - (ae-undocumented) Missing documentation for "mockCredentials". -// src/next/services/mockCredentials.d.ts:58:9 - (ae-undocumented) Missing documentation for "invalidToken". -// src/next/services/mockCredentials.d.ts:59:9 - (ae-undocumented) Missing documentation for "invalidHeader". -// src/next/services/mockCredentials.d.ts:84:9 - (ae-undocumented) Missing documentation for "invalidToken". -// src/next/services/mockCredentials.d.ts:85:9 - (ae-undocumented) Missing documentation for "invalidCookie". -// src/next/services/mockCredentials.d.ts:116:9 - (ae-undocumented) Missing documentation for "invalidToken". -// src/next/services/mockCredentials.d.ts:117:9 - (ae-undocumented) Missing documentation for "invalidHeader". -// src/next/services/mockServices.d.ts:5:1 - (ae-undocumented) Missing documentation for "ServiceMock". -// src/next/services/mockServices.d.ts:53:5 - (ae-undocumented) Missing documentation for "rootConfig". -// src/next/services/mockServices.d.ts:54:5 - (ae-undocumented) Missing documentation for "rootConfig". -// src/next/services/mockServices.d.ts:55:9 - (ae-undocumented) Missing documentation for "Options". -// src/next/services/mockServices.d.ts:58:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:59:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:61:5 - (ae-undocumented) Missing documentation for "rootLogger". -// src/next/services/mockServices.d.ts:62:5 - (ae-undocumented) Missing documentation for "rootLogger". -// src/next/services/mockServices.d.ts:63:9 - (ae-undocumented) Missing documentation for "Options". -// src/next/services/mockServices.d.ts:66:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:67:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:69:5 - (ae-undocumented) Missing documentation for "auth". -// src/next/services/mockServices.d.ts:73:5 - (ae-undocumented) Missing documentation for "auth". -// src/next/services/mockServices.d.ts:74:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:75:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:77:5 - (ae-undocumented) Missing documentation for "discovery". -// src/next/services/mockServices.d.ts:78:5 - (ae-undocumented) Missing documentation for "discovery". -// src/next/services/mockServices.d.ts:79:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:80:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:100:5 - (ae-undocumented) Missing documentation for "httpAuth". -// src/next/services/mockServices.d.ts:111:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:121:5 - (ae-undocumented) Missing documentation for "userInfo". -// src/next/services/mockServices.d.ts:129:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:131:5 - (ae-undocumented) Missing documentation for "cache". -// src/next/services/mockServices.d.ts:132:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:133:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:135:5 - (ae-undocumented) Missing documentation for "database". -// src/next/services/mockServices.d.ts:136:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:137:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:139:5 - (ae-undocumented) Missing documentation for "rootHealth". -// src/next/services/mockServices.d.ts:140:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:141:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:143:5 - (ae-undocumented) Missing documentation for "httpRouter". -// src/next/services/mockServices.d.ts:144:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:145:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:147:5 - (ae-undocumented) Missing documentation for "rootHttpRouter". -// src/next/services/mockServices.d.ts:148:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:149:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:151:5 - (ae-undocumented) Missing documentation for "lifecycle". -// src/next/services/mockServices.d.ts:152:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:153:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:155:5 - (ae-undocumented) Missing documentation for "logger". -// src/next/services/mockServices.d.ts:156:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:157:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:159:5 - (ae-undocumented) Missing documentation for "permissions". -// src/next/services/mockServices.d.ts:160:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:161:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:163:5 - (ae-undocumented) Missing documentation for "rootLifecycle". -// src/next/services/mockServices.d.ts:164:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:165:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:167:5 - (ae-undocumented) Missing documentation for "scheduler". -// src/next/services/mockServices.d.ts:168:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:169:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:171:5 - (ae-undocumented) Missing documentation for "urlReader". -// src/next/services/mockServices.d.ts:172:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:173:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/services/mockServices.d.ts:175:5 - (ae-undocumented) Missing documentation for "events". -// src/next/services/mockServices.d.ts:176:15 - (ae-undocumented) Missing documentation for "factory". -// src/next/services/mockServices.d.ts:177:15 - (ae-undocumented) Missing documentation for "mock". -// src/next/wiring/TestBackend.d.ts:5:1 - (ae-undocumented) Missing documentation for "TestBackendOptions". -// src/next/wiring/TestBackend.d.ts:6:5 - (ae-undocumented) Missing documentation for "extensionPoints". -// src/next/wiring/TestBackend.d.ts:14:5 - (ae-undocumented) Missing documentation for "features". -// src/next/wiring/TestBackend.d.ts:19:1 - (ae-undocumented) Missing documentation for "TestBackend". -// src/next/wiring/TestBackend.d.ts:30:1 - (ae-undocumented) Missing documentation for "startTestBackend". ``` diff --git a/packages/catalog-client/report-testUtils.api.md b/packages/catalog-client/report-testUtils.api.md index 9341327554..88d14b4f7a 100644 --- a/packages/catalog-client/report-testUtils.api.md +++ b/packages/catalog-client/report-testUtils.api.md @@ -67,22 +67,5 @@ export class InMemoryCatalogClient implements CatalogApi { ): Promise; } -// Warnings were encountered during analysis: -// -// src/testUtils/InMemoryCatalogClient.d.ts:15:5 - (ae-undocumented) Missing documentation for "getEntities". -// src/testUtils/InMemoryCatalogClient.d.ts:16:5 - (ae-undocumented) Missing documentation for "getEntitiesByRefs". -// src/testUtils/InMemoryCatalogClient.d.ts:17:5 - (ae-undocumented) Missing documentation for "queryEntities". -// src/testUtils/InMemoryCatalogClient.d.ts:18:5 - (ae-undocumented) Missing documentation for "getEntityAncestors". -// src/testUtils/InMemoryCatalogClient.d.ts:19:5 - (ae-undocumented) Missing documentation for "getEntityByRef". -// src/testUtils/InMemoryCatalogClient.d.ts:20:5 - (ae-undocumented) Missing documentation for "removeEntityByUid". -// src/testUtils/InMemoryCatalogClient.d.ts:21:5 - (ae-undocumented) Missing documentation for "refreshEntity". -// src/testUtils/InMemoryCatalogClient.d.ts:22:5 - (ae-undocumented) Missing documentation for "getEntityFacets". -// src/testUtils/InMemoryCatalogClient.d.ts:23:5 - (ae-undocumented) Missing documentation for "getLocationById". -// src/testUtils/InMemoryCatalogClient.d.ts:24:5 - (ae-undocumented) Missing documentation for "getLocationByRef". -// src/testUtils/InMemoryCatalogClient.d.ts:25:5 - (ae-undocumented) Missing documentation for "addLocation". -// src/testUtils/InMemoryCatalogClient.d.ts:26:5 - (ae-undocumented) Missing documentation for "removeLocationById". -// src/testUtils/InMemoryCatalogClient.d.ts:27:5 - (ae-undocumented) Missing documentation for "getLocationByEntity". -// src/testUtils/InMemoryCatalogClient.d.ts:28:5 - (ae-undocumented) Missing documentation for "validateEntity". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/catalog-client/report.api.md b/packages/catalog-client/report.api.md index aba99961f0..203028edce 100644 --- a/packages/catalog-client/report.api.md +++ b/packages/catalog-client/report.api.md @@ -302,13 +302,4 @@ export type ValidateEntityResponse = valid: false; errors: SerializedError[]; }; - -// Warnings were encountered during analysis: -// -// src/CatalogClient.d.ts:50:5 - (ae-undocumented) Missing documentation for "getEntityByName". -// src/types/api.d.ts:154:5 - (ae-undocumented) Missing documentation for "items". -// src/types/api.d.ts:203:5 - (ae-undocumented) Missing documentation for "entityRef". -// src/types/api.d.ts:211:5 - (ae-undocumented) Missing documentation for "rootEntityRef". -// src/types/api.d.ts:212:5 - (ae-undocumented) Missing documentation for "items". -// src/types/api.d.ts:305:5 - (ae-undocumented) Missing documentation for "token". ``` diff --git a/packages/catalog-model/report.api.md b/packages/catalog-model/report.api.md index 07dc6affd7..ec03ce41e1 100644 --- a/packages/catalog-model/report.api.md +++ b/packages/catalog-model/report.api.md @@ -499,52 +499,4 @@ export type Validators = { isValidAnnotationValue(value: unknown): boolean; isValidTag(value: unknown): boolean; }; - -// Warnings were encountered during analysis: -// -// src/entity/conditions.d.ts:6:1 - (ae-undocumented) Missing documentation for "isApiEntity". -// src/entity/conditions.d.ts:10:1 - (ae-undocumented) Missing documentation for "isComponentEntity". -// src/entity/conditions.d.ts:14:1 - (ae-undocumented) Missing documentation for "isDomainEntity". -// src/entity/conditions.d.ts:18:1 - (ae-undocumented) Missing documentation for "isGroupEntity". -// src/entity/conditions.d.ts:22:1 - (ae-undocumented) Missing documentation for "isLocationEntity". -// src/entity/conditions.d.ts:26:1 - (ae-undocumented) Missing documentation for "isResourceEntity". -// src/entity/conditions.d.ts:30:1 - (ae-undocumented) Missing documentation for "isSystemEntity". -// src/entity/conditions.d.ts:34:1 - (ae-undocumented) Missing documentation for "isUserEntity". -// src/entity/policies/DefaultNamespaceEntityPolicy.d.ts:11:5 - (ae-undocumented) Missing documentation for "enforce". -// src/entity/policies/FieldFormatEntityPolicy.d.ts:17:5 - (ae-undocumented) Missing documentation for "enforce". -// src/entity/policies/GroupDefaultParentEntityPolicy.d.ts:14:5 - (ae-undocumented) Missing documentation for "enforce". -// src/entity/policies/NoForeignRootFieldsEntityPolicy.d.ts:11:5 - (ae-undocumented) Missing documentation for "enforce". -// src/entity/policies/SchemaValidEntityPolicy.d.ts:16:5 - (ae-undocumented) Missing documentation for "enforce". -// src/kinds/ApiEntityV1alpha1.d.ts:12:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/kinds/ApiEntityV1alpha1.d.ts:13:5 - (ae-undocumented) Missing documentation for "kind". -// src/kinds/ApiEntityV1alpha1.d.ts:14:5 - (ae-undocumented) Missing documentation for "spec". -// src/kinds/ComponentEntityV1alpha1.d.ts:12:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/kinds/ComponentEntityV1alpha1.d.ts:13:5 - (ae-undocumented) Missing documentation for "kind". -// src/kinds/ComponentEntityV1alpha1.d.ts:14:5 - (ae-undocumented) Missing documentation for "spec". -// src/kinds/DomainEntityV1alpha1.d.ts:12:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/kinds/DomainEntityV1alpha1.d.ts:13:5 - (ae-undocumented) Missing documentation for "kind". -// src/kinds/DomainEntityV1alpha1.d.ts:14:5 - (ae-undocumented) Missing documentation for "spec". -// src/kinds/GroupEntityV1alpha1.d.ts:8:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/kinds/GroupEntityV1alpha1.d.ts:9:5 - (ae-undocumented) Missing documentation for "kind". -// src/kinds/GroupEntityV1alpha1.d.ts:10:5 - (ae-undocumented) Missing documentation for "spec". -// src/kinds/LocationEntityV1alpha1.d.ts:8:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/kinds/LocationEntityV1alpha1.d.ts:9:5 - (ae-undocumented) Missing documentation for "kind". -// src/kinds/LocationEntityV1alpha1.d.ts:10:5 - (ae-undocumented) Missing documentation for "spec". -// src/kinds/ResourceEntityV1alpha1.d.ts:12:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/kinds/ResourceEntityV1alpha1.d.ts:13:5 - (ae-undocumented) Missing documentation for "kind". -// src/kinds/ResourceEntityV1alpha1.d.ts:14:5 - (ae-undocumented) Missing documentation for "spec". -// src/kinds/SystemEntityV1alpha1.d.ts:12:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/kinds/SystemEntityV1alpha1.d.ts:13:5 - (ae-undocumented) Missing documentation for "kind". -// src/kinds/SystemEntityV1alpha1.d.ts:14:5 - (ae-undocumented) Missing documentation for "spec". -// src/kinds/UserEntityV1alpha1.d.ts:8:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/kinds/UserEntityV1alpha1.d.ts:9:5 - (ae-undocumented) Missing documentation for "kind". -// src/kinds/UserEntityV1alpha1.d.ts:10:5 - (ae-undocumented) Missing documentation for "spec". -// src/validation/KubernetesValidatorFunctions.d.ts:11:5 - (ae-undocumented) Missing documentation for "isValidApiVersion". -// src/validation/KubernetesValidatorFunctions.d.ts:12:5 - (ae-undocumented) Missing documentation for "isValidKind". -// src/validation/KubernetesValidatorFunctions.d.ts:13:5 - (ae-undocumented) Missing documentation for "isValidObjectName". -// src/validation/KubernetesValidatorFunctions.d.ts:14:5 - (ae-undocumented) Missing documentation for "isValidNamespace". -// src/validation/KubernetesValidatorFunctions.d.ts:15:5 - (ae-undocumented) Missing documentation for "isValidLabelKey". -// src/validation/KubernetesValidatorFunctions.d.ts:16:5 - (ae-undocumented) Missing documentation for "isValidLabelValue". -// src/validation/KubernetesValidatorFunctions.d.ts:17:5 - (ae-undocumented) Missing documentation for "isValidAnnotationKey". -// src/validation/KubernetesValidatorFunctions.d.ts:18:5 - (ae-undocumented) Missing documentation for "isValidAnnotationValue". ``` diff --git a/packages/cli-node/report.api.md b/packages/cli-node/report.api.md index eb18e2e9f8..7c1a3bc744 100644 --- a/packages/cli-node/report.api.md +++ b/packages/cli-node/report.api.md @@ -176,28 +176,4 @@ export class PackageRoles { static getRoleFromPackage(pkgJson: unknown): PackageRole | undefined; static getRoleInfo(role: string): PackageRoleInfo; } - -// Warnings were encountered during analysis: -// -// src/monorepo/PackageGraph.d.ts:10:5 - (ae-undocumented) Missing documentation for "name". -// src/monorepo/PackageGraph.d.ts:11:5 - (ae-undocumented) Missing documentation for "version". -// src/monorepo/PackageGraph.d.ts:12:5 - (ae-undocumented) Missing documentation for "private". -// src/monorepo/PackageGraph.d.ts:13:5 - (ae-undocumented) Missing documentation for "main". -// src/monorepo/PackageGraph.d.ts:14:5 - (ae-undocumented) Missing documentation for "module". -// src/monorepo/PackageGraph.d.ts:15:5 - (ae-undocumented) Missing documentation for "types". -// src/monorepo/PackageGraph.d.ts:16:5 - (ae-undocumented) Missing documentation for "scripts". -// src/monorepo/PackageGraph.d.ts:19:5 - (ae-undocumented) Missing documentation for "bundled". -// src/monorepo/PackageGraph.d.ts:20:5 - (ae-undocumented) Missing documentation for "backstage". -// src/monorepo/PackageGraph.d.ts:44:5 - (ae-undocumented) Missing documentation for "exports". -// src/monorepo/PackageGraph.d.ts:45:5 - (ae-undocumented) Missing documentation for "typesVersions". -// src/monorepo/PackageGraph.d.ts:46:5 - (ae-undocumented) Missing documentation for "files". -// src/monorepo/PackageGraph.d.ts:47:5 - (ae-undocumented) Missing documentation for "publishConfig". -// src/monorepo/PackageGraph.d.ts:52:5 - (ae-undocumented) Missing documentation for "repository". -// src/monorepo/PackageGraph.d.ts:57:5 - (ae-undocumented) Missing documentation for "dependencies". -// src/monorepo/PackageGraph.d.ts:60:5 - (ae-undocumented) Missing documentation for "peerDependencies". -// src/monorepo/PackageGraph.d.ts:63:5 - (ae-undocumented) Missing documentation for "devDependencies". -// src/monorepo/PackageGraph.d.ts:66:5 - (ae-undocumented) Missing documentation for "optionalDependencies". -// src/roles/types.d.ts:25:5 - (ae-undocumented) Missing documentation for "role". -// src/roles/types.d.ts:26:5 - (ae-undocumented) Missing documentation for "platform". -// src/roles/types.d.ts:27:5 - (ae-undocumented) Missing documentation for "output". ``` diff --git a/packages/config-loader/report.api.md b/packages/config-loader/report.api.md index 7d7047d493..e2741d609c 100644 --- a/packages/config-loader/report.api.md +++ b/packages/config-loader/report.api.md @@ -284,32 +284,4 @@ export type TransformFunc = ( path: string; }, ) => T | undefined; - -// Warnings were encountered during analysis: -// -// src/loader.d.ts:6:1 - (ae-undocumented) Missing documentation for "ConfigTarget". -// src/loader.d.ts:15:1 - (ae-undocumented) Missing documentation for "LoadConfigOptionsWatch". -// src/loader.d.ts:29:1 - (ae-undocumented) Missing documentation for "LoadConfigOptionsRemote". -// src/sources/ConfigSources.d.ts:42:5 - (ae-undocumented) Missing documentation for "watch". -// src/sources/ConfigSources.d.ts:43:5 - (ae-undocumented) Missing documentation for "rootDir". -// src/sources/ConfigSources.d.ts:44:5 - (ae-undocumented) Missing documentation for "remote". -// src/sources/ConfigSources.d.ts:65:5 - (ae-undocumented) Missing documentation for "targets". -// src/sources/ConfigSources.d.ts:73:5 - (ae-undocumented) Missing documentation for "argv". -// src/sources/ConfigSources.d.ts:74:5 - (ae-undocumented) Missing documentation for "env". -// src/sources/EnvConfigSource.d.ts:46:5 - (ae-undocumented) Missing documentation for "readConfigData". -// src/sources/EnvConfigSource.d.ts:47:5 - (ae-undocumented) Missing documentation for "toString". -// src/sources/FileConfigSource.d.ts:44:5 - (ae-undocumented) Missing documentation for "readConfigData". -// src/sources/FileConfigSource.d.ts:45:5 - (ae-undocumented) Missing documentation for "toString". -// src/sources/MutableConfigSource.d.ts:9:5 - (ae-undocumented) Missing documentation for "data". -// src/sources/MutableConfigSource.d.ts:10:5 - (ae-undocumented) Missing documentation for "context". -// src/sources/MutableConfigSource.d.ts:27:5 - (ae-undocumented) Missing documentation for "readConfigData". -// src/sources/MutableConfigSource.d.ts:38:5 - (ae-undocumented) Missing documentation for "toString". -// src/sources/RemoteConfigSource.d.ts:43:5 - (ae-undocumented) Missing documentation for "readConfigData". -// src/sources/RemoteConfigSource.d.ts:44:5 - (ae-undocumented) Missing documentation for "toString". -// src/sources/StaticConfigSource.d.ts:9:5 - (ae-undocumented) Missing documentation for "data". -// src/sources/StaticConfigSource.d.ts:10:5 - (ae-undocumented) Missing documentation for "context". -// src/sources/StaticConfigSource.d.ts:28:5 - (ae-undocumented) Missing documentation for "readConfigData". -// src/sources/StaticConfigSource.d.ts:29:5 - (ae-undocumented) Missing documentation for "toString". -// src/sources/types.d.ts:20:5 - (ae-undocumented) Missing documentation for "signal". -// src/sources/types.d.ts:55:5 - (ae-undocumented) Missing documentation for "readConfigData". ``` diff --git a/packages/core-app-api/report.api.md b/packages/core-app-api/report.api.md index a326555cc1..3d2c44a148 100644 --- a/packages/core-app-api/report.api.md +++ b/packages/core-app-api/report.api.md @@ -683,70 +683,4 @@ export class WebStorage implements StorageApi { // (undocumented) snapshot(key: string): StorageValueSnapshot; } - -// Warnings were encountered during analysis: -// -// src/apis/implementations/AlertApi/AlertApiForwarder.d.ts:10:5 - (ae-undocumented) Missing documentation for "post". -// src/apis/implementations/AlertApi/AlertApiForwarder.d.ts:11:5 - (ae-undocumented) Missing documentation for "alert$". -// src/apis/implementations/AnalyticsApi/NoOpAnalyticsApi.d.ts:8:5 - (ae-undocumented) Missing documentation for "captureEvent". -// src/apis/implementations/AppThemeApi/AppThemeSelector.d.ts:11:5 - (ae-undocumented) Missing documentation for "createWithStorage". -// src/apis/implementations/AppThemeApi/AppThemeSelector.d.ts:15:5 - (ae-undocumented) Missing documentation for "getInstalledThemes". -// src/apis/implementations/AppThemeApi/AppThemeSelector.d.ts:16:5 - (ae-undocumented) Missing documentation for "activeThemeId$". -// src/apis/implementations/AppThemeApi/AppThemeSelector.d.ts:17:5 - (ae-undocumented) Missing documentation for "getActiveThemeId". -// src/apis/implementations/AppThemeApi/AppThemeSelector.d.ts:18:5 - (ae-undocumented) Missing documentation for "setActiveThemeId". -// src/apis/implementations/DiscoveryApi/FrontendHostDiscovery.d.ts:37:5 - (ae-undocumented) Missing documentation for "getBaseUrl". -// src/apis/implementations/DiscoveryApi/UrlPatternDiscovery.d.ts:19:5 - (ae-undocumented) Missing documentation for "getBaseUrl". -// src/apis/implementations/ErrorApi/ErrorAlerter.d.ts:12:5 - (ae-undocumented) Missing documentation for "post". -// src/apis/implementations/ErrorApi/ErrorAlerter.d.ts:13:5 - (ae-undocumented) Missing documentation for "error$". -// src/apis/implementations/ErrorApi/ErrorApiForwarder.d.ts:10:5 - (ae-undocumented) Missing documentation for "post". -// src/apis/implementations/ErrorApi/ErrorApiForwarder.d.ts:11:5 - (ae-undocumented) Missing documentation for "error$". -// src/apis/implementations/FeatureFlagsApi/LocalStorageFeatureFlags.d.ts:12:5 - (ae-undocumented) Missing documentation for "registerFlag". -// src/apis/implementations/FeatureFlagsApi/LocalStorageFeatureFlags.d.ts:13:5 - (ae-undocumented) Missing documentation for "getRegisteredFlags". -// src/apis/implementations/FeatureFlagsApi/LocalStorageFeatureFlags.d.ts:14:5 - (ae-undocumented) Missing documentation for "isActive". -// src/apis/implementations/FeatureFlagsApi/LocalStorageFeatureFlags.d.ts:15:5 - (ae-undocumented) Missing documentation for "save". -// src/apis/implementations/OAuthRequestApi/OAuthRequestManager.d.ts:16:5 - (ae-undocumented) Missing documentation for "createAuthRequester". -// src/apis/implementations/OAuthRequestApi/OAuthRequestManager.d.ts:18:5 - (ae-undocumented) Missing documentation for "authRequest$". -// src/apis/implementations/StorageApi/WebStorage.d.ts:14:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/StorageApi/WebStorage.d.ts:19:5 - (ae-undocumented) Missing documentation for "get". -// src/apis/implementations/StorageApi/WebStorage.d.ts:20:5 - (ae-undocumented) Missing documentation for "snapshot". -// src/apis/implementations/StorageApi/WebStorage.d.ts:21:5 - (ae-undocumented) Missing documentation for "forBucket". -// src/apis/implementations/StorageApi/WebStorage.d.ts:22:5 - (ae-undocumented) Missing documentation for "set". -// src/apis/implementations/StorageApi/WebStorage.d.ts:23:5 - (ae-undocumented) Missing documentation for "remove". -// src/apis/implementations/StorageApi/WebStorage.d.ts:24:5 - (ae-undocumented) Missing documentation for "observe$". -// src/apis/implementations/auth/atlassian/AtlassianAuth.d.ts:9:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/bitbucket/BitbucketAuth.d.ts:18:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/bitbucketServer/BitbucketServerAuth.d.ts:17:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/github/GithubAuth.d.ts:9:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/gitlab/GitlabAuth.d.ts:9:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/google/GoogleAuth.d.ts:9:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/microsoft/MicrosoftAuth.d.ts:17:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/microsoft/MicrosoftAuth.d.ts:22:5 - (ae-undocumented) Missing documentation for "getAccessToken". -// src/apis/implementations/auth/microsoft/MicrosoftAuth.d.ts:23:5 - (ae-undocumented) Missing documentation for "getIdToken". -// src/apis/implementations/auth/microsoft/MicrosoftAuth.d.ts:24:5 - (ae-undocumented) Missing documentation for "getProfile". -// src/apis/implementations/auth/microsoft/MicrosoftAuth.d.ts:25:5 - (ae-undocumented) Missing documentation for "getBackstageIdentity". -// src/apis/implementations/auth/microsoft/MicrosoftAuth.d.ts:26:5 - (ae-undocumented) Missing documentation for "signIn". -// src/apis/implementations/auth/microsoft/MicrosoftAuth.d.ts:27:5 - (ae-undocumented) Missing documentation for "signOut". -// src/apis/implementations/auth/microsoft/MicrosoftAuth.d.ts:28:5 - (ae-undocumented) Missing documentation for "sessionState$". -// src/apis/implementations/auth/oauth2/OAuth2.d.ts:33:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/oauth2/OAuth2.d.ts:37:5 - (ae-undocumented) Missing documentation for "signIn". -// src/apis/implementations/auth/oauth2/OAuth2.d.ts:38:5 - (ae-undocumented) Missing documentation for "signOut". -// src/apis/implementations/auth/oauth2/OAuth2.d.ts:39:5 - (ae-undocumented) Missing documentation for "sessionState$". -// src/apis/implementations/auth/oauth2/OAuth2.d.ts:40:5 - (ae-undocumented) Missing documentation for "getAccessToken". -// src/apis/implementations/auth/oauth2/OAuth2.d.ts:41:5 - (ae-undocumented) Missing documentation for "getIdToken". -// src/apis/implementations/auth/oauth2/OAuth2.d.ts:42:5 - (ae-undocumented) Missing documentation for "getBackstageIdentity". -// src/apis/implementations/auth/oauth2/OAuth2.d.ts:43:5 - (ae-undocumented) Missing documentation for "getProfile". -// src/apis/implementations/auth/okta/OktaAuth.d.ts:9:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/onelogin/OneLoginAuth.d.ts:19:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/saml/SamlAuth.d.ts:15:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/implementations/auth/saml/SamlAuth.d.ts:16:5 - (ae-undocumented) Missing documentation for "sessionState$". -// src/apis/implementations/auth/saml/SamlAuth.d.ts:18:5 - (ae-undocumented) Missing documentation for "signIn". -// src/apis/implementations/auth/saml/SamlAuth.d.ts:19:5 - (ae-undocumented) Missing documentation for "signOut". -// src/apis/implementations/auth/saml/SamlAuth.d.ts:20:5 - (ae-undocumented) Missing documentation for "getBackstageIdentity". -// src/apis/implementations/auth/saml/SamlAuth.d.ts:21:5 - (ae-undocumented) Missing documentation for "getProfile". -// src/apis/implementations/auth/vmwareCloud/VMwareCloudAuth.d.ts:9:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/system/ApiFactoryRegistry.d.ts:29:5 - (ae-undocumented) Missing documentation for "get". -// src/apis/system/ApiFactoryRegistry.d.ts:32:5 - (ae-undocumented) Missing documentation for "getAllApis". -// src/apis/system/ApiResolver.d.ts:18:5 - (ae-undocumented) Missing documentation for "get". -// src/apis/system/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "ApiFactoryHolder". -// src/app/AppRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "children". ``` diff --git a/packages/core-compat-api/report.api.md b/packages/core-compat-api/report.api.md index e6971975b2..ddb3bc6bf4 100644 --- a/packages/core-compat-api/report.api.md +++ b/packages/core-compat-api/report.api.md @@ -113,12 +113,5 @@ export type ToNewRouteRef = ? ExternalRouteRef_2 : never; -// Warnings were encountered during analysis: -// -// src/apis/implementations/AnalyticsApi/NoOpAnalyticsApi.d.ts:9:5 - (ae-undocumented) Missing documentation for "captureEvent". -// src/convertLegacyApp.d.ts:4:1 - (ae-undocumented) Missing documentation for "convertLegacyApp". -// src/convertLegacyPageExtension.d.ts:4:1 - (ae-undocumented) Missing documentation for "convertLegacyPageExtension". -// src/convertLegacyPlugin.d.ts:4:1 - (ae-undocumented) Missing documentation for "convertLegacyPlugin". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/core-components/report-alpha.api.md b/packages/core-components/report-alpha.api.md index ea44f92093..1f4b999232 100644 --- a/packages/core-components/report-alpha.api.md +++ b/packages/core-components/report-alpha.api.md @@ -54,9 +54,5 @@ export const coreComponentsTranslationRef: TranslationRef< } >; -// Warnings were encountered during analysis: -// -// src/translation.d.ts:2:22 - (ae-undocumented) Missing documentation for "coreComponentsTranslationRef". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/core-components/report.api.md b/packages/core-components/report.api.md index 7ffb430c7f..b9414eb897 100644 --- a/packages/core-components/report.api.md +++ b/packages/core-components/report.api.md @@ -1578,188 +1578,9 @@ export type WarningPanelClassKey = // Warnings were encountered during analysis: // -// src/components/AutoLogout/AutoLogout.d.ts:3:1 - (ae-undocumented) Missing documentation for "AutoLogoutProps". -// src/components/Avatar/Avatar.d.ts:3:1 - (ae-undocumented) Missing documentation for "AvatarClassKey". -// src/components/DependencyGraph/DefaultLabel.d.ts:4:1 - (ae-undocumented) Missing documentation for "DependencyGraphDefaultLabelClassKey". -// src/components/DependencyGraph/DefaultNode.d.ts:4:1 - (ae-undocumented) Missing documentation for "DependencyGraphDefaultNodeClassKey". -// src/components/DependencyGraph/Edge.d.ts:15:1 - (ae-undocumented) Missing documentation for "DependencyGraphEdgeClassKey". -// src/components/DependencyGraph/Node.d.ts:5:1 - (ae-undocumented) Missing documentation for "DependencyGraphNodeClassKey". // src/components/DependencyGraph/types.d.ts:22:9 - (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/core-components" does not have an export "DependencyNode" // src/components/DependencyGraph/types.d.ts:26:9 - (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/core-components" does not have an export "DependencyNode" -// src/components/DependencyGraph/types.d.ts:143:9 - (ae-undocumented) Missing documentation for "LEFT". -// src/components/DependencyGraph/types.d.ts:144:9 - (ae-undocumented) Missing documentation for "RIGHT". -// src/components/DependencyGraph/types.d.ts:145:9 - (ae-undocumented) Missing documentation for "CENTER". -// src/components/DismissableBanner/DismissableBanner.d.ts:3:1 - (ae-undocumented) Missing documentation for "DismissableBannerClassKey". -// src/components/DismissableBanner/DismissableBanner.d.ts:8:1 - (ae-undocumented) Missing documentation for "DismissbleBannerClassKey". -// src/components/DismissableBanner/DismissableBanner.d.ts:16:22 - (ae-undocumented) Missing documentation for "DismissableBanner". -// src/components/EmptyState/EmptyState.d.ts:3:1 - (ae-undocumented) Missing documentation for "EmptyStateClassKey". -// src/components/EmptyState/EmptyStateImage.d.ts:6:1 - (ae-undocumented) Missing documentation for "EmptyStateImageClassKey". -// src/components/EmptyState/MissingAnnotationEmptyState.d.ts:10:1 - (ae-undocumented) Missing documentation for "MissingAnnotationEmptyState". -// src/components/ErrorPanel/ErrorPanel.d.ts:3:1 - (ae-undocumented) Missing documentation for "ErrorPanelClassKey". -// src/components/ErrorPanel/ErrorPanel.d.ts:5:1 - (ae-undocumented) Missing documentation for "ErrorPanelProps". -// src/components/FavoriteToggle/FavoriteToggle.d.ts:6:1 - (ae-undocumented) Missing documentation for "FavoriteToggleIconClassKey". -// src/components/FeatureDiscovery/FeatureCalloutCircular.d.ts:3:1 - (ae-undocumented) Missing documentation for "FeatureCalloutCircleClassKey". -// src/components/HeaderIconLinkRow/HeaderIconLinkRow.d.ts:4:1 - (ae-undocumented) Missing documentation for "HeaderIconLinkRowClassKey". -// src/components/HeaderIconLinkRow/IconLinkVertical.d.ts:2:1 - (ae-undocumented) Missing documentation for "IconLinkVerticalProps". -// src/components/HeaderIconLinkRow/IconLinkVertical.d.ts:12:1 - (ae-undocumented) Missing documentation for "IconLinkVerticalClassKey". -// src/components/HeaderIconLinkRow/IconLinkVertical.d.ts:14:1 - (ae-undocumented) Missing documentation for "IconLinkVertical". -// src/components/HorizontalScrollGrid/HorizontalScrollGrid.d.ts:8:1 - (ae-undocumented) Missing documentation for "HorizontalScrollGridClassKey". -// src/components/Lifecycle/Lifecycle.d.ts:7:1 - (ae-undocumented) Missing documentation for "LifecycleClassKey". -// src/components/Lifecycle/Lifecycle.d.ts:8:1 - (ae-undocumented) Missing documentation for "Lifecycle". -// src/components/Link/Link.d.ts:6:1 - (ae-undocumented) Missing documentation for "LinkClassKey". -// src/components/Link/Link.d.ts:8:1 - (ae-undocumented) Missing documentation for "LinkProps". -// src/components/LinkButton/LinkButton.d.ts:24:22 - (ae-undocumented) Missing documentation for "Button". -// src/components/LinkButton/LinkButton.d.ts:29:1 - (ae-undocumented) Missing documentation for "ButtonProps". -// src/components/MarkdownContent/MarkdownContent.d.ts:3:1 - (ae-undocumented) Missing documentation for "MarkdownContentClassKey". -// src/components/OAuthRequestDialog/LoginRequestListItem.d.ts:3:1 - (ae-undocumented) Missing documentation for "LoginRequestListItemClassKey". -// src/components/OAuthRequestDialog/OAuthRequestDialog.d.ts:2:1 - (ae-undocumented) Missing documentation for "OAuthRequestDialogClassKey". -// src/components/OAuthRequestDialog/OAuthRequestDialog.d.ts:3:1 - (ae-undocumented) Missing documentation for "OAuthRequestDialog". -// src/components/OverflowTooltip/OverflowTooltip.d.ts:9:1 - (ae-undocumented) Missing documentation for "OverflowTooltipClassKey". -// src/components/OverflowTooltip/OverflowTooltip.d.ts:10:1 - (ae-undocumented) Missing documentation for "OverflowTooltip". -// src/components/Progress/Progress.d.ts:3:1 - (ae-undocumented) Missing documentation for "Progress". -// src/components/ProgressBars/Gauge.d.ts:4:1 - (ae-undocumented) Missing documentation for "GaugeClassKey". -// src/components/ProgressBars/Gauge.d.ts:6:1 - (ae-undocumented) Missing documentation for "GaugeProps". -// src/components/ProgressBars/Gauge.d.ts:19:1 - (ae-undocumented) Missing documentation for "GaugePropsGetColorOptions". -// src/components/ProgressBars/Gauge.d.ts:26:1 - (ae-undocumented) Missing documentation for "GaugePropsGetColor". -// src/components/ProgressBars/GaugeCard.d.ts:20:1 - (ae-undocumented) Missing documentation for "GaugeCardClassKey". -// src/components/ProgressBars/LinearGauge.d.ts:11:1 - (ae-undocumented) Missing documentation for "LinearGauge". -// src/components/ResponseErrorPanel/ResponseErrorPanel.d.ts:3:1 - (ae-undocumented) Missing documentation for "ResponseErrorPanelClassKey". -// src/components/Select/Select.d.ts:3:1 - (ae-undocumented) Missing documentation for "SelectInputBaseClassKey". -// src/components/Select/Select.d.ts:5:1 - (ae-undocumented) Missing documentation for "SelectClassKey". -// src/components/Select/Select.d.ts:7:1 - (ae-undocumented) Missing documentation for "SelectItem". -// src/components/Select/Select.d.ts:12:1 - (ae-undocumented) Missing documentation for "SelectedItems". -// src/components/Select/Select.d.ts:27:1 - (ae-undocumented) Missing documentation for "SelectComponent". -// src/components/Select/static/ClosedDropdown.d.ts:3:1 - (ae-undocumented) Missing documentation for "ClosedDropdownClassKey". -// src/components/Select/static/OpenedDropdown.d.ts:2:1 - (ae-undocumented) Missing documentation for "OpenedDropdownClassKey". -// src/components/SimpleStepper/SimpleStepper.d.ts:16:1 - (ae-undocumented) Missing documentation for "SimpleStepper". -// src/components/SimpleStepper/SimpleStepperFooter.d.ts:3:1 - (ae-undocumented) Missing documentation for "SimpleStepperFooterClassKey". -// src/components/SimpleStepper/SimpleStepperStep.d.ts:3:1 - (ae-undocumented) Missing documentation for "SimpleStepperStepClassKey". -// src/components/SimpleStepper/SimpleStepperStep.d.ts:4:1 - (ae-undocumented) Missing documentation for "SimpleStepperStep". -// src/components/Status/Status.d.ts:2:1 - (ae-undocumented) Missing documentation for "StatusClassKey". -// src/components/Status/Status.d.ts:3:1 - (ae-undocumented) Missing documentation for "StatusOK". -// src/components/Status/Status.d.ts:4:1 - (ae-undocumented) Missing documentation for "StatusWarning". -// src/components/Status/Status.d.ts:5:1 - (ae-undocumented) Missing documentation for "StatusError". -// src/components/Status/Status.d.ts:6:1 - (ae-undocumented) Missing documentation for "StatusPending". -// src/components/Status/Status.d.ts:7:1 - (ae-undocumented) Missing documentation for "StatusRunning". -// src/components/Status/Status.d.ts:8:1 - (ae-undocumented) Missing documentation for "StatusAborted". -// src/components/StructuredMetadataTable/MetadataTable.d.ts:3:1 - (ae-undocumented) Missing documentation for "MetadataTableTitleCellClassKey". -// src/components/StructuredMetadataTable/MetadataTable.d.ts:4:1 - (ae-undocumented) Missing documentation for "MetadataTableCellClassKey". -// src/components/StructuredMetadataTable/MetadataTable.d.ts:5:1 - (ae-undocumented) Missing documentation for "MetadataTableListClassKey". -// src/components/StructuredMetadataTable/MetadataTable.d.ts:6:1 - (ae-undocumented) Missing documentation for "MetadataTableListItemClassKey". -// src/components/StructuredMetadataTable/StructuredMetadataTable.d.ts:2:1 - (ae-undocumented) Missing documentation for "StructuredMetadataTableListClassKey". -// src/components/StructuredMetadataTable/StructuredMetadataTable.d.ts:3:1 - (ae-undocumented) Missing documentation for "StructuredMetadataTableNestedListClassKey". -// src/components/StructuredMetadataTable/StructuredMetadataTable.d.ts:5:1 - (ae-undocumented) Missing documentation for "StructuredMetadataTableProps". -// src/components/StructuredMetadataTable/StructuredMetadataTable.d.ts:6:5 - (ae-undocumented) Missing documentation for "metadata". -// src/components/StructuredMetadataTable/StructuredMetadataTable.d.ts:9:5 - (ae-undocumented) Missing documentation for "dense". -// src/components/StructuredMetadataTable/StructuredMetadataTable.d.ts:10:5 - (ae-undocumented) Missing documentation for "options". -// src/components/StructuredMetadataTable/StructuredMetadataTable.d.ts:21:1 - (ae-undocumented) Missing documentation for "StructuredMetadataTable". -// src/components/SupportButton/SupportButton.d.ts:8:1 - (ae-undocumented) Missing documentation for "SupportButtonClassKey". -// src/components/SupportButton/SupportButton.d.ts:9:1 - (ae-undocumented) Missing documentation for "SupportButton". -// src/components/TabbedLayout/RoutedTabs.d.ts:8:1 - (ae-undocumented) Missing documentation for "RoutedTabs". // src/components/TabbedLayout/RoutedTabs.d.ts:9:5 - (ae-forgotten-export) The symbol "SubRoute_2" needs to be exported by the entry point index.d.ts -// src/components/TabbedLayout/TabbedLayout.d.ts:29:1 - (ae-undocumented) Missing documentation for "TabbedLayout". -// src/components/TabbedLayout/TabbedLayout.d.ts:30:9 - (ae-undocumented) Missing documentation for "Route". -// src/components/Table/Filters.d.ts:3:1 - (ae-undocumented) Missing documentation for "TableFiltersClassKey". -// src/components/Table/SubvalueCell.d.ts:2:1 - (ae-undocumented) Missing documentation for "SubvalueCellClassKey". -// src/components/Table/SubvalueCell.d.ts:7:1 - (ae-undocumented) Missing documentation for "SubvalueCell". -// src/components/Table/Table.d.ts:4:1 - (ae-undocumented) Missing documentation for "TableHeaderClassKey". -// src/components/Table/Table.d.ts:5:1 - (ae-undocumented) Missing documentation for "TableToolbarClassKey". -// src/components/Table/Table.d.ts:7:1 - (ae-undocumented) Missing documentation for "FiltersContainerClassKey". -// src/components/Table/Table.d.ts:8:1 - (ae-undocumented) Missing documentation for "TableClassKey". -// src/components/Table/Table.d.ts:9:1 - (ae-undocumented) Missing documentation for "TableColumn". -// src/components/Table/Table.d.ts:10:5 - (ae-undocumented) Missing documentation for "highlight". -// src/components/Table/Table.d.ts:11:5 - (ae-undocumented) Missing documentation for "width". -// src/components/Table/Table.d.ts:13:1 - (ae-undocumented) Missing documentation for "TableFilter". -// src/components/Table/Table.d.ts:17:1 - (ae-undocumented) Missing documentation for "TableState". // src/components/Table/Table.d.ts:20:5 - (ae-forgotten-export) The symbol "SelectedFilters" needs to be exported by the entry point index.d.ts -// src/components/Table/Table.d.ts:22:1 - (ae-undocumented) Missing documentation for "TableProps". -// src/components/Table/Table.d.ts:23:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/Table/Table.d.ts:24:5 - (ae-undocumented) Missing documentation for "subtitle". -// src/components/Table/Table.d.ts:25:5 - (ae-undocumented) Missing documentation for "filters". -// src/components/Table/Table.d.ts:26:5 - (ae-undocumented) Missing documentation for "initialState". -// src/components/Table/Table.d.ts:27:5 - (ae-undocumented) Missing documentation for "emptyContent". -// src/components/Table/Table.d.ts:28:5 - (ae-undocumented) Missing documentation for "isLoading". -// src/components/Table/Table.d.ts:29:5 - (ae-undocumented) Missing documentation for "onStateChange". -// src/components/Table/Table.d.ts:31:1 - (ae-undocumented) Missing documentation for "TableOptions". -// src/components/Table/Table.d.ts:44:1 - (ae-undocumented) Missing documentation for "Table". -// src/components/Table/Table.d.ts:45:1 - (ae-undocumented) Missing documentation for "Table". -// src/components/Table/Table.d.ts:46:9 - (ae-undocumented) Missing documentation for "icons". -// src/components/TrendLine/TrendLine.d.ts:3:1 - (ae-undocumented) Missing documentation for "TrendLine". -// src/components/WarningPanel/WarningPanel.d.ts:2:1 - (ae-undocumented) Missing documentation for "WarningPanelClassKey". -// src/hooks/useQueryParamState.d.ts:2:1 - (ae-undocumented) Missing documentation for "useQueryParamState". -// src/hooks/useSupportConfig.d.ts:1:1 - (ae-undocumented) Missing documentation for "SupportItemLink". -// src/hooks/useSupportConfig.d.ts:5:1 - (ae-undocumented) Missing documentation for "SupportItem". -// src/hooks/useSupportConfig.d.ts:10:1 - (ae-undocumented) Missing documentation for "SupportConfig". -// src/hooks/useSupportConfig.d.ts:14:1 - (ae-undocumented) Missing documentation for "useSupportConfig". -// src/icons/icons.d.ts:27:1 - (ae-undocumented) Missing documentation for "CatalogIcon". -// src/icons/icons.d.ts:29:1 - (ae-undocumented) Missing documentation for "ChatIcon". -// src/icons/icons.d.ts:31:1 - (ae-undocumented) Missing documentation for "DashboardIcon". -// src/icons/icons.d.ts:33:1 - (ae-undocumented) Missing documentation for "DocsIcon". -// src/icons/icons.d.ts:35:1 - (ae-undocumented) Missing documentation for "EmailIcon". -// src/icons/icons.d.ts:37:1 - (ae-undocumented) Missing documentation for "GitHubIcon". -// src/icons/icons.d.ts:39:1 - (ae-undocumented) Missing documentation for "GroupIcon". -// src/icons/icons.d.ts:41:1 - (ae-undocumented) Missing documentation for "HelpIcon". -// src/icons/icons.d.ts:43:1 - (ae-undocumented) Missing documentation for "UserIcon". -// src/icons/icons.d.ts:45:1 - (ae-undocumented) Missing documentation for "WarningIcon". -// src/icons/icons.d.ts:47:1 - (ae-undocumented) Missing documentation for "StarIcon". -// src/icons/icons.d.ts:49:1 - (ae-undocumented) Missing documentation for "UnstarredIcon". -// src/layout/BottomLink/BottomLink.d.ts:3:1 - (ae-undocumented) Missing documentation for "BottomLinkClassKey". -// src/layout/BottomLink/BottomLink.d.ts:5:1 - (ae-undocumented) Missing documentation for "BottomLinkProps". -// src/layout/Breadcrumbs/Breadcrumbs.d.ts:5:1 - (ae-undocumented) Missing documentation for "BreadcrumbsClickableTextClassKey". -// src/layout/Breadcrumbs/Breadcrumbs.d.ts:7:1 - (ae-undocumented) Missing documentation for "BreadcrumbsStyledBoxClassKey". -// src/layout/Breadcrumbs/Breadcrumbs.d.ts:9:1 - (ae-undocumented) Missing documentation for "BreadcrumbsCurrentPageClassKey". -// src/layout/Content/Content.d.ts:3:1 - (ae-undocumented) Missing documentation for "BackstageContentClassKey". -// src/layout/ContentHeader/ContentHeader.d.ts:6:1 - (ae-undocumented) Missing documentation for "ContentHeaderClassKey". -// src/layout/ErrorBoundary/ErrorBoundary.d.ts:7:1 - (ae-undocumented) Missing documentation for "ErrorBoundaryProps". // src/layout/ErrorBoundary/ErrorBoundary.d.ts:8:5 - (ae-forgotten-export) The symbol "SlackChannel" needs to be exported by the entry point index.d.ts -// src/layout/ErrorBoundary/ErrorBoundary.d.ts:16:22 - (ae-undocumented) Missing documentation for "ErrorBoundary". -// src/layout/ErrorPage/ErrorPage.d.ts:10:1 - (ae-undocumented) Missing documentation for "ErrorPageClassKey". -// src/layout/ErrorPage/MicDrop.d.ts:2:1 - (ae-undocumented) Missing documentation for "MicDropClassKey". -// src/layout/ErrorPage/StackDetails.d.ts:6:1 - (ae-undocumented) Missing documentation for "StackDetailsClassKey". -// src/layout/Header/Header.d.ts:3:1 - (ae-undocumented) Missing documentation for "HeaderClassKey". -// src/layout/HeaderActionMenu/HeaderActionMenu.d.ts:6:1 - (ae-undocumented) Missing documentation for "HeaderActionMenuItem". -// src/layout/HeaderActionMenu/HeaderActionMenu.d.ts:16:1 - (ae-undocumented) Missing documentation for "HeaderActionMenuProps". -// src/layout/HeaderActionMenu/HeaderActionMenu.d.ts:22:1 - (ae-undocumented) Missing documentation for "HeaderActionMenu". -// src/layout/HeaderLabel/HeaderLabel.d.ts:3:1 - (ae-undocumented) Missing documentation for "HeaderLabelClassKey". -// src/layout/HeaderTabs/HeaderTabs.d.ts:4:1 - (ae-undocumented) Missing documentation for "HeaderTabsClassKey". -// src/layout/HeaderTabs/HeaderTabs.d.ts:5:1 - (ae-undocumented) Missing documentation for "Tab". -// src/layout/InfoCard/InfoCard.d.ts:6:1 - (ae-undocumented) Missing documentation for "InfoCardClassKey". -// src/layout/InfoCard/InfoCard.d.ts:8:1 - (ae-undocumented) Missing documentation for "CardActionsTopRightClassKey". -// src/layout/InfoCard/InfoCard.d.ts:10:1 - (ae-undocumented) Missing documentation for "InfoCardVariants". -// src/layout/ItemCard/ItemCardGrid.d.ts:4:1 - (ae-undocumented) Missing documentation for "ItemCardGridClassKey". -// src/layout/ItemCard/ItemCardGrid.d.ts:7:1 - (ae-undocumented) Missing documentation for "ItemCardGridProps". -// src/layout/ItemCard/ItemCardHeader.d.ts:4:1 - (ae-undocumented) Missing documentation for "ItemCardHeaderClassKey". -// src/layout/ItemCard/ItemCardHeader.d.ts:7:1 - (ae-undocumented) Missing documentation for "ItemCardHeaderProps". -// src/layout/Page/Page.d.ts:2:1 - (ae-undocumented) Missing documentation for "PageClassKey". -// src/layout/Page/Page.d.ts:7:1 - (ae-undocumented) Missing documentation for "Page". -// src/layout/Page/PageWithHeader.d.ts:6:1 - (ae-undocumented) Missing documentation for "PageWithHeader". -// src/layout/Sidebar/Bar.d.ts:4:1 - (ae-undocumented) Missing documentation for "SidebarClassKey". -// src/layout/Sidebar/Bar.d.ts:6:1 - (ae-undocumented) Missing documentation for "SidebarProps". -// src/layout/Sidebar/Items.d.ts:6:1 - (ae-undocumented) Missing documentation for "SidebarItemClassKey". -// src/layout/Sidebar/Items.d.ts:53:1 - (ae-undocumented) Missing documentation for "SidebarSearchField". -// src/layout/Sidebar/Items.d.ts:54:1 - (ae-undocumented) Missing documentation for "SidebarSpaceClassKey". -// src/layout/Sidebar/Items.d.ts:55:22 - (ae-undocumented) Missing documentation for "SidebarSpace". -// src/layout/Sidebar/Items.d.ts:56:1 - (ae-undocumented) Missing documentation for "SidebarSpacerClassKey". -// src/layout/Sidebar/Items.d.ts:57:22 - (ae-undocumented) Missing documentation for "SidebarSpacer". -// src/layout/Sidebar/Items.d.ts:58:1 - (ae-undocumented) Missing documentation for "SidebarDividerClassKey". -// src/layout/Sidebar/Items.d.ts:59:22 - (ae-undocumented) Missing documentation for "SidebarDivider". -// src/layout/Sidebar/Items.d.ts:60:22 - (ae-undocumented) Missing documentation for "SidebarScrollWrapper". -// src/layout/Sidebar/Page.d.ts:2:1 - (ae-undocumented) Missing documentation for "SidebarPageClassKey". -// src/layout/Sidebar/Page.d.ts:11:1 - (ae-undocumented) Missing documentation for "SidebarPage". -// src/layout/Sidebar/SidebarSubmenu.d.ts:3:1 - (ae-undocumented) Missing documentation for "SidebarSubmenuClassKey". -// src/layout/Sidebar/SidebarSubmenuItem.d.ts:4:1 - (ae-undocumented) Missing documentation for "SidebarSubmenuItemClassKey". -// src/layout/Sidebar/config.d.ts:3:1 - (ae-undocumented) Missing documentation for "SidebarOptions". -// src/layout/Sidebar/config.d.ts:8:1 - (ae-undocumented) Missing documentation for "SubmenuOptions". -// src/layout/Sidebar/config.d.ts:12:22 - (ae-undocumented) Missing documentation for "sidebarConfig". -// src/layout/Sidebar/config.d.ts:52:22 - (ae-undocumented) Missing documentation for "SIDEBAR_INTRO_LOCAL_STORAGE". -// src/layout/SignInPage/SignInPage.d.ts:26:1 - (ae-undocumented) Missing documentation for "SignInPage". -// src/layout/SignInPage/customProvider.d.ts:3:1 - (ae-undocumented) Missing documentation for "CustomProviderClassKey". -// src/layout/SignInPage/styles.d.ts:2:1 - (ae-undocumented) Missing documentation for "SignInPageClassKey". -// src/layout/SignInPage/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "SignInProviderConfig". -// src/layout/SignInPage/types.d.ts:10:1 - (ae-undocumented) Missing documentation for "IdentityProviders". -// src/layout/TabbedCard/TabbedCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "TabbedCardClassKey". -// src/layout/TabbedCard/TabbedCard.d.ts:7:1 - (ae-undocumented) Missing documentation for "BoldHeaderClassKey". -// src/layout/TabbedCard/TabbedCard.d.ts:18:1 - (ae-undocumented) Missing documentation for "TabbedCard". -// src/layout/TabbedCard/TabbedCard.d.ts:20:1 - (ae-undocumented) Missing documentation for "CardTabClassKey". -// src/overridableComponents.d.ts:83:1 - (ae-undocumented) Missing documentation for "BackstageOverrides". ``` diff --git a/packages/core-plugin-api/report-alpha.api.md b/packages/core-plugin-api/report-alpha.api.md index 260e0365a7..c0f0d02535 100644 --- a/packages/core-plugin-api/report-alpha.api.md +++ b/packages/core-plugin-api/report-alpha.api.md @@ -239,36 +239,5 @@ export const useTranslationRef: < t: TranslationFunction; }; -// Warnings were encountered during analysis: -// -// src/apis/definitions/AppLanguageApi.d.ts:4:1 - (ae-undocumented) Missing documentation for "AppLanguageApi". -// src/apis/definitions/AppLanguageApi.d.ts:19:22 - (ae-undocumented) Missing documentation for "appLanguageApiRef". -// src/apis/definitions/TranslationApi.d.ts:228:1 - (ae-undocumented) Missing documentation for "TranslationFunction". -// src/apis/definitions/TranslationApi.d.ts:231:5 - (ae-undocumented) Missing documentation for "__call". -// src/apis/definitions/TranslationApi.d.ts:234:1 - (ae-undocumented) Missing documentation for "TranslationSnapshot". -// src/apis/definitions/TranslationApi.d.ts:243:1 - (ae-undocumented) Missing documentation for "TranslationApi". -// src/apis/definitions/TranslationApi.d.ts:254:22 - (ae-undocumented) Missing documentation for "translationApiRef". -// src/translation/TranslationMessages.d.ts:17:5 - (ae-undocumented) Missing documentation for "$$type". -// src/translation/TranslationMessages.d.ts:33:5 - (ae-undocumented) Missing documentation for "ref". -// src/translation/TranslationMessages.d.ts:34:5 - (ae-undocumented) Missing documentation for "full". -// src/translation/TranslationMessages.d.ts:35:5 - (ae-undocumented) Missing documentation for "messages". -// src/translation/TranslationRef.d.ts:2:1 - (ae-undocumented) Missing documentation for "TranslationRef". -// src/translation/TranslationRef.d.ts:7:5 - (ae-undocumented) Missing documentation for "$$type". -// src/translation/TranslationRef.d.ts:8:5 - (ae-undocumented) Missing documentation for "id". -// src/translation/TranslationRef.d.ts:9:5 - (ae-undocumented) Missing documentation for "T". -// src/translation/TranslationRef.d.ts:30:1 - (ae-undocumented) Missing documentation for "TranslationRefOptions". -// src/translation/TranslationRef.d.ts:37:5 - (ae-undocumented) Missing documentation for "id". -// src/translation/TranslationRef.d.ts:38:5 - (ae-undocumented) Missing documentation for "messages". -// src/translation/TranslationRef.d.ts:39:5 - (ae-undocumented) Missing documentation for "translations". -// src/translation/TranslationRef.d.ts:42:1 - (ae-undocumented) Missing documentation for "createTranslationRef". -// src/translation/TranslationResource.d.ts:3:1 - (ae-undocumented) Missing documentation for "TranslationResource". -// src/translation/TranslationResource.d.ts:4:5 - (ae-undocumented) Missing documentation for "$$type". -// src/translation/TranslationResource.d.ts:5:5 - (ae-undocumented) Missing documentation for "id". -// src/translation/TranslationResource.d.ts:8:1 - (ae-undocumented) Missing documentation for "TranslationResourceOptions". -// src/translation/TranslationResource.d.ts:17:5 - (ae-undocumented) Missing documentation for "ref". -// src/translation/TranslationResource.d.ts:18:5 - (ae-undocumented) Missing documentation for "translations". -// src/translation/TranslationResource.d.ts:21:1 - (ae-undocumented) Missing documentation for "createTranslationResource". -// src/translation/useTranslationRef.d.ts:4:22 - (ae-undocumented) Missing documentation for "useTranslationRef". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/core-plugin-api/report.api.md b/packages/core-plugin-api/report.api.md index 06333c1fb4..7692d0e8f0 100644 --- a/packages/core-plugin-api/report.api.md +++ b/packages/core-plugin-api/report.api.md @@ -792,8 +792,4 @@ export function withApis( ): React_2.JSX.Element; displayName: string; }; - -// Warnings were encountered during analysis: -// -// src/routing/types.d.ts:13:1 - (ae-undocumented) Missing documentation for "AnyParams". ``` diff --git a/packages/dev-utils/report.api.md b/packages/dev-utils/report.api.md index 18da50026e..1a7b765fab 100644 --- a/packages/dev-utils/report.api.md +++ b/packages/dev-utils/report.api.md @@ -67,10 +67,4 @@ export const SidebarSignOutButton: (props: { icon?: IconComponent; text?: string; }) => React_2.JSX.Element; - -// Warnings were encountered during analysis: -// -// src/components/EntityGridItem/EntityGridItem.d.ts:5:22 - (ae-undocumented) Missing documentation for "EntityGridItem". -// src/components/SidebarLanguageSwitcher/SidebarLanguageSwitcher.d.ts:3:22 - (ae-undocumented) Missing documentation for "SidebarLanguageSwitcher". -// src/devApp/render.d.ts:8:1 - (ae-undocumented) Missing documentation for "DevAppPageOptions". ``` diff --git a/packages/errors/report.api.md b/packages/errors/report.api.md index d2ba2d22ff..894aac8413 100644 --- a/packages/errors/report.api.md +++ b/packages/errors/report.api.md @@ -155,16 +155,4 @@ export class ServiceUnavailableError extends CustomErrorBase {} // @public export function stringifyError(error: unknown): string; - -// Warnings were encountered during analysis: -// -// src/errors/ResponseError.d.ts:32:5 - (ae-undocumented) Missing documentation for "statusCode". -// src/errors/ResponseError.d.ts:33:5 - (ae-undocumented) Missing documentation for "statusText". -// src/errors/common.d.ts:8:5 - (ae-undocumented) Missing documentation for "name". -// src/errors/common.d.ts:16:5 - (ae-undocumented) Missing documentation for "name". -// src/errors/common.d.ts:24:5 - (ae-undocumented) Missing documentation for "name". -// src/errors/common.d.ts:35:5 - (ae-undocumented) Missing documentation for "name". -// src/errors/common.d.ts:44:5 - (ae-undocumented) Missing documentation for "name". -// src/errors/common.d.ts:52:5 - (ae-undocumented) Missing documentation for "name". -// src/errors/common.d.ts:60:5 - (ae-undocumented) Missing documentation for "name". ``` diff --git a/packages/frontend-app-api/report.api.md b/packages/frontend-app-api/report.api.md index b5e5f801e6..4216f1f823 100644 --- a/packages/frontend-app-api/report.api.md +++ b/packages/frontend-app-api/report.api.md @@ -43,8 +43,4 @@ export type FrontendFeature = | { $$type: '@backstage/BackstagePlugin'; }; - -// Warnings were encountered during analysis: -// -// src/wiring/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "FrontendFeature". ``` diff --git a/packages/frontend-defaults/report.api.md b/packages/frontend-defaults/report.api.md index 4822312294..b99232b784 100644 --- a/packages/frontend-defaults/report.api.md +++ b/packages/frontend-defaults/report.api.md @@ -40,10 +40,4 @@ export interface CreateAppOptions { export function createPublicSignInApp(options?: CreateAppOptions): { createRoot(): React_2.JSX.Element; }; - -// Warnings were encountered during analysis: -// -// src/createApp.d.ts:29:5 - (ae-undocumented) Missing documentation for "features". -// src/createApp.d.ts:30:5 - (ae-undocumented) Missing documentation for "configLoader". -// src/createApp.d.ts:33:5 - (ae-undocumented) Missing documentation for "bindRoutes". ``` diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 5bc2a663d7..acc9efed61 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -1747,106 +1747,4 @@ export { useTranslationRef }; export { vmwareCloudAuthApiRef }; export { withApis }; - -// Warnings were encountered during analysis: -// -// src/apis/definitions/AppTreeApi.d.ts:12:5 - (ae-undocumented) Missing documentation for "id". -// src/apis/definitions/AppTreeApi.d.ts:13:5 - (ae-undocumented) Missing documentation for "attachTo". -// src/apis/definitions/AppTreeApi.d.ts:17:5 - (ae-undocumented) Missing documentation for "extension". -// src/apis/definitions/AppTreeApi.d.ts:18:5 - (ae-undocumented) Missing documentation for "disabled". -// src/apis/definitions/AppTreeApi.d.ts:19:5 - (ae-undocumented) Missing documentation for "config". -// src/apis/definitions/AppTreeApi.d.ts:20:5 - (ae-undocumented) Missing documentation for "source". -// src/apis/definitions/AppTreeApi.d.ts:32:5 - (ae-undocumented) Missing documentation for "attachedTo". -// src/apis/definitions/AppTreeApi.d.ts:36:5 - (ae-undocumented) Missing documentation for "attachments". -// src/apis/definitions/ComponentsApi.d.ts:9:5 - (ae-undocumented) Missing documentation for "getComponent". -// src/apis/definitions/IconsApi.d.ts:8:5 - (ae-undocumented) Missing documentation for "getIcon". -// src/apis/definitions/IconsApi.d.ts:9:5 - (ae-undocumented) Missing documentation for "listIconKeys". -// src/apis/definitions/RouteResolutionApi.d.ts:19:1 - (ae-undocumented) Missing documentation for "RouteResolutionApiResolveOptions". -// src/apis/definitions/RouteResolutionApi.d.ts:29:1 - (ae-undocumented) Missing documentation for "RouteResolutionApi". -// src/apis/definitions/RouteResolutionApi.d.ts:30:5 - (ae-undocumented) Missing documentation for "resolve". -// src/blueprints/IconBundleBlueprint.d.ts:3:22 - (ae-undocumented) Missing documentation for "IconBundleBlueprint". -// src/blueprints/RouterBlueprint.d.ts:3:22 - (ae-undocumented) Missing documentation for "RouterBlueprint". -// src/components/ExtensionBoundary.d.ts:4:1 - (ae-undocumented) Missing documentation for "ExtensionBoundaryProps". -// src/components/ExtensionBoundary.d.ts:5:5 - (ae-undocumented) Missing documentation for "node". -// src/components/ExtensionBoundary.d.ts:12:5 - (ae-undocumented) Missing documentation for "children". -// src/components/ExtensionBoundary.d.ts:15:1 - (ae-undocumented) Missing documentation for "ExtensionBoundary". -// src/components/ExtensionBoundary.d.ts:17:1 - (ae-undocumented) Missing documentation for "ExtensionBoundary". -// src/components/ExtensionBoundary.d.ts:18:5 - (ae-undocumented) Missing documentation for "lazy". -// src/components/coreComponentRefs.d.ts:3:22 - (ae-undocumented) Missing documentation for "coreComponentRefs". -// src/components/createComponentRef.d.ts:2:1 - (ae-undocumented) Missing documentation for "ComponentRef". -// src/components/createComponentRef.d.ts:7:1 - (ae-undocumented) Missing documentation for "createComponentRef". -// src/extensions/createComponentExtension.d.ts:4:1 - (ae-undocumented) Missing documentation for "createComponentExtension". -// src/extensions/createComponentExtension.d.ts:31:1 - (ae-undocumented) Missing documentation for "createComponentExtension". -// src/extensions/createComponentExtension.d.ts:32:11 - (ae-undocumented) Missing documentation for "componentDataRef". -// src/routing/ExternalRouteRef.d.ts:12:5 - (ae-undocumented) Missing documentation for "$$type". -// src/routing/ExternalRouteRef.d.ts:13:5 - (ae-undocumented) Missing documentation for "T". -// src/routing/RouteRef.d.ts:12:5 - (ae-undocumented) Missing documentation for "$$type". -// src/routing/RouteRef.d.ts:13:5 - (ae-undocumented) Missing documentation for "T". -// src/routing/SubRouteRef.d.ts:13:5 - (ae-undocumented) Missing documentation for "$$type". -// src/routing/SubRouteRef.d.ts:14:5 - (ae-undocumented) Missing documentation for "T". -// src/routing/SubRouteRef.d.ts:15:5 - (ae-undocumented) Missing documentation for "path". -// src/schema/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "PortableSchema". -// src/types.d.ts:11:1 - (ae-undocumented) Missing documentation for "CoreProgressProps". -// src/types.d.ts:13:1 - (ae-undocumented) Missing documentation for "CoreNotFoundErrorPageProps". -// src/types.d.ts:17:1 - (ae-undocumented) Missing documentation for "CoreErrorBoundaryFallbackProps". -// src/wiring/coreExtensionData.d.ts:4:22 - (ae-undocumented) Missing documentation for "coreExtensionData". -// src/wiring/createExtension.d.ts:31:1 - (ae-undocumented) Missing documentation for "CreateExtensionOptions". -// src/wiring/createExtension.d.ts:61:1 - (ae-undocumented) Missing documentation for "ExtensionDefinitionParameters". -// src/wiring/createExtension.d.ts:80:1 - (ae-undocumented) Missing documentation for "ExtensionDefinition". -// src/wiring/createExtension.d.ts:134:1 - (ae-undocumented) Missing documentation for "createExtension". -// src/wiring/createExtensionBlueprint.d.ts:12:1 - (ae-undocumented) Missing documentation for "CreateExtensionBlueprintOptions". -// src/wiring/createExtensionBlueprint.d.ts:45:1 - (ae-undocumented) Missing documentation for "ExtensionBlueprintParameters". -// src/wiring/createExtensionBlueprint.d.ts:69:1 - (ae-undocumented) Missing documentation for "ExtensionBlueprint". -// src/wiring/createExtensionBlueprint.d.ts:70:5 - (ae-undocumented) Missing documentation for "dataRefs". -// src/wiring/createExtensionBlueprint.d.ts:71:5 - (ae-undocumented) Missing documentation for "make". -// src/wiring/createExtensionDataContainer.d.ts:3:1 - (ae-undocumented) Missing documentation for "ExtensionDataContainer". -// src/wiring/createExtensionDataRef.d.ts:2:1 - (ae-undocumented) Missing documentation for "ExtensionDataValue". -// src/wiring/createExtensionDataRef.d.ts:8:1 - (ae-undocumented) Missing documentation for "ExtensionDataRef". -// src/wiring/createExtensionDataRef.d.ts:17:1 - (ae-undocumented) Missing documentation for "ExtensionDataRefToValue". -// src/wiring/createExtensionDataRef.d.ts:19:1 - (ae-undocumented) Missing documentation for "AnyExtensionDataRef". -// src/wiring/createExtensionDataRef.d.ts:23:1 - (ae-undocumented) Missing documentation for "ConfigurableExtensionDataRef". -// src/wiring/createExtensionDataRef.d.ts:26:5 - (ae-undocumented) Missing documentation for "optional". -// src/wiring/createExtensionDataRef.d.ts:29:5 - (ae-undocumented) Missing documentation for "__call". -// src/wiring/createExtensionDataRef.d.ts:35:1 - (ae-undocumented) Missing documentation for "createExtensionDataRef". -// src/wiring/createExtensionDataRef.d.ts:37:1 - (ae-undocumented) Missing documentation for "createExtensionDataRef". -// src/wiring/createExtensionInput.d.ts:3:1 - (ae-undocumented) Missing documentation for "ExtensionInput". -// src/wiring/createExtensionInput.d.ts:9:5 - (ae-undocumented) Missing documentation for "$$type". -// src/wiring/createExtensionInput.d.ts:10:5 - (ae-undocumented) Missing documentation for "extensionData". -// src/wiring/createExtensionInput.d.ts:11:5 - (ae-undocumented) Missing documentation for "config". -// src/wiring/createExtensionInput.d.ts:12:5 - (ae-undocumented) Missing documentation for "replaces". -// src/wiring/createExtensionInput.d.ts:18:1 - (ae-undocumented) Missing documentation for "createExtensionInput". -// src/wiring/createFrontendModule.d.ts:4:1 - (ae-undocumented) Missing documentation for "CreateFrontendModuleOptions". -// src/wiring/createFrontendModule.d.ts:5:5 - (ae-undocumented) Missing documentation for "pluginId". -// src/wiring/createFrontendModule.d.ts:6:5 - (ae-undocumented) Missing documentation for "extensions". -// src/wiring/createFrontendModule.d.ts:7:5 - (ae-undocumented) Missing documentation for "featureFlags". -// src/wiring/createFrontendModule.d.ts:10:1 - (ae-undocumented) Missing documentation for "FrontendModule". -// src/wiring/createFrontendModule.d.ts:11:5 - (ae-undocumented) Missing documentation for "$$type". -// src/wiring/createFrontendModule.d.ts:12:5 - (ae-undocumented) Missing documentation for "pluginId". -// src/wiring/createFrontendModule.d.ts:15:1 - (ae-undocumented) Missing documentation for "createFrontendModule". -// src/wiring/createFrontendPlugin.d.ts:5:1 - (ae-undocumented) Missing documentation for "FrontendPlugin". -// src/wiring/createFrontendPlugin.d.ts:10:5 - (ae-undocumented) Missing documentation for "$$type". -// src/wiring/createFrontendPlugin.d.ts:11:5 - (ae-undocumented) Missing documentation for "id". -// src/wiring/createFrontendPlugin.d.ts:12:5 - (ae-undocumented) Missing documentation for "routes". -// src/wiring/createFrontendPlugin.d.ts:13:5 - (ae-undocumented) Missing documentation for "externalRoutes". -// src/wiring/createFrontendPlugin.d.ts:14:5 - (ae-undocumented) Missing documentation for "getExtension". -// src/wiring/createFrontendPlugin.d.ts:15:5 - (ae-undocumented) Missing documentation for "withOverrides". -// src/wiring/createFrontendPlugin.d.ts:20:1 - (ae-undocumented) Missing documentation for "PluginOptions". -// src/wiring/createFrontendPlugin.d.ts:21:5 - (ae-undocumented) Missing documentation for "id". -// src/wiring/createFrontendPlugin.d.ts:22:5 - (ae-undocumented) Missing documentation for "routes". -// src/wiring/createFrontendPlugin.d.ts:23:5 - (ae-undocumented) Missing documentation for "externalRoutes". -// src/wiring/createFrontendPlugin.d.ts:24:5 - (ae-undocumented) Missing documentation for "extensions". -// src/wiring/createFrontendPlugin.d.ts:25:5 - (ae-undocumented) Missing documentation for "featureFlags". -// src/wiring/createFrontendPlugin.d.ts:28:1 - (ae-undocumented) Missing documentation for "createFrontendPlugin". -// src/wiring/resolveExtensionDefinition.d.ts:4:1 - (ae-undocumented) Missing documentation for "Extension". -// src/wiring/resolveExtensionDefinition.d.ts:5:5 - (ae-undocumented) Missing documentation for "$$type". -// src/wiring/resolveExtensionDefinition.d.ts:6:5 - (ae-undocumented) Missing documentation for "id". -// src/wiring/resolveExtensionDefinition.d.ts:7:5 - (ae-undocumented) Missing documentation for "attachTo". -// src/wiring/resolveExtensionDefinition.d.ts:11:5 - (ae-undocumented) Missing documentation for "disabled". -// src/wiring/resolveExtensionDefinition.d.ts:12:5 - (ae-undocumented) Missing documentation for "configSchema". -// src/wiring/resolveInputOverrides.d.ts:5:1 - (ae-undocumented) Missing documentation for "ResolveInputValueOverrides". -// src/wiring/types.d.ts:14:1 - (ae-undocumented) Missing documentation for "AnyRoutes". -// src/wiring/types.d.ts:18:1 - (ae-undocumented) Missing documentation for "AnyExternalRoutes". -// src/wiring/types.d.ts:28:1 - (ae-undocumented) Missing documentation for "ExtensionOverrides". -// src/wiring/types.d.ts:29:5 - (ae-undocumented) Missing documentation for "$$type". -// src/wiring/types.d.ts:35:1 - (ae-undocumented) Missing documentation for "FrontendFeature". ``` diff --git a/packages/frontend-test-utils/report.api.md b/packages/frontend-test-utils/report.api.md index dc37ec4fb4..1982315a35 100644 --- a/packages/frontend-test-utils/report.api.md +++ b/packages/frontend-test-utils/report.api.md @@ -146,20 +146,4 @@ export type TestAppOptions = { }; export { withLogCollector }; - -// Warnings were encountered during analysis: -// -// src/apis/AnalyticsApi/MockAnalyticsApi.d.ts:10:5 - (ae-undocumented) Missing documentation for "captureEvent". -// src/apis/AnalyticsApi/MockAnalyticsApi.d.ts:11:5 - (ae-undocumented) Missing documentation for "getEvents". -// src/app/createExtensionTester.d.ts:4:1 - (ae-undocumented) Missing documentation for "ExtensionQuery". -// src/app/createExtensionTester.d.ts:7:5 - (ae-undocumented) Missing documentation for "node". -// src/app/createExtensionTester.d.ts:8:5 - (ae-undocumented) Missing documentation for "instance". -// src/app/createExtensionTester.d.ts:9:5 - (ae-undocumented) Missing documentation for "get". -// src/app/createExtensionTester.d.ts:12:1 - (ae-undocumented) Missing documentation for "ExtensionTester". -// src/app/createExtensionTester.d.ts:14:5 - (ae-undocumented) Missing documentation for "add". -// src/app/createExtensionTester.d.ts:17:5 - (ae-undocumented) Missing documentation for "get". -// src/app/createExtensionTester.d.ts:18:5 - (ae-undocumented) Missing documentation for "query". -// src/app/createExtensionTester.d.ts:19:5 - (ae-undocumented) Missing documentation for "reactElement". -// src/app/createExtensionTester.d.ts:22:1 - (ae-undocumented) Missing documentation for "createExtensionTester". -// src/deprecated.d.ts:5:1 - (ae-undocumented) Missing documentation for "setupRequestMockHandlers". ``` diff --git a/packages/integration-aws-node/report.api.md b/packages/integration-aws-node/report.api.md index 80b1eee3ba..d9ed25e193 100644 --- a/packages/integration-aws-node/report.api.md +++ b/packages/integration-aws-node/report.api.md @@ -35,9 +35,5 @@ export class DefaultAwsCredentialsManager implements AwsCredentialsManager { ): Promise; } -// Warnings were encountered during analysis: -// -// src/DefaultAwsCredentialsManager.d.ts:12:5 - (ae-undocumented) Missing documentation for "fromConfig". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/integration/report.api.md b/packages/integration/report.api.md index e14a93b9a4..e9b67bb6c1 100644 --- a/packages/integration/report.api.md +++ b/packages/integration/report.api.md @@ -1027,127 +1027,4 @@ export class SingleInstanceGithubCredentialsProvider static create: (config: GithubIntegrationConfig) => GithubCredentialsProvider; getCredentials(opts: { url: string }): Promise; } - -// Warnings were encountered during analysis: -// -// src/ScmIntegrations.d.ts:21:5 - (ae-undocumented) Missing documentation for "awsS3". -// src/ScmIntegrations.d.ts:22:5 - (ae-undocumented) Missing documentation for "awsCodeCommit". -// src/ScmIntegrations.d.ts:23:5 - (ae-undocumented) Missing documentation for "azure". -// src/ScmIntegrations.d.ts:27:5 - (ae-undocumented) Missing documentation for "bitbucket". -// src/ScmIntegrations.d.ts:28:5 - (ae-undocumented) Missing documentation for "bitbucketCloud". -// src/ScmIntegrations.d.ts:29:5 - (ae-undocumented) Missing documentation for "bitbucketServer". -// src/ScmIntegrations.d.ts:30:5 - (ae-undocumented) Missing documentation for "gerrit". -// src/ScmIntegrations.d.ts:31:5 - (ae-undocumented) Missing documentation for "github". -// src/ScmIntegrations.d.ts:32:5 - (ae-undocumented) Missing documentation for "gitlab". -// src/ScmIntegrations.d.ts:33:5 - (ae-undocumented) Missing documentation for "gitea". -// src/ScmIntegrations.d.ts:34:5 - (ae-undocumented) Missing documentation for "harness". -// src/ScmIntegrations.d.ts:43:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/ScmIntegrations.d.ts:45:5 - (ae-undocumented) Missing documentation for "awsS3". -// src/ScmIntegrations.d.ts:46:5 - (ae-undocumented) Missing documentation for "awsCodeCommit". -// src/ScmIntegrations.d.ts:47:5 - (ae-undocumented) Missing documentation for "azure". -// src/ScmIntegrations.d.ts:51:5 - (ae-undocumented) Missing documentation for "bitbucket". -// src/ScmIntegrations.d.ts:52:5 - (ae-undocumented) Missing documentation for "bitbucketCloud". -// src/ScmIntegrations.d.ts:53:5 - (ae-undocumented) Missing documentation for "bitbucketServer". -// src/ScmIntegrations.d.ts:54:5 - (ae-undocumented) Missing documentation for "gerrit". -// src/ScmIntegrations.d.ts:55:5 - (ae-undocumented) Missing documentation for "github". -// src/ScmIntegrations.d.ts:56:5 - (ae-undocumented) Missing documentation for "gitlab". -// src/ScmIntegrations.d.ts:57:5 - (ae-undocumented) Missing documentation for "gitea". -// src/ScmIntegrations.d.ts:58:5 - (ae-undocumented) Missing documentation for "harness". -// src/ScmIntegrations.d.ts:59:5 - (ae-undocumented) Missing documentation for "list". -// src/ScmIntegrations.d.ts:60:5 - (ae-undocumented) Missing documentation for "byUrl". -// src/ScmIntegrations.d.ts:61:5 - (ae-undocumented) Missing documentation for "byHost". -// src/ScmIntegrations.d.ts:62:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/ScmIntegrations.d.ts:67:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/awsCodeCommit/AwsCodeCommitIntegration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/awsCodeCommit/AwsCodeCommitIntegration.d.ts:11:5 - (ae-undocumented) Missing documentation for "type". -// src/awsCodeCommit/AwsCodeCommitIntegration.d.ts:12:5 - (ae-undocumented) Missing documentation for "config". -// src/awsCodeCommit/AwsCodeCommitIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/awsCodeCommit/AwsCodeCommitIntegration.d.ts:15:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/awsCodeCommit/AwsCodeCommitIntegration.d.ts:20:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/awsS3/AwsS3Integration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/awsS3/AwsS3Integration.d.ts:11:5 - (ae-undocumented) Missing documentation for "type". -// src/awsS3/AwsS3Integration.d.ts:12:5 - (ae-undocumented) Missing documentation for "title". -// src/awsS3/AwsS3Integration.d.ts:13:5 - (ae-undocumented) Missing documentation for "config". -// src/awsS3/AwsS3Integration.d.ts:15:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/awsS3/AwsS3Integration.d.ts:20:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/azure/AzureIntegration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/azure/AzureIntegration.d.ts:12:5 - (ae-undocumented) Missing documentation for "type". -// src/azure/AzureIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/azure/AzureIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "config". -// src/azure/AzureIntegration.d.ts:15:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/azure/AzureIntegration.d.ts:20:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/azure/DefaultAzureDevOpsCredentialsProvider.d.ts:9:5 - (ae-undocumented) Missing documentation for "fromIntegrations". -// src/azure/DefaultAzureDevOpsCredentialsProvider.d.ts:14:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/azure/types.d.ts:25:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/bitbucket/BitbucketIntegration.d.ts:11:5 - (ae-undocumented) Missing documentation for "factory". -// src/bitbucket/BitbucketIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "type". -// src/bitbucket/BitbucketIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "title". -// src/bitbucket/BitbucketIntegration.d.ts:15:5 - (ae-undocumented) Missing documentation for "config". -// src/bitbucket/BitbucketIntegration.d.ts:16:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/bitbucket/BitbucketIntegration.d.ts:21:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/bitbucketCloud/BitbucketCloudIntegration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/bitbucketCloud/BitbucketCloudIntegration.d.ts:12:5 - (ae-undocumented) Missing documentation for "type". -// src/bitbucketCloud/BitbucketCloudIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/bitbucketCloud/BitbucketCloudIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "config". -// src/bitbucketCloud/BitbucketCloudIntegration.d.ts:15:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/bitbucketCloud/BitbucketCloudIntegration.d.ts:20:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/bitbucketServer/BitbucketServerIntegration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/bitbucketServer/BitbucketServerIntegration.d.ts:12:5 - (ae-undocumented) Missing documentation for "type". -// src/bitbucketServer/BitbucketServerIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/bitbucketServer/BitbucketServerIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "config". -// src/bitbucketServer/BitbucketServerIntegration.d.ts:15:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/bitbucketServer/BitbucketServerIntegration.d.ts:20:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/gerrit/GerritIntegration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/gerrit/GerritIntegration.d.ts:12:5 - (ae-undocumented) Missing documentation for "type". -// src/gerrit/GerritIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/gerrit/GerritIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "config". -// src/gerrit/GerritIntegration.d.ts:15:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/gerrit/GerritIntegration.d.ts:20:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/gitea/GiteaIntegration.d.ts:9:5 - (ae-undocumented) Missing documentation for "config". -// src/gitea/GiteaIntegration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/gitea/GiteaIntegration.d.ts:12:5 - (ae-undocumented) Missing documentation for "type". -// src/gitea/GiteaIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/gitea/GiteaIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/gitea/GiteaIntegration.d.ts:19:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/github/DefaultGithubCredentialsProvider.d.ts:13:5 - (ae-undocumented) Missing documentation for "fromIntegrations". -// src/github/GithubIntegration.d.ts:11:5 - (ae-undocumented) Missing documentation for "factory". -// src/github/GithubIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "type". -// src/github/GithubIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "title". -// src/github/GithubIntegration.d.ts:15:5 - (ae-undocumented) Missing documentation for "config". -// src/github/GithubIntegration.d.ts:16:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/github/GithubIntegration.d.ts:21:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/github/GithubIntegration.d.ts:22:5 - (ae-undocumented) Missing documentation for "parseRateLimitInfo". -// src/github/SingleInstanceGithubCredentialsProvider.d.ts:12:5 - (ae-undocumented) Missing documentation for "getAllInstallations". -// src/github/SingleInstanceGithubCredentialsProvider.d.ts:13:5 - (ae-undocumented) Missing documentation for "getAppToken". -// src/github/SingleInstanceGithubCredentialsProvider.d.ts:26:5 - (ae-undocumented) Missing documentation for "create". -// src/github/types.d.ts:26:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/gitlab/DefaultGitlabCredentialsProvider.d.ts:10:5 - (ae-undocumented) Missing documentation for "fromIntegrations". -// src/gitlab/DefaultGitlabCredentialsProvider.d.ts:12:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/gitlab/GitLabIntegration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/gitlab/GitLabIntegration.d.ts:12:5 - (ae-undocumented) Missing documentation for "type". -// src/gitlab/GitLabIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/gitlab/GitLabIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "config". -// src/gitlab/GitLabIntegration.d.ts:15:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/gitlab/GitLabIntegration.d.ts:20:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/gitlab/types.d.ts:4:1 - (ae-undocumented) Missing documentation for "GitlabCredentials". -// src/gitlab/types.d.ts:13:1 - (ae-undocumented) Missing documentation for "GitlabCredentialsProvider". -// src/gitlab/types.d.ts:14:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/harness/HarnessIntegration.d.ts:9:5 - (ae-undocumented) Missing documentation for "config". -// src/harness/HarnessIntegration.d.ts:10:5 - (ae-undocumented) Missing documentation for "factory". -// src/harness/HarnessIntegration.d.ts:12:5 - (ae-undocumented) Missing documentation for "type". -// src/harness/HarnessIntegration.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/harness/HarnessIntegration.d.ts:14:5 - (ae-undocumented) Missing documentation for "resolveUrl". -// src/harness/HarnessIntegration.d.ts:19:5 - (ae-undocumented) Missing documentation for "resolveEditUrl". -// src/registry.d.ts:19:5 - (ae-undocumented) Missing documentation for "awsS3". -// src/registry.d.ts:20:5 - (ae-undocumented) Missing documentation for "awsCodeCommit". -// src/registry.d.ts:21:5 - (ae-undocumented) Missing documentation for "azure". -// src/registry.d.ts:25:5 - (ae-undocumented) Missing documentation for "bitbucket". -// src/registry.d.ts:26:5 - (ae-undocumented) Missing documentation for "bitbucketCloud". -// src/registry.d.ts:27:5 - (ae-undocumented) Missing documentation for "bitbucketServer". -// src/registry.d.ts:28:5 - (ae-undocumented) Missing documentation for "gerrit". -// src/registry.d.ts:29:5 - (ae-undocumented) Missing documentation for "github". -// src/registry.d.ts:30:5 - (ae-undocumented) Missing documentation for "gitlab". -// src/registry.d.ts:31:5 - (ae-undocumented) Missing documentation for "gitea". -// src/registry.d.ts:32:5 - (ae-undocumented) Missing documentation for "harness". -// src/types.d.ts:93:5 - (ae-undocumented) Missing documentation for "isRateLimited". ``` diff --git a/packages/repo-tools/src/commands/api-reports/api-extractor.ts b/packages/repo-tools/src/commands/api-reports/api-extractor.ts index c1075f92c1..c55410ce4a 100644 --- a/packages/repo-tools/src/commands/api-reports/api-extractor.ts +++ b/packages/repo-tools/src/commands/api-reports/api-extractor.ts @@ -240,8 +240,6 @@ export async function createTemporaryTsConfig(includedPackageDirs: string[]) { } export async function countApiReportWarnings(reportPath: string) { - console.log(reportPath); - try { const content = await fs.readFile(reportPath, 'utf8'); const lines = content.split('\n'); @@ -378,6 +376,7 @@ export async function runApiExtraction({ logLevel: 'none', }; } + const warnings = new Array(); for (const [packageDir, packageEntryPoints] of Object.entries( @@ -605,8 +604,6 @@ export async function runApiExtraction({ const warningCountAfter = await countApiReportWarnings(reportPath); - console.log({ warningCountAfter, warningCountBefore, warnings }); - if (noBail) { console.log(`Skipping warnings check for ${packageDir}`); } diff --git a/packages/test-utils/report-alpha.api.md b/packages/test-utils/report-alpha.api.md index 19a3786fc9..0c0186a8af 100644 --- a/packages/test-utils/report-alpha.api.md +++ b/packages/test-utils/report-alpha.api.md @@ -28,12 +28,5 @@ export class MockTranslationApi implements TranslationApi { >(): Observable>; } -// Warnings were encountered during analysis: -// -// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:7:1 - (ae-undocumented) Missing documentation for "MockTranslationApi". -// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:9:5 - (ae-undocumented) Missing documentation for "create". -// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:11:5 - (ae-undocumented) Missing documentation for "getTranslation". -// src/testUtils/apis/TranslationApi/MockTranslationApi.d.ts:14:5 - (ae-undocumented) Missing documentation for "translation$". - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/test-utils/report.api.md b/packages/test-utils/report.api.md index 11657ce534..126b7236b3 100644 --- a/packages/test-utils/report.api.md +++ b/packages/test-utils/report.api.md @@ -403,33 +403,4 @@ export function wrapInTestApp( Component: ComponentType | ReactNode, options?: TestAppOptions, ): ReactElement; - -// Warnings were encountered during analysis: -// -// src/deprecated.d.ts:5:1 - (ae-undocumented) Missing documentation for "setupRequestMockHandlers". -// src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.d.ts:11:5 - (ae-undocumented) Missing documentation for "captureEvent". -// src/testUtils/apis/AnalyticsApi/MockAnalyticsApi.d.ts:12:5 - (ae-undocumented) Missing documentation for "getEvents". -// src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:28:5 - (ae-undocumented) Missing documentation for "post". -// src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:29:5 - (ae-undocumented) Missing documentation for "error$". -// src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:33:5 - (ae-undocumented) Missing documentation for "getErrors". -// src/testUtils/apis/ErrorApi/MockErrorApi.d.ts:34:5 - (ae-undocumented) Missing documentation for "waitForError". -// src/testUtils/apis/PermissionApi/MockPermissionApi.d.ts:14:5 - (ae-undocumented) Missing documentation for "authorize". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:21:5 - (ae-undocumented) Missing documentation for "create". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:22:5 - (ae-undocumented) Missing documentation for "forBucket". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:23:5 - (ae-undocumented) Missing documentation for "snapshot". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:24:5 - (ae-undocumented) Missing documentation for "set". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:25:5 - (ae-undocumented) Missing documentation for "remove". -// src/testUtils/apis/StorageApi/MockStorageApi.d.ts:26:5 - (ae-undocumented) Missing documentation for "observe$". -// src/testUtils/apis/mockApis.d.ts:58:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:59:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:125:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:128:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:150:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:158:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:177:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:180:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:197:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:200:15 - (ae-undocumented) Missing documentation for "mock". -// src/testUtils/apis/mockApis.d.ts:215:15 - (ae-undocumented) Missing documentation for "factory". -// src/testUtils/apis/mockApis.d.ts:216:15 - (ae-undocumented) Missing documentation for "mock". ``` diff --git a/packages/theme/report.api.md b/packages/theme/report.api.md index faec0b8456..4462bb4de7 100644 --- a/packages/theme/report.api.md +++ b/packages/theme/report.api.md @@ -462,30 +462,4 @@ export interface UnifiedThemeProviderProps { // (undocumented) theme: UnifiedTheme; } - -// Warnings were encountered during analysis: -// -// src/base/createBaseThemeOptions.d.ts:14:5 - (ae-undocumented) Missing documentation for "palette". -// src/base/createBaseThemeOptions.d.ts:15:5 - (ae-undocumented) Missing documentation for "defaultPageTheme". -// src/base/createBaseThemeOptions.d.ts:16:5 - (ae-undocumented) Missing documentation for "pageTheme". -// src/base/createBaseThemeOptions.d.ts:17:5 - (ae-undocumented) Missing documentation for "fontFamily". -// src/base/createBaseThemeOptions.d.ts:18:5 - (ae-undocumented) Missing documentation for "htmlFontSize". -// src/base/createBaseThemeOptions.d.ts:19:5 - (ae-undocumented) Missing documentation for "typography". -// src/unified/UnifiedTheme.d.ts:17:5 - (ae-undocumented) Missing documentation for "palette". -// src/unified/UnifiedTheme.d.ts:18:5 - (ae-undocumented) Missing documentation for "defaultPageTheme". -// src/unified/UnifiedTheme.d.ts:19:5 - (ae-undocumented) Missing documentation for "pageTheme". -// src/unified/UnifiedTheme.d.ts:20:5 - (ae-undocumented) Missing documentation for "fontFamily". -// src/unified/UnifiedTheme.d.ts:21:5 - (ae-undocumented) Missing documentation for "htmlFontSize". -// src/unified/UnifiedTheme.d.ts:22:5 - (ae-undocumented) Missing documentation for "components". -// src/unified/UnifiedTheme.d.ts:23:5 - (ae-undocumented) Missing documentation for "typography". -// src/unified/UnifiedThemeProvider.d.ts:9:5 - (ae-undocumented) Missing documentation for "children". -// src/unified/UnifiedThemeProvider.d.ts:10:5 - (ae-undocumented) Missing documentation for "theme". -// src/unified/UnifiedThemeProvider.d.ts:11:5 - (ae-undocumented) Missing documentation for "noCssBaseline". -// src/unified/types.d.ts:25:5 - (ae-undocumented) Missing documentation for "getTheme". -// src/v4/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "palette". -// src/v4/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "page". -// src/v4/types.d.ts:33:5 - (ae-undocumented) Missing documentation for "getPageTheme". -// src/v4/types.d.ts:42:5 - (ae-undocumented) Missing documentation for "palette". -// src/v4/types.d.ts:43:5 - (ae-undocumented) Missing documentation for "page". -// src/v4/types.d.ts:44:5 - (ae-undocumented) Missing documentation for "getPageTheme". ``` diff --git a/packages/yarn-plugin/report.api.md b/packages/yarn-plugin/report.api.md index b246b802bb..f0300ec9a1 100644 --- a/packages/yarn-plugin/report.api.md +++ b/packages/yarn-plugin/report.api.md @@ -8,8 +8,4 @@ import { Plugin as Plugin_2 } from '@yarnpkg/core'; // @public (undocumented) const plugin: Plugin_2; export default plugin; - -// Warnings were encountered during analysis: -// -// src/index.d.ts:11:15 - (ae-undocumented) Missing documentation for "plugin". ``` diff --git a/plugins/api-docs-module-protoc-gen-doc/report.api.md b/plugins/api-docs-module-protoc-gen-doc/report.api.md index 355b867e9a..836f8313d8 100644 --- a/plugins/api-docs-module-protoc-gen-doc/report.api.md +++ b/plugins/api-docs-module-protoc-gen-doc/report.api.md @@ -11,8 +11,4 @@ export const grpcDocsApiWidget: { title: string; component: (definition: string) => React_2.JSX.Element; }; - -// Warnings were encountered during analysis: -// -// src/widgets.d.ts:5:22 - (ae-undocumented) Missing documentation for "grpcDocsApiWidget". ``` diff --git a/plugins/api-docs/report-alpha.api.md b/plugins/api-docs/report-alpha.api.md index 274d5d4aac..820978b877 100644 --- a/plugins/api-docs/report-alpha.api.md +++ b/plugins/api-docs/report-alpha.api.md @@ -427,9 +427,5 @@ const _default: FrontendPlugin< >; export default _default; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/api-docs/report.api.md b/plugins/api-docs/report.api.md index 74318781c8..3c3f245a3c 100644 --- a/plugins/api-docs/report.api.md +++ b/plugins/api-docs/report.api.md @@ -229,38 +229,4 @@ export const TrpcApiDefinitionWidget: ( export type TrpcApiDefinitionWidgetProps = { definition: string; }; - -// Warnings were encountered during analysis: -// -// src/components/ApiDefinitionCard/ApiDefinitionCard.d.ts:3:22 - (ae-undocumented) Missing documentation for "ApiDefinitionCard". -// src/components/ApiDefinitionCard/ApiDefinitionWidget.d.ts:3:1 - (ae-undocumented) Missing documentation for "ApiDefinitionWidget". -// src/components/ApiDefinitionCard/ApiDefinitionWidget.d.ts:10:1 - (ae-undocumented) Missing documentation for "defaultDefinitionWidgets". -// src/components/ApiDefinitionCard/ApiTypeTitle.d.ts:6:22 - (ae-undocumented) Missing documentation for "ApiTypeTitle". -// src/components/ApisCards/ConsumedApisCard.d.ts:7:22 - (ae-undocumented) Missing documentation for "ConsumedApisCard". -// src/components/ApisCards/HasApisCard.d.ts:7:22 - (ae-undocumented) Missing documentation for "HasApisCard". -// src/components/ApisCards/ProvidedApisCard.d.ts:7:22 - (ae-undocumented) Missing documentation for "ProvidedApisCard". -// src/components/AsyncApiDefinitionWidget/AsyncApiDefinition.d.ts:4:1 - (ae-undocumented) Missing documentation for "AsyncApiResolver". -// src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.d.ts:4:1 - (ae-undocumented) Missing documentation for "AsyncApiDefinitionWidgetProps". -// src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.d.ts:9:22 - (ae-undocumented) Missing documentation for "AsyncApiDefinitionWidget". -// src/components/ComponentsCards/ConsumingComponentsCard.d.ts:7:22 - (ae-undocumented) Missing documentation for "ConsumingComponentsCard". -// src/components/ComponentsCards/ProvidingComponentsCard.d.ts:5:22 - (ae-undocumented) Missing documentation for "ProvidingComponentsCard". -// src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.d.ts:3:1 - (ae-undocumented) Missing documentation for "GraphQlDefinitionWidgetProps". -// src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.d.ts:7:22 - (ae-undocumented) Missing documentation for "GraphQlDefinitionWidget". -// src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.d.ts:3:1 - (ae-undocumented) Missing documentation for "OpenApiDefinitionWidgetProps". -// src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.d.ts:9:22 - (ae-undocumented) Missing documentation for "OpenApiDefinitionWidget". -// src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.d.ts:3:1 - (ae-undocumented) Missing documentation for "PlainApiDefinitionWidgetProps". -// src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.d.ts:8:22 - (ae-undocumented) Missing documentation for "PlainApiDefinitionWidget". -// src/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.d.ts:3:1 - (ae-undocumented) Missing documentation for "TrpcApiDefinitionWidgetProps". -// src/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.d.ts:7:22 - (ae-undocumented) Missing documentation for "TrpcApiDefinitionWidget". -// src/config.d.ts:4:22 - (ae-undocumented) Missing documentation for "apiDocsConfigRef". -// src/config.d.ts:6:1 - (ae-undocumented) Missing documentation for "ApiDocsConfig". -// src/config.d.ts:7:5 - (ae-undocumented) Missing documentation for "getApiDefinitionWidget". -// src/plugin.d.ts:4:22 - (ae-undocumented) Missing documentation for "apiDocsPlugin". -// src/plugin.d.ts:10:22 - (ae-undocumented) Missing documentation for "ApiExplorerPage". -// src/plugin.d.ts:12:22 - (ae-undocumented) Missing documentation for "EntityApiDefinitionCard". -// src/plugin.d.ts:14:22 - (ae-undocumented) Missing documentation for "EntityConsumedApisCard". -// src/plugin.d.ts:21:22 - (ae-undocumented) Missing documentation for "EntityConsumingComponentsCard". -// src/plugin.d.ts:26:22 - (ae-undocumented) Missing documentation for "EntityProvidedApisCard". -// src/plugin.d.ts:33:22 - (ae-undocumented) Missing documentation for "EntityProvidingComponentsCard". -// src/plugin.d.ts:38:22 - (ae-undocumented) Missing documentation for "EntityHasApisCard". ``` diff --git a/plugins/app-backend/report-alpha.api.md b/plugins/app-backend/report-alpha.api.md index f5bd67554d..78c4b97232 100644 --- a/plugins/app-backend/report-alpha.api.md +++ b/plugins/app-backend/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _appPlugin: BackendFeature; export default _appPlugin; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_appPlugin". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/app-backend/report.api.md b/plugins/app-backend/report.api.md index 4ec356951f..35e7ea383d 100644 --- a/plugins/app-backend/report.api.md +++ b/plugins/app-backend/report.api.md @@ -35,13 +35,4 @@ export interface RouterOptions { schema?: ConfigSchema; staticFallbackHandler?: express.Handler; } - -// Warnings were encountered during analysis: -// -// src/service/router.d.ts:9:1 - (ae-undocumented) Missing documentation for "RouterOptions". -// src/service/router.d.ts:10:5 - (ae-undocumented) Missing documentation for "config". -// src/service/router.d.ts:11:5 - (ae-undocumented) Missing documentation for "logger". -// src/service/router.d.ts:12:5 - (ae-undocumented) Missing documentation for "auth". -// src/service/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "httpAuth". -// src/service/router.d.ts:61:1 - (ae-undocumented) Missing documentation for "createRouter". ``` diff --git a/plugins/app-visualizer/report.api.md b/plugins/app-visualizer/report.api.md index 15f7384c42..48eca04ed8 100644 --- a/plugins/app-visualizer/report.api.md +++ b/plugins/app-visualizer/report.api.md @@ -71,9 +71,5 @@ const visualizerPlugin: FrontendPlugin< >; export default visualizerPlugin; -// Warnings were encountered during analysis: -// -// src/plugin.d.ts:20:22 - (ae-undocumented) Missing documentation for "visualizerPlugin". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/app/report.api.md b/plugins/app/report.api.md index 208f9dcfb0..89dde35f78 100644 --- a/plugins/app/report.api.md +++ b/plugins/app/report.api.md @@ -754,9 +754,5 @@ const appPlugin: FrontendPlugin< >; export default appPlugin; -// Warnings were encountered during analysis: -// -// src/plugin.d.ts:3:22 - (ae-undocumented) Missing documentation for "appPlugin". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/auth-backend-module-atlassian-provider/report.api.md b/plugins/auth-backend-module-atlassian-provider/report.api.md index 7f32330451..7abdf7ee70 100644 --- a/plugins/auth-backend-module-atlassian-provider/report.api.md +++ b/plugins/auth-backend-module-atlassian-provider/report.api.md @@ -27,9 +27,4 @@ export namespace atlassianSignInResolvers { // @public (undocumented) const authModuleAtlassianProvider: BackendFeature; export default authModuleAtlassianProvider; - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "atlassianAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleAtlassianProvider". ``` diff --git a/plugins/auth-backend-module-auth0-provider/report.api.md b/plugins/auth-backend-module-auth0-provider/report.api.md index 2d1b9074b4..fb7aa9d0ba 100644 --- a/plugins/auth-backend-module-auth0-provider/report.api.md +++ b/plugins/auth-backend-module-auth0-provider/report.api.md @@ -22,9 +22,4 @@ export const auth0Authenticator: OAuthAuthenticator< // @public (undocumented) const authModuleAuth0Provider: BackendFeature; export default authModuleAuth0Provider; - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "auth0Authenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleAuth0Provider". ``` diff --git a/plugins/auth-backend-module-aws-alb-provider/report.api.md b/plugins/auth-backend-module-aws-alb-provider/report.api.md index c7437a1b9d..b3a9ce4517 100644 --- a/plugins/auth-backend-module-aws-alb-provider/report.api.md +++ b/plugins/auth-backend-module-aws-alb-provider/report.api.md @@ -46,10 +46,4 @@ export namespace awsAlbSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:6:22 - (ae-undocumented) Missing documentation for "awsAlbAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleAwsAlbProvider". -// src/resolvers.d.ts:8:11 - (ae-undocumented) Missing documentation for "emailMatchingUserEntityProfileEmail". ``` diff --git a/plugins/auth-backend-module-azure-easyauth-provider/report.api.md b/plugins/auth-backend-module-azure-easyauth-provider/report.api.md index 3292654787..9d337e3f34 100644 --- a/plugins/auth-backend-module-azure-easyauth-provider/report.api.md +++ b/plugins/auth-backend-module-azure-easyauth-provider/report.api.md @@ -36,13 +36,5 @@ export namespace azureEasyAuthSignInResolvers { >; } -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:5:22 - (ae-undocumented) Missing documentation for "azureEasyAuthAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleAzureEasyAuthProvider". -// src/resolvers.d.ts:3:1 - (ae-undocumented) Missing documentation for "azureEasyAuthSignInResolvers". -// src/resolvers.d.ts:4:11 - (ae-undocumented) Missing documentation for "idMatchingUserEntityAnnotation". -// src/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "AzureEasyAuthResult". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/auth-backend-module-bitbucket-provider/report.api.md b/plugins/auth-backend-module-bitbucket-provider/report.api.md index 210a292050..ceb4141fd9 100644 --- a/plugins/auth-backend-module-bitbucket-provider/report.api.md +++ b/plugins/auth-backend-module-bitbucket-provider/report.api.md @@ -31,9 +31,4 @@ export namespace bitbucketSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "bitbucketAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleBitbucketProvider". ``` diff --git a/plugins/auth-backend-module-bitbucket-server-provider/report.api.md b/plugins/auth-backend-module-bitbucket-server-provider/report.api.md index 371873027a..d5c484f6e3 100644 --- a/plugins/auth-backend-module-bitbucket-server-provider/report.api.md +++ b/plugins/auth-backend-module-bitbucket-server-provider/report.api.md @@ -30,9 +30,4 @@ export namespace bitbucketServerSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "bitbucketServerAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleBitbucketServerProvider". ``` diff --git a/plugins/auth-backend-module-cloudflare-access-provider/report.api.md b/plugins/auth-backend-module-cloudflare-access-provider/report.api.md index b9943b2bef..1547190d39 100644 --- a/plugins/auth-backend-module-cloudflare-access-provider/report.api.md +++ b/plugins/auth-backend-module-cloudflare-access-provider/report.api.md @@ -60,10 +60,4 @@ export namespace cloudflareAccessSignInResolvers { export function createCloudflareAccessAuthenticator(options?: { cache?: CacheService; }): ProxyAuthenticator; - -// Warnings were encountered during analysis: -// -// src/types.d.ts:55:1 - (ae-undocumented) Missing documentation for "CloudflareAccessGroup". -// src/types.d.ts:72:1 - (ae-undocumented) Missing documentation for "CloudflareAccessIdentityProfile". -// src/types.d.ts:81:1 - (ae-undocumented) Missing documentation for "CloudflareAccessResult". ``` diff --git a/plugins/auth-backend-module-gcp-iap-provider/report.api.md b/plugins/auth-backend-module-gcp-iap-provider/report.api.md index 72887276d5..1476694f99 100644 --- a/plugins/auth-backend-module-gcp-iap-provider/report.api.md +++ b/plugins/auth-backend-module-gcp-iap-provider/report.api.md @@ -50,10 +50,5 @@ export type GcpIapTokenInfo = { [key: string]: JsonPrimitive; }; -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:2:22 - (ae-undocumented) Missing documentation for "gcpIapAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleGcpIapProvider". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/auth-backend-module-github-provider/report.api.md b/plugins/auth-backend-module-github-provider/report.api.md index 0578c23d3e..222305adfd 100644 --- a/plugins/auth-backend-module-github-provider/report.api.md +++ b/plugins/auth-backend-module-github-provider/report.api.md @@ -27,9 +27,4 @@ export namespace githubSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "githubAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleGithubProvider". ``` diff --git a/plugins/auth-backend-module-gitlab-provider/report.api.md b/plugins/auth-backend-module-gitlab-provider/report.api.md index a72c00c6e5..44c5ffb214 100644 --- a/plugins/auth-backend-module-gitlab-provider/report.api.md +++ b/plugins/auth-backend-module-gitlab-provider/report.api.md @@ -27,9 +27,4 @@ export namespace gitlabSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "gitlabAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleGitlabProvider". ``` diff --git a/plugins/auth-backend-module-google-provider/report.api.md b/plugins/auth-backend-module-google-provider/report.api.md index a2fc1bbce9..eeefb8e837 100644 --- a/plugins/auth-backend-module-google-provider/report.api.md +++ b/plugins/auth-backend-module-google-provider/report.api.md @@ -28,10 +28,5 @@ export namespace googleSignInResolvers { >; } -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "googleAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleGoogleProvider". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/auth-backend-module-guest-provider/report.api.md b/plugins/auth-backend-module-guest-provider/report.api.md index b100e5270b..b0ba5386a2 100644 --- a/plugins/auth-backend-module-guest-provider/report.api.md +++ b/plugins/auth-backend-module-guest-provider/report.api.md @@ -8,8 +8,4 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; // @public (undocumented) const authModuleGuestProvider: BackendFeature; export default authModuleGuestProvider; - -// Warnings were encountered during analysis: -// -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleGuestProvider". ``` diff --git a/plugins/auth-backend-module-microsoft-provider/report.api.md b/plugins/auth-backend-module-microsoft-provider/report.api.md index 3e7775cfa8..6aef395d7c 100644 --- a/plugins/auth-backend-module-microsoft-provider/report.api.md +++ b/plugins/auth-backend-module-microsoft-provider/report.api.md @@ -37,10 +37,4 @@ export namespace microsoftSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "microsoftAuthenticator". -// src/deprecated.d.ts:5:22 - (ae-undocumented) Missing documentation for "authModuleMicrosoftProvider". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleMicrosoftProvider". ``` diff --git a/plugins/auth-backend-module-oauth2-provider/report.api.md b/plugins/auth-backend-module-oauth2-provider/report.api.md index 5648d043a2..632591ec04 100644 --- a/plugins/auth-backend-module-oauth2-provider/report.api.md +++ b/plugins/auth-backend-module-oauth2-provider/report.api.md @@ -27,9 +27,4 @@ export namespace oauth2SignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "oauth2Authenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleOauth2Provider". ``` diff --git a/plugins/auth-backend-module-oauth2-proxy-provider/report.api.md b/plugins/auth-backend-module-oauth2-proxy-provider/report.api.md index 27b3a9feb2..5c5cefd734 100644 --- a/plugins/auth-backend-module-oauth2-proxy-provider/report.api.md +++ b/plugins/auth-backend-module-oauth2-proxy-provider/report.api.md @@ -32,9 +32,4 @@ export type OAuth2ProxyResult = { headers: IncomingHttpHeaders; getHeader(name: string): string | undefined; }; - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:10:22 - (ae-undocumented) Missing documentation for "oauth2ProxyAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleOauth2ProxyProvider". ``` diff --git a/plugins/auth-backend-module-oidc-provider/report.api.md b/plugins/auth-backend-module-oidc-provider/report.api.md index bee9a2fdd9..93c000c2ee 100644 --- a/plugins/auth-backend-module-oidc-provider/report.api.md +++ b/plugins/auth-backend-module-oidc-provider/report.api.md @@ -49,9 +49,4 @@ export namespace oidcSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:13:22 - (ae-undocumented) Missing documentation for "oidcAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleOidcProvider". ``` diff --git a/plugins/auth-backend-module-okta-provider/report.api.md b/plugins/auth-backend-module-okta-provider/report.api.md index 97e587df76..a142265100 100644 --- a/plugins/auth-backend-module-okta-provider/report.api.md +++ b/plugins/auth-backend-module-okta-provider/report.api.md @@ -27,9 +27,4 @@ export namespace oktaSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "oktaAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleOktaProvider". ``` diff --git a/plugins/auth-backend-module-onelogin-provider/report.api.md b/plugins/auth-backend-module-onelogin-provider/report.api.md index a636d96ae0..1991f00e0b 100644 --- a/plugins/auth-backend-module-onelogin-provider/report.api.md +++ b/plugins/auth-backend-module-onelogin-provider/report.api.md @@ -27,9 +27,4 @@ export namespace oneLoginSignInResolvers { unknown >; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:3:22 - (ae-undocumented) Missing documentation for "oneLoginAuthenticator". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModuleOneLoginProvider". ``` diff --git a/plugins/auth-backend-module-pinniped-provider/report.api.md b/plugins/auth-backend-module-pinniped-provider/report.api.md index a0500f5e74..e15f4ee324 100644 --- a/plugins/auth-backend-module-pinniped-provider/report.api.md +++ b/plugins/auth-backend-module-pinniped-provider/report.api.md @@ -37,12 +37,4 @@ export class PinnipedStrategyCache { client: BaseClient; }>; } - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:4:1 - (ae-undocumented) Missing documentation for "PinnipedStrategyCache". -// src/authenticator.d.ts:11:5 - (ae-undocumented) Missing documentation for "getStrategy". -// src/authenticator.d.ts:20:22 - (ae-undocumented) Missing documentation for "pinnipedAuthenticator". -// src/deprecated.d.ts:5:22 - (ae-undocumented) Missing documentation for "authModulePinnipedProvider". -// src/module.d.ts:2:22 - (ae-undocumented) Missing documentation for "authModulePinnipedProvider". ``` diff --git a/plugins/auth-backend-module-vmware-cloud-provider/report.api.md b/plugins/auth-backend-module-vmware-cloud-provider/report.api.md index 1bd10c7eae..46cf7810ca 100644 --- a/plugins/auth-backend-module-vmware-cloud-provider/report.api.md +++ b/plugins/auth-backend-module-vmware-cloud-provider/report.api.md @@ -33,12 +33,4 @@ export interface VMwareCloudAuthenticatorContext { export type VMwarePassportProfile = PassportProfile & { organizationId?: string; }; - -// Warnings were encountered during analysis: -// -// src/authenticator.d.ts:4:1 - (ae-undocumented) Missing documentation for "VMwareCloudAuthenticatorContext". -// src/authenticator.d.ts:5:5 - (ae-undocumented) Missing documentation for "organizationId". -// src/authenticator.d.ts:6:5 - (ae-undocumented) Missing documentation for "providerStrategy". -// src/authenticator.d.ts:7:5 - (ae-undocumented) Missing documentation for "helper". -// src/authenticator.d.ts:10:1 - (ae-undocumented) Missing documentation for "VMwarePassportProfile". ``` diff --git a/plugins/auth-backend/report.api.md b/plugins/auth-backend/report.api.md index 80976525d3..20690528d1 100644 --- a/plugins/auth-backend/report.api.md +++ b/plugins/auth-backend/report.api.md @@ -700,68 +700,4 @@ export const verifyNonce: (req: express.Request, providerId: string) => void; // @public @deprecated (undocumented) export type WebMessageResponse = WebMessageResponse_2; - -// Warnings were encountered during analysis: -// -// src/identity/types.d.ts:13:1 - (ae-undocumented) Missing documentation for "TokenParams". -// src/lib/flow/authFlowHelpers.d.ts:8:22 - (ae-undocumented) Missing documentation for "postMessageResponse". -// src/lib/flow/authFlowHelpers.d.ts:13:22 - (ae-undocumented) Missing documentation for "ensuresXRequestedWith". -// src/lib/flow/types.d.ts:6:1 - (ae-undocumented) Missing documentation for "WebMessageResponse". -// src/lib/oauth/OAuthAdapter.d.ts:10:1 - (ae-undocumented) Missing documentation for "OAuthAdapterOptions". -// src/lib/oauth/OAuthAdapter.d.ts:23:1 - (ae-undocumented) Missing documentation for "OAuthAdapter". -// src/lib/oauth/OAuthAdapter.d.ts:26:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/lib/oauth/OAuthAdapter.d.ts:29:5 - (ae-undocumented) Missing documentation for "start". -// src/lib/oauth/OAuthAdapter.d.ts:30:5 - (ae-undocumented) Missing documentation for "frameHandler". -// src/lib/oauth/OAuthAdapter.d.ts:31:5 - (ae-undocumented) Missing documentation for "logout". -// src/lib/oauth/OAuthAdapter.d.ts:32:5 - (ae-undocumented) Missing documentation for "refresh". -// src/lib/oauth/OAuthEnvironmentHandler.d.ts:6:22 - (ae-undocumented) Missing documentation for "OAuthEnvironmentHandler". -// src/lib/oauth/helpers.d.ts:7:22 - (ae-undocumented) Missing documentation for "readState". -// src/lib/oauth/helpers.d.ts:12:22 - (ae-undocumented) Missing documentation for "encodeState". -// src/lib/oauth/helpers.d.ts:17:22 - (ae-undocumented) Missing documentation for "verifyNonce". -// src/lib/oauth/types.d.ts:29:1 - (ae-undocumented) Missing documentation for "OAuthResult". -// src/lib/oauth/types.d.ts:44:1 - (ae-undocumented) Missing documentation for "OAuthResponse". -// src/lib/oauth/types.d.ts:53:1 - (ae-undocumented) Missing documentation for "OAuthProviderInfo". -// src/lib/oauth/types.d.ts:75:1 - (ae-undocumented) Missing documentation for "OAuthState". -// src/lib/oauth/types.d.ts:80:1 - (ae-undocumented) Missing documentation for "OAuthStartRequest". -// src/lib/oauth/types.d.ts:88:1 - (ae-undocumented) Missing documentation for "OAuthRefreshRequest". -// src/lib/oauth/types.d.ts:96:1 - (ae-undocumented) Missing documentation for "OAuthLogoutRequest". -// src/lib/oauth/types.d.ts:103:1 - (ae-undocumented) Missing documentation for "OAuthHandlers". -// src/providers/azure-easyauth/index.d.ts:7:1 - (ae-undocumented) Missing documentation for "EasyAuthResult". -// src/providers/bitbucket/provider.d.ts:9:1 - (ae-undocumented) Missing documentation for "BitbucketOAuthResult". -// src/providers/bitbucket/provider.d.ts:23:1 - (ae-undocumented) Missing documentation for "BitbucketPassportProfile". -// src/providers/bitbucketServer/provider.d.ts:9:1 - (ae-undocumented) Missing documentation for "BitbucketServerOAuthResult". -// src/providers/cloudflare-access/provider.d.ts:90:1 - (ae-undocumented) Missing documentation for "CloudflareAccessResult". -// src/providers/github/provider.d.ts:5:1 - (ae-undocumented) Missing documentation for "GithubOAuthResult". -// src/providers/oauth2-proxy/index.d.ts:7:1 - (ae-undocumented) Missing documentation for "OAuth2ProxyResult". -// src/providers/oidc/index.d.ts:7:1 - (ae-undocumented) Missing documentation for "OidcAuthResult". -// src/providers/prepareBackstageIdentityResponse.d.ts:6:22 - (ae-undocumented) Missing documentation for "prepareBackstageIdentityResponse". -// src/providers/router.d.ts:9:1 - (ae-undocumented) Missing documentation for "ProviderFactories". -// src/providers/router.d.ts:27:1 - (ae-undocumented) Missing documentation for "createOriginFilter". -// src/providers/saml/provider.d.ts:6:1 - (ae-undocumented) Missing documentation for "SamlAuthResult". -// src/providers/types.d.ts:7:1 - (ae-undocumented) Missing documentation for "AuthResolverCatalogUserQuery". -// src/providers/types.d.ts:12:1 - (ae-undocumented) Missing documentation for "AuthResolverContext". -// src/providers/types.d.ts:17:1 - (ae-undocumented) Missing documentation for "CookieConfigurer". -// src/providers/types.d.ts:22:1 - (ae-undocumented) Missing documentation for "OAuthStartResponse". -// src/providers/types.d.ts:36:1 - (ae-undocumented) Missing documentation for "AuthProviderConfig". -// src/providers/types.d.ts:41:1 - (ae-undocumented) Missing documentation for "AuthProviderRouteHandlers". -// src/providers/types.d.ts:46:1 - (ae-undocumented) Missing documentation for "AuthProviderFactory". -// src/providers/types.d.ts:51:1 - (ae-undocumented) Missing documentation for "AuthResponse". -// src/providers/types.d.ts:56:1 - (ae-undocumented) Missing documentation for "ProfileInfo". -// src/providers/types.d.ts:61:1 - (ae-undocumented) Missing documentation for "SignInInfo". -// src/providers/types.d.ts:66:1 - (ae-undocumented) Missing documentation for "SignInResolver". -// src/providers/types.d.ts:96:1 - (ae-undocumented) Missing documentation for "StateEncoder". -// src/service/router.d.ts:11:1 - (ae-undocumented) Missing documentation for "RouterOptions". -// src/service/router.d.ts:12:5 - (ae-undocumented) Missing documentation for "logger". -// src/service/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "database". -// src/service/router.d.ts:14:5 - (ae-undocumented) Missing documentation for "config". -// src/service/router.d.ts:15:5 - (ae-undocumented) Missing documentation for "discovery". -// src/service/router.d.ts:16:5 - (ae-undocumented) Missing documentation for "tokenManager". -// src/service/router.d.ts:17:5 - (ae-undocumented) Missing documentation for "auth". -// src/service/router.d.ts:18:5 - (ae-undocumented) Missing documentation for "httpAuth". -// src/service/router.d.ts:19:5 - (ae-undocumented) Missing documentation for "tokenFactoryAlgorithm". -// src/service/router.d.ts:20:5 - (ae-undocumented) Missing documentation for "providerFactories". -// src/service/router.d.ts:21:5 - (ae-undocumented) Missing documentation for "disableDefaultProviderFactories". -// src/service/router.d.ts:22:5 - (ae-undocumented) Missing documentation for "catalogApi". -// src/service/router.d.ts:23:5 - (ae-undocumented) Missing documentation for "ownershipResolver". -// src/service/router.d.ts:29:1 - (ae-undocumented) Missing documentation for "createRouter". ``` diff --git a/plugins/auth-node/report.api.md b/plugins/auth-node/report.api.md index 5d3fce8f23..db61257f7a 100644 --- a/plugins/auth-node/report.api.md +++ b/plugins/auth-node/report.api.md @@ -700,128 +700,4 @@ export type WebMessageResponse = type: 'authorization_response'; error: Error; }; - -// Warnings were encountered during analysis: -// -// src/extensions/AuthOwnershipResolutionExtensionPoint.d.ts:3:1 - (ae-undocumented) Missing documentation for "AuthOwnershipResolutionExtensionPoint". -// src/extensions/AuthOwnershipResolutionExtensionPoint.d.ts:4:5 - (ae-undocumented) Missing documentation for "setAuthOwnershipResolver". -// src/extensions/AuthOwnershipResolutionExtensionPoint.d.ts:7:22 - (ae-undocumented) Missing documentation for "authOwnershipResolutionExtensionPoint". -// src/extensions/AuthProvidersExtensionPoint.d.ts:3:1 - (ae-undocumented) Missing documentation for "AuthProviderRegistrationOptions". -// src/extensions/AuthProvidersExtensionPoint.d.ts:4:5 - (ae-undocumented) Missing documentation for "providerId". -// src/extensions/AuthProvidersExtensionPoint.d.ts:5:5 - (ae-undocumented) Missing documentation for "factory". -// src/extensions/AuthProvidersExtensionPoint.d.ts:8:1 - (ae-undocumented) Missing documentation for "AuthProvidersExtensionPoint". -// src/extensions/AuthProvidersExtensionPoint.d.ts:9:5 - (ae-undocumented) Missing documentation for "registerProvider". -// src/extensions/AuthProvidersExtensionPoint.d.ts:12:22 - (ae-undocumented) Missing documentation for "authProvidersExtensionPoint". -// src/flow/sendWebMessageResponse.d.ts:17:1 - (ae-undocumented) Missing documentation for "sendWebMessageResponse". -// src/identity/DefaultIdentityClient.d.ts:35:5 - (ae-undocumented) Missing documentation for "getIdentity". -// src/identity/IdentityClient.d.ts:13:5 - (ae-undocumented) Missing documentation for "create". -// src/oauth/OAuthEnvironmentHandler.d.ts:5:1 - (ae-undocumented) Missing documentation for "OAuthEnvironmentHandler". -// src/oauth/OAuthEnvironmentHandler.d.ts:7:5 - (ae-undocumented) Missing documentation for "mapConfig". -// src/oauth/OAuthEnvironmentHandler.d.ts:9:5 - (ae-undocumented) Missing documentation for "start". -// src/oauth/OAuthEnvironmentHandler.d.ts:10:5 - (ae-undocumented) Missing documentation for "frameHandler". -// src/oauth/OAuthEnvironmentHandler.d.ts:11:5 - (ae-undocumented) Missing documentation for "refresh". -// src/oauth/OAuthEnvironmentHandler.d.ts:12:5 - (ae-undocumented) Missing documentation for "logout". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:6:1 - (ae-undocumented) Missing documentation for "PassportOAuthResult". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:17:1 - (ae-undocumented) Missing documentation for "PassportOAuthPrivateInfo". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:21:1 - (ae-undocumented) Missing documentation for "PassportOAuthDoneCallback". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:23:1 - (ae-undocumented) Missing documentation for "PassportOAuthAuthenticatorHelper". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:25:5 - (ae-undocumented) Missing documentation for "defaultProfileTransform". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:26:5 - (ae-undocumented) Missing documentation for "from". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:28:5 - (ae-undocumented) Missing documentation for "start". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:32:5 - (ae-undocumented) Missing documentation for "authenticate". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:33:5 - (ae-undocumented) Missing documentation for "refresh". -// src/oauth/PassportOAuthAuthenticatorHelper.d.ts:34:5 - (ae-undocumented) Missing documentation for "fetchProfile". -// src/oauth/createOAuthProviderFactory.d.ts:6:1 - (ae-undocumented) Missing documentation for "createOAuthProviderFactory". -// src/oauth/createOAuthRouteHandlers.d.ts:6:1 - (ae-undocumented) Missing documentation for "OAuthRouteHandlersOptions". -// src/oauth/createOAuthRouteHandlers.d.ts:7:5 - (ae-undocumented) Missing documentation for "authenticator". -// src/oauth/createOAuthRouteHandlers.d.ts:8:5 - (ae-undocumented) Missing documentation for "appUrl". -// src/oauth/createOAuthRouteHandlers.d.ts:9:5 - (ae-undocumented) Missing documentation for "baseUrl". -// src/oauth/createOAuthRouteHandlers.d.ts:10:5 - (ae-undocumented) Missing documentation for "isOriginAllowed". -// src/oauth/createOAuthRouteHandlers.d.ts:11:5 - (ae-undocumented) Missing documentation for "providerId". -// src/oauth/createOAuthRouteHandlers.d.ts:12:5 - (ae-undocumented) Missing documentation for "config". -// src/oauth/createOAuthRouteHandlers.d.ts:13:5 - (ae-undocumented) Missing documentation for "resolverContext". -// src/oauth/createOAuthRouteHandlers.d.ts:14:5 - (ae-undocumented) Missing documentation for "additionalScopes". -// src/oauth/createOAuthRouteHandlers.d.ts:15:5 - (ae-undocumented) Missing documentation for "stateTransform". -// src/oauth/createOAuthRouteHandlers.d.ts:16:5 - (ae-undocumented) Missing documentation for "profileTransform". -// src/oauth/createOAuthRouteHandlers.d.ts:17:5 - (ae-undocumented) Missing documentation for "cookieConfigurer". -// src/oauth/createOAuthRouteHandlers.d.ts:18:5 - (ae-undocumented) Missing documentation for "signInResolver". -// src/oauth/createOAuthRouteHandlers.d.ts:21:1 - (ae-undocumented) Missing documentation for "createOAuthRouteHandlers". -// src/oauth/state.d.ts:16:1 - (ae-undocumented) Missing documentation for "OAuthStateTransform". -// src/oauth/state.d.ts:22:1 - (ae-undocumented) Missing documentation for "encodeOAuthState". -// src/oauth/state.d.ts:24:1 - (ae-undocumented) Missing documentation for "decodeOAuthState". -// src/oauth/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "OAuthSession". -// src/oauth/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "accessToken". -// src/oauth/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "tokenType". -// src/oauth/types.d.ts:8:5 - (ae-undocumented) Missing documentation for "idToken". -// src/oauth/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "scope". -// src/oauth/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "expiresInSeconds". -// src/oauth/types.d.ts:11:5 - (ae-undocumented) Missing documentation for "refreshToken". -// src/oauth/types.d.ts:12:5 - (ae-undocumented) Missing documentation for "refreshTokenExpiresInSeconds". -// src/oauth/types.d.ts:15:1 - (ae-undocumented) Missing documentation for "OAuthAuthenticatorScopeOptions". -// src/oauth/types.d.ts:16:5 - (ae-undocumented) Missing documentation for "persist". -// src/oauth/types.d.ts:17:5 - (ae-undocumented) Missing documentation for "required". -// src/oauth/types.d.ts:18:5 - (ae-undocumented) Missing documentation for "transform". -// src/oauth/types.d.ts:30:1 - (ae-undocumented) Missing documentation for "OAuthAuthenticatorStartInput". -// src/oauth/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "scope". -// src/oauth/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "state". -// src/oauth/types.d.ts:33:5 - (ae-undocumented) Missing documentation for "req". -// src/oauth/types.d.ts:36:1 - (ae-undocumented) Missing documentation for "OAuthAuthenticatorAuthenticateInput". -// src/oauth/types.d.ts:37:5 - (ae-undocumented) Missing documentation for "req". -// src/oauth/types.d.ts:40:1 - (ae-undocumented) Missing documentation for "OAuthAuthenticatorRefreshInput". -// src/oauth/types.d.ts:41:5 - (ae-undocumented) Missing documentation for "scope". -// src/oauth/types.d.ts:42:5 - (ae-undocumented) Missing documentation for "refreshToken". -// src/oauth/types.d.ts:43:5 - (ae-undocumented) Missing documentation for "req". -// src/oauth/types.d.ts:46:1 - (ae-undocumented) Missing documentation for "OAuthAuthenticatorLogoutInput". -// src/oauth/types.d.ts:47:5 - (ae-undocumented) Missing documentation for "accessToken". -// src/oauth/types.d.ts:48:5 - (ae-undocumented) Missing documentation for "refreshToken". -// src/oauth/types.d.ts:49:5 - (ae-undocumented) Missing documentation for "req". -// src/oauth/types.d.ts:52:1 - (ae-undocumented) Missing documentation for "OAuthAuthenticatorResult". -// src/oauth/types.d.ts:53:5 - (ae-undocumented) Missing documentation for "fullProfile". -// src/oauth/types.d.ts:54:5 - (ae-undocumented) Missing documentation for "session". -// src/oauth/types.d.ts:57:1 - (ae-undocumented) Missing documentation for "OAuthAuthenticator". -// src/oauth/types.d.ts:58:5 - (ae-undocumented) Missing documentation for "defaultProfileTransform". -// src/oauth/types.d.ts:60:5 - (ae-undocumented) Missing documentation for "shouldPersistScopes". -// src/oauth/types.d.ts:61:5 - (ae-undocumented) Missing documentation for "scopes". -// src/oauth/types.d.ts:62:5 - (ae-undocumented) Missing documentation for "initialize". -// src/oauth/types.d.ts:66:5 - (ae-undocumented) Missing documentation for "start". -// src/oauth/types.d.ts:70:5 - (ae-undocumented) Missing documentation for "authenticate". -// src/oauth/types.d.ts:71:5 - (ae-undocumented) Missing documentation for "refresh". -// src/oauth/types.d.ts:72:5 - (ae-undocumented) Missing documentation for "logout". -// src/oauth/types.d.ts:75:1 - (ae-undocumented) Missing documentation for "createOAuthAuthenticator". -// src/passport/PassportHelpers.d.ts:6:1 - (ae-undocumented) Missing documentation for "PassportHelpers". -// src/passport/PassportHelpers.d.ts:8:5 - (ae-undocumented) Missing documentation for "transformProfile". -// src/passport/PassportHelpers.d.ts:9:5 - (ae-undocumented) Missing documentation for "executeRedirectStrategy". -// src/passport/PassportHelpers.d.ts:19:5 - (ae-undocumented) Missing documentation for "executeFrameHandlerStrategy". -// src/passport/PassportHelpers.d.ts:23:5 - (ae-undocumented) Missing documentation for "executeRefreshTokenStrategy". -// src/passport/PassportHelpers.d.ts:34:5 - (ae-undocumented) Missing documentation for "executeFetchUserProfileStrategy". -// src/passport/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "PassportProfile". -// src/passport/types.d.ts:9:1 - (ae-undocumented) Missing documentation for "PassportDoneCallback". -// src/proxy/createProxyAuthProviderFactory.d.ts:5:1 - (ae-undocumented) Missing documentation for "createProxyAuthProviderFactory". -// src/proxy/createProxyRouteHandlers.d.ts:5:1 - (ae-undocumented) Missing documentation for "ProxyAuthRouteHandlersOptions". -// src/proxy/createProxyRouteHandlers.d.ts:6:5 - (ae-undocumented) Missing documentation for "authenticator". -// src/proxy/createProxyRouteHandlers.d.ts:7:5 - (ae-undocumented) Missing documentation for "config". -// src/proxy/createProxyRouteHandlers.d.ts:8:5 - (ae-undocumented) Missing documentation for "resolverContext". -// src/proxy/createProxyRouteHandlers.d.ts:9:5 - (ae-undocumented) Missing documentation for "signInResolver". -// src/proxy/createProxyRouteHandlers.d.ts:10:5 - (ae-undocumented) Missing documentation for "profileTransform". -// src/proxy/createProxyRouteHandlers.d.ts:13:1 - (ae-undocumented) Missing documentation for "createProxyAuthRouteHandlers". -// src/proxy/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "ProxyAuthenticator". -// src/proxy/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "defaultProfileTransform". -// src/proxy/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "initialize". -// src/proxy/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "authenticate". -// src/proxy/types.d.ts:18:1 - (ae-undocumented) Missing documentation for "createProxyAuthenticator". -// src/sign-in/createSignInResolverFactory.d.ts:5:1 - (ae-undocumented) Missing documentation for "SignInResolverFactory". -// src/sign-in/createSignInResolverFactory.d.ts:6:5 - (ae-undocumented) Missing documentation for "__call". -// src/sign-in/createSignInResolverFactory.d.ts:7:5 - (ae-undocumented) Missing documentation for "optionsJsonSchema". -// src/sign-in/createSignInResolverFactory.d.ts:10:1 - (ae-undocumented) Missing documentation for "SignInResolverFactoryOptions". -// src/sign-in/createSignInResolverFactory.d.ts:11:5 - (ae-undocumented) Missing documentation for "optionsSchema". -// src/sign-in/createSignInResolverFactory.d.ts:12:5 - (ae-undocumented) Missing documentation for "create". -// src/sign-in/createSignInResolverFactory.d.ts:15:1 - (ae-undocumented) Missing documentation for "createSignInResolverFactory". -// src/sign-in/readDeclarativeSignInResolver.d.ts:5:1 - (ae-undocumented) Missing documentation for "ReadDeclarativeSignInResolverOptions". -// src/sign-in/readDeclarativeSignInResolver.d.ts:6:5 - (ae-undocumented) Missing documentation for "config". -// src/sign-in/readDeclarativeSignInResolver.d.ts:7:5 - (ae-undocumented) Missing documentation for "signInResolverFactories". -// src/sign-in/readDeclarativeSignInResolver.d.ts:12:1 - (ae-undocumented) Missing documentation for "readDeclarativeSignInResolver". -// src/types.d.ts:139:5 - (ae-undocumented) Missing documentation for "resolveOwnershipEntityRefs". -// src/types.d.ts:204:1 - (ae-undocumented) Missing documentation for "AuthProviderConfig". -// src/types.d.ts:224:1 - (ae-undocumented) Missing documentation for "AuthProviderFactory". -// src/types.d.ts:250:1 - (ae-undocumented) Missing documentation for "ClientAuthResponse". ``` diff --git a/plugins/bitbucket-cloud-common/report.api.md b/plugins/bitbucket-cloud-common/report.api.md index ebad8ff878..833a367c03 100644 --- a/plugins/bitbucket-cloud-common/report.api.md +++ b/plugins/bitbucket-cloud-common/report.api.md @@ -482,154 +482,4 @@ export class WithPagination< options?: PaginationOptions, ): AsyncGenerator, void, unknown>; } - -// Warnings were encountered during analysis: -// -// src/BitbucketCloudClient.d.ts:6:1 - (ae-undocumented) Missing documentation for "BitbucketCloudClient". -// src/BitbucketCloudClient.d.ts:8:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/BitbucketCloudClient.d.ts:10:5 - (ae-undocumented) Missing documentation for "searchCode". -// src/BitbucketCloudClient.d.ts:11:5 - (ae-undocumented) Missing documentation for "listRepositoriesByWorkspace". -// src/BitbucketCloudClient.d.ts:12:5 - (ae-undocumented) Missing documentation for "listProjectsByWorkspace". -// src/BitbucketCloudClient.d.ts:13:5 - (ae-undocumented) Missing documentation for "listWorkspaces". -// src/BitbucketCloudClient.d.ts:14:5 - (ae-undocumented) Missing documentation for "listBranchesByRepository". -// src/events/index.d.ts:3:1 - (ae-undocumented) Missing documentation for "Events". -// src/events/index.d.ts:5:5 - (ae-undocumented) Missing documentation for "RepoEvent". -// src/events/index.d.ts:6:9 - (ae-undocumented) Missing documentation for "repository". -// src/events/index.d.ts:9:9 - (ae-undocumented) Missing documentation for "actor". -// src/events/index.d.ts:12:5 - (ae-undocumented) Missing documentation for "RepoPushEvent". -// src/events/index.d.ts:13:9 - (ae-undocumented) Missing documentation for "push". -// src/events/index.d.ts:16:5 - (ae-undocumented) Missing documentation for "RepoPush". -// src/events/index.d.ts:17:9 - (ae-undocumented) Missing documentation for "changes". -// src/events/index.d.ts:20:5 - (ae-undocumented) Missing documentation for "Change". -// src/events/index.d.ts:21:9 - (ae-undocumented) Missing documentation for "old". -// src/events/index.d.ts:22:9 - (ae-undocumented) Missing documentation for "new". -// src/events/index.d.ts:23:9 - (ae-undocumented) Missing documentation for "truncated". -// src/events/index.d.ts:24:9 - (ae-undocumented) Missing documentation for "created". -// src/events/index.d.ts:25:9 - (ae-undocumented) Missing documentation for "forced". -// src/events/index.d.ts:26:9 - (ae-undocumented) Missing documentation for "closed". -// src/events/index.d.ts:27:9 - (ae-undocumented) Missing documentation for "links". -// src/events/index.d.ts:28:9 - (ae-undocumented) Missing documentation for "commits". -// src/events/index.d.ts:31:5 - (ae-undocumented) Missing documentation for "ChangeLinks". -// src/events/index.d.ts:32:9 - (ae-undocumented) Missing documentation for "commits". -// src/events/index.d.ts:33:9 - (ae-undocumented) Missing documentation for "diff". -// src/events/index.d.ts:34:9 - (ae-undocumented) Missing documentation for "html". -// src/models/index.d.ts:13:1 - (ae-undocumented) Missing documentation for "Models". -// src/models/index.d.ts:19:9 - (ae-undocumented) Missing documentation for "created_on". -// src/models/index.d.ts:20:9 - (ae-undocumented) Missing documentation for "display_name". -// src/models/index.d.ts:21:9 - (ae-undocumented) Missing documentation for "links". -// src/models/index.d.ts:22:9 - (ae-undocumented) Missing documentation for "username". -// src/models/index.d.ts:23:9 - (ae-undocumented) Missing documentation for "uuid". -// src/models/index.d.ts:30:9 - (ae-undocumented) Missing documentation for "__index". -// src/models/index.d.ts:31:9 - (ae-undocumented) Missing documentation for "avatar". -// src/models/index.d.ts:42:9 - (ae-undocumented) Missing documentation for "user". -// src/models/index.d.ts:49:9 - (ae-undocumented) Missing documentation for "author". -// src/models/index.d.ts:50:9 - (ae-undocumented) Missing documentation for "date". -// src/models/index.d.ts:51:9 - (ae-undocumented) Missing documentation for "hash". -// src/models/index.d.ts:52:9 - (ae-undocumented) Missing documentation for "message". -// src/models/index.d.ts:53:9 - (ae-undocumented) Missing documentation for "parents". -// src/models/index.d.ts:54:9 - (ae-undocumented) Missing documentation for "summary". -// src/models/index.d.ts:59:5 - (ae-undocumented) Missing documentation for "BaseCommitSummary". -// src/models/index.d.ts:92:9 - (ae-undocumented) Missing documentation for "links". -// src/models/index.d.ts:97:9 - (ae-undocumented) Missing documentation for "target". -// src/models/index.d.ts:98:9 - (ae-undocumented) Missing documentation for "type". -// src/models/index.d.ts:127:9 - (ae-undocumented) Missing documentation for "participants". -// src/models/index.d.ts:128:9 - (ae-undocumented) Missing documentation for "repository". -// src/models/index.d.ts:135:9 - (ae-undocumented) Missing documentation for "__index". -// src/models/index.d.ts:136:9 - (ae-undocumented) Missing documentation for "attributes". -// src/models/index.d.ts:137:9 - (ae-undocumented) Missing documentation for "commit". -// src/models/index.d.ts:146:9 - (ae-undocumented) Missing documentation for "type". -// src/models/index.d.ts:151:11 - (ae-undocumented) Missing documentation for "CommitFileAttributesEnum". -// src/models/index.d.ts:161:5 - (ae-undocumented) Missing documentation for "CommitFileAttributesEnum". -// src/models/index.d.ts:167:9 - (ae-undocumented) Missing documentation for "href". -// src/models/index.d.ts:168:9 - (ae-undocumented) Missing documentation for "name". -// src/models/index.d.ts:175:9 - (ae-undocumented) Missing documentation for "__index". -// src/models/index.d.ts:176:9 - (ae-undocumented) Missing documentation for "type". -// src/models/index.d.ts:253:9 - (ae-undocumented) Missing documentation for "approved". -// src/models/index.d.ts:258:9 - (ae-undocumented) Missing documentation for "role". -// src/models/index.d.ts:259:9 - (ae-undocumented) Missing documentation for "state". -// src/models/index.d.ts:260:9 - (ae-undocumented) Missing documentation for "user". -// src/models/index.d.ts:265:11 - (ae-undocumented) Missing documentation for "ParticipantRoleEnum". -// src/models/index.d.ts:272:5 - (ae-undocumented) Missing documentation for "ParticipantRoleEnum". -// src/models/index.d.ts:276:11 - (ae-undocumented) Missing documentation for "ParticipantStateEnum". -// src/models/index.d.ts:284:5 - (ae-undocumented) Missing documentation for "ParticipantStateEnum". -// src/models/index.d.ts:291:9 - (ae-undocumented) Missing documentation for "created_on". -// src/models/index.d.ts:292:9 - (ae-undocumented) Missing documentation for "description". -// src/models/index.d.ts:310:9 - (ae-undocumented) Missing documentation for "links". -// src/models/index.d.ts:315:9 - (ae-undocumented) Missing documentation for "owner". -// src/models/index.d.ts:316:9 - (ae-undocumented) Missing documentation for "updated_on". -// src/models/index.d.ts:325:5 - (ae-undocumented) Missing documentation for "ProjectLinks". -// src/models/index.d.ts:326:9 - (ae-undocumented) Missing documentation for "avatar". -// src/models/index.d.ts:327:9 - (ae-undocumented) Missing documentation for "html". -// src/models/index.d.ts:332:5 - (ae-undocumented) Missing documentation for "RefLinks". -// src/models/index.d.ts:333:9 - (ae-undocumented) Missing documentation for "commits". -// src/models/index.d.ts:334:9 - (ae-undocumented) Missing documentation for "html". -// src/models/index.d.ts:335:9 - (ae-undocumented) Missing documentation for "self". -// src/models/index.d.ts:342:9 - (ae-undocumented) Missing documentation for "created_on". -// src/models/index.d.ts:343:9 - (ae-undocumented) Missing documentation for "description". -// src/models/index.d.ts:372:9 - (ae-undocumented) Missing documentation for "is_private". -// src/models/index.d.ts:373:9 - (ae-undocumented) Missing documentation for "language". -// src/models/index.d.ts:374:9 - (ae-undocumented) Missing documentation for "links". -// src/models/index.d.ts:375:9 - (ae-undocumented) Missing documentation for "mainbranch". -// src/models/index.d.ts:376:9 - (ae-undocumented) Missing documentation for "name". -// src/models/index.d.ts:377:9 - (ae-undocumented) Missing documentation for "owner". -// src/models/index.d.ts:378:9 - (ae-undocumented) Missing documentation for "parent". -// src/models/index.d.ts:379:9 - (ae-undocumented) Missing documentation for "project". -// src/models/index.d.ts:380:9 - (ae-undocumented) Missing documentation for "scm". -// src/models/index.d.ts:381:9 - (ae-undocumented) Missing documentation for "size". -// src/models/index.d.ts:386:9 - (ae-undocumented) Missing documentation for "updated_on". -// src/models/index.d.ts:421:11 - (ae-undocumented) Missing documentation for "RepositoryScmEnum". -// src/models/index.d.ts:427:5 - (ae-undocumented) Missing documentation for "RepositoryScmEnum". -// src/models/index.d.ts:431:5 - (ae-undocumented) Missing documentation for "RepositoryLinks". -// src/models/index.d.ts:432:9 - (ae-undocumented) Missing documentation for "avatar". -// src/models/index.d.ts:433:9 - (ae-undocumented) Missing documentation for "clone". -// src/models/index.d.ts:434:9 - (ae-undocumented) Missing documentation for "commits". -// src/models/index.d.ts:435:9 - (ae-undocumented) Missing documentation for "downloads". -// src/models/index.d.ts:436:9 - (ae-undocumented) Missing documentation for "forks". -// src/models/index.d.ts:437:9 - (ae-undocumented) Missing documentation for "hooks". -// src/models/index.d.ts:438:9 - (ae-undocumented) Missing documentation for "html". -// src/models/index.d.ts:439:9 - (ae-undocumented) Missing documentation for "pullrequests". -// src/models/index.d.ts:440:9 - (ae-undocumented) Missing documentation for "self". -// src/models/index.d.ts:441:9 - (ae-undocumented) Missing documentation for "watchers". -// src/models/index.d.ts:446:5 - (ae-undocumented) Missing documentation for "SearchCodeSearchResult". -// src/models/index.d.ts:447:9 - (ae-undocumented) Missing documentation for "content_match_count". -// src/models/index.d.ts:448:9 - (ae-undocumented) Missing documentation for "content_matches". -// src/models/index.d.ts:449:9 - (ae-undocumented) Missing documentation for "file". -// src/models/index.d.ts:450:9 - (ae-undocumented) Missing documentation for "path_matches". -// src/models/index.d.ts:451:9 - (ae-undocumented) Missing documentation for "type". -// src/models/index.d.ts:456:5 - (ae-undocumented) Missing documentation for "SearchContentMatch". -// src/models/index.d.ts:457:9 - (ae-undocumented) Missing documentation for "lines". -// src/models/index.d.ts:462:5 - (ae-undocumented) Missing documentation for "SearchLine". -// src/models/index.d.ts:463:9 - (ae-undocumented) Missing documentation for "line". -// src/models/index.d.ts:464:9 - (ae-undocumented) Missing documentation for "segments". -// src/models/index.d.ts:469:5 - (ae-undocumented) Missing documentation for "SearchResultPage". -// src/models/index.d.ts:470:9 - (ae-undocumented) Missing documentation for "query_substituted". -// src/models/index.d.ts:479:5 - (ae-undocumented) Missing documentation for "SearchSegment". -// src/models/index.d.ts:480:9 - (ae-undocumented) Missing documentation for "match". -// src/models/index.d.ts:481:9 - (ae-undocumented) Missing documentation for "text". -// src/models/index.d.ts:488:9 - (ae-undocumented) Missing documentation for "links". -// src/models/index.d.ts:495:9 - (ae-undocumented) Missing documentation for "html". -// src/models/index.d.ts:496:9 - (ae-undocumented) Missing documentation for "members". -// src/models/index.d.ts:497:9 - (ae-undocumented) Missing documentation for "projects". -// src/models/index.d.ts:498:9 - (ae-undocumented) Missing documentation for "repositories". -// src/models/index.d.ts:499:9 - (ae-undocumented) Missing documentation for "self". -// src/models/index.d.ts:507:9 - (ae-undocumented) Missing documentation for "created_on". -// src/models/index.d.ts:513:9 - (ae-undocumented) Missing documentation for "links". -// src/models/index.d.ts:522:9 - (ae-undocumented) Missing documentation for "updated_on". -// src/models/index.d.ts:531:5 - (ae-undocumented) Missing documentation for "WorkspaceLinks". -// src/models/index.d.ts:532:9 - (ae-undocumented) Missing documentation for "avatar". -// src/models/index.d.ts:533:9 - (ae-undocumented) Missing documentation for "html". -// src/models/index.d.ts:534:9 - (ae-undocumented) Missing documentation for "members". -// src/models/index.d.ts:535:9 - (ae-undocumented) Missing documentation for "owners". -// src/models/index.d.ts:536:9 - (ae-undocumented) Missing documentation for "projects". -// src/models/index.d.ts:537:9 - (ae-undocumented) Missing documentation for "repositories". -// src/models/index.d.ts:538:9 - (ae-undocumented) Missing documentation for "self". -// src/models/index.d.ts:539:9 - (ae-undocumented) Missing documentation for "snippets". -// src/pagination.d.ts:3:1 - (ae-undocumented) Missing documentation for "PaginationOptions". -// src/pagination.d.ts:8:1 - (ae-undocumented) Missing documentation for "WithPagination". -// src/pagination.d.ts:12:5 - (ae-undocumented) Missing documentation for "getPage". -// src/pagination.d.ts:13:5 - (ae-undocumented) Missing documentation for "iteratePages". -// src/pagination.d.ts:14:5 - (ae-undocumented) Missing documentation for "iterateResults". -// src/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "FilterAndSortOptions". -// src/types.d.ts:8:1 - (ae-undocumented) Missing documentation for "PartialResponseOptions". -// src/types.d.ts:12:1 - (ae-undocumented) Missing documentation for "RequestOptions". ``` diff --git a/plugins/catalog-backend-module-aws/report-alpha.api.md b/plugins/catalog-backend-module-aws/report-alpha.api.md index 2d9ceaec2d..efaf350e99 100644 --- a/plugins/catalog-backend-module-aws/report-alpha.api.md +++ b/plugins/catalog-backend-module-aws/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-aws/report.api.md b/plugins/catalog-backend-module-aws/report.api.md index c0e5653190..beb951df7e 100644 --- a/plugins/catalog-backend-module-aws/report.api.md +++ b/plugins/catalog-backend-module-aws/report.api.md @@ -117,17 +117,4 @@ export type EksClusterEntityTransformer = ( cluster: Cluster, accountId: string, ) => Promise; - -// Warnings were encountered during analysis: -// -// src/processors/AwsEKSClusterProcessor.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/AwsEKSClusterProcessor.d.ts:26:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/AwsEKSClusterProcessor.d.ts:27:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/processors/AwsOrganizationCloudAccountProcessor.d.ts:17:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/AwsOrganizationCloudAccountProcessor.d.ts:21:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/AwsOrganizationCloudAccountProcessor.d.ts:22:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/processors/AwsS3DiscoveryProcessor.d.ts:15:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/AwsS3DiscoveryProcessor.d.ts:16:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/providers/AwsS3EntityProvider.d.ts:20:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/AwsS3EntityProvider.d.ts:31:5 - (ae-undocumented) Missing documentation for "refresh". ``` diff --git a/plugins/catalog-backend-module-azure/report-alpha.api.md b/plugins/catalog-backend-module-azure/report-alpha.api.md index 1be3e1481f..3336b07e09 100644 --- a/plugins/catalog-backend-module-azure/report-alpha.api.md +++ b/plugins/catalog-backend-module-azure/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-azure/report.api.md b/plugins/catalog-backend-module-azure/report.api.md index b3b7b71158..d11197d7f2 100644 --- a/plugins/catalog-backend-module-azure/report.api.md +++ b/plugins/catalog-backend-module-azure/report.api.md @@ -58,12 +58,4 @@ export class AzureDevOpsEntityProvider implements EntityProvider { // @public const catalogModuleAzureDevOpsEntityProvider: BackendFeature; export default catalogModuleAzureDevOpsEntityProvider; - -// Warnings were encountered during analysis: -// -// src/processors/AzureDevOpsDiscoveryProcessor.d.ts:26:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/AzureDevOpsDiscoveryProcessor.d.ts:33:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/AzureDevOpsDiscoveryProcessor.d.ts:34:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/providers/AzureDevOpsEntityProvider.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/AzureDevOpsEntityProvider.d.ts:29:5 - (ae-undocumented) Missing documentation for "refresh". ``` diff --git a/plugins/catalog-backend-module-backstage-openapi/report.api.md b/plugins/catalog-backend-module-backstage-openapi/report.api.md index 88ad499e84..06334182cb 100644 --- a/plugins/catalog-backend-module-backstage-openapi/report.api.md +++ b/plugins/catalog-backend-module-backstage-openapi/report.api.md @@ -18,11 +18,5 @@ export type MetaApiDocsPluginOptions = { // @public (undocumented) export const metaOpenApiDocsPluginId = 'meta-api-docs'; -// Warnings were encountered during analysis: -// -// src/index.d.ts:4:1 - (ae-undocumented) Missing documentation for "MetaApiDocsPluginOptions". -// src/index.d.ts:10:22 - (ae-undocumented) Missing documentation for "metaOpenApiDocsPluginId". -// src/index.d.ts:14:22 - (ae-undocumented) Missing documentation for "catalogModuleInternalOpenApiSpec". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-cloud/report-alpha.api.md b/plugins/catalog-backend-module-bitbucket-cloud/report-alpha.api.md index 418327eb07..ae6ba51eff 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/report-alpha.api.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-cloud/report.api.md b/plugins/catalog-backend-module-bitbucket-cloud/report.api.md index 19e835913f..77b20e44f1 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/report.api.md +++ b/plugins/catalog-backend-module-bitbucket-cloud/report.api.md @@ -41,11 +41,4 @@ export class BitbucketCloudEntityProvider implements EntityProvider { // @public (undocumented) const catalogModuleBitbucketCloudEntityProvider: BackendFeature; export default catalogModuleBitbucketCloudEntityProvider; - -// Warnings were encountered during analysis: -// -// src/module/catalogModuleBitbucketCloudEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleBitbucketCloudEntityProvider". -// src/providers/BitbucketCloudEntityProvider.d.ts:26:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/BitbucketCloudEntityProvider.d.ts:42:5 - (ae-undocumented) Missing documentation for "refresh". -// src/providers/BitbucketCloudEntityProvider.d.ts:44:5 - (ae-undocumented) Missing documentation for "onRepoPush". ``` diff --git a/plugins/catalog-backend-module-bitbucket-server/report-alpha.api.md b/plugins/catalog-backend-module-bitbucket-server/report-alpha.api.md index 60f05fac26..06212c3c60 100644 --- a/plugins/catalog-backend-module-bitbucket-server/report-alpha.api.md +++ b/plugins/catalog-backend-module-bitbucket-server/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-bitbucket-server/report.api.md b/plugins/catalog-backend-module-bitbucket-server/report.api.md index 41b0d398ab..b2a0a9368a 100644 --- a/plugins/catalog-backend-module-bitbucket-server/report.api.md +++ b/plugins/catalog-backend-module-bitbucket-server/report.api.md @@ -114,20 +114,4 @@ export type BitbucketServerRepository = { // @public (undocumented) const catalogModuleBitbucketServerEntityProvider: BackendFeature; export default catalogModuleBitbucketServerEntityProvider; - -// Warnings were encountered during analysis: -// -// src/lib/BitbucketServerClient.d.ts:11:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/lib/BitbucketServerClient.d.ts:17:5 - (ae-undocumented) Missing documentation for "listProjects". -// src/lib/BitbucketServerClient.d.ts:20:5 - (ae-undocumented) Missing documentation for "listRepositories". -// src/lib/BitbucketServerClient.d.ts:24:5 - (ae-undocumented) Missing documentation for "getFile". -// src/lib/BitbucketServerClient.d.ts:29:5 - (ae-undocumented) Missing documentation for "getRepository". -// src/lib/BitbucketServerClient.d.ts:33:5 - (ae-undocumented) Missing documentation for "resolvePath". -// src/lib/BitbucketServerClient.d.ts:48:1 - (ae-undocumented) Missing documentation for "BitbucketServerListOptions". -// src/lib/BitbucketServerClient.d.ts:56:1 - (ae-undocumented) Missing documentation for "BitbucketServerPagedResponse". -// src/lib/types.d.ts:2:1 - (ae-undocumented) Missing documentation for "BitbucketServerRepository". -// src/lib/types.d.ts:14:1 - (ae-undocumented) Missing documentation for "BitbucketServerProject". -// src/module/catalogModuleBitbucketServerEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleBitbucketServerEntityProvider". -// src/providers/BitbucketServerEntityProvider.d.ts:20:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/BitbucketServerEntityProvider.d.ts:32:5 - (ae-undocumented) Missing documentation for "refresh". ``` diff --git a/plugins/catalog-backend-module-gcp/report.api.md b/plugins/catalog-backend-module-gcp/report.api.md index cf490f09ae..6260d07c88 100644 --- a/plugins/catalog-backend-module-gcp/report.api.md +++ b/plugins/catalog-backend-module-gcp/report.api.md @@ -46,12 +46,4 @@ export class GkeEntityProvider implements EntityProvider { // (undocumented) refresh(): Promise; } - -// Warnings were encountered during analysis: -// -// src/providers/GkeEntityProvider.d.ts:17:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/GkeEntityProvider.d.ts:22:5 - (ae-undocumented) Missing documentation for "fromConfigWithClient". -// src/providers/GkeEntityProvider.d.ts:28:5 - (ae-undocumented) Missing documentation for "getProviderName". -// src/providers/GkeEntityProvider.d.ts:29:5 - (ae-undocumented) Missing documentation for "connect". -// src/providers/GkeEntityProvider.d.ts:35:5 - (ae-undocumented) Missing documentation for "refresh". ``` diff --git a/plugins/catalog-backend-module-gerrit/report-alpha.api.md b/plugins/catalog-backend-module-gerrit/report-alpha.api.md index 741c105577..59ce95dd4f 100644 --- a/plugins/catalog-backend-module-gerrit/report-alpha.api.md +++ b/plugins/catalog-backend-module-gerrit/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gerrit/report.api.md b/plugins/catalog-backend-module-gerrit/report.api.md index 76866fe76a..8f8cd60e4e 100644 --- a/plugins/catalog-backend-module-gerrit/report.api.md +++ b/plugins/catalog-backend-module-gerrit/report.api.md @@ -34,14 +34,5 @@ export class GerritEntityProvider implements EntityProvider { refresh(logger: LoggerService): Promise; } -// Warnings were encountered during analysis: -// -// src/module/catalogModuleGerritEntityProvider.d.ts:4:22 - (ae-undocumented) Missing documentation for "catalogModuleGerritEntityProvider". -// src/providers/GerritEntityProvider.d.ts:5:1 - (ae-undocumented) Missing documentation for "GerritEntityProvider". -// src/providers/GerritEntityProvider.d.ts:11:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/GerritEntityProvider.d.ts:17:5 - (ae-undocumented) Missing documentation for "getProviderName". -// src/providers/GerritEntityProvider.d.ts:18:5 - (ae-undocumented) Missing documentation for "connect". -// src/providers/GerritEntityProvider.d.ts:20:5 - (ae-undocumented) Missing documentation for "refresh". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-github/report-alpha.api.md b/plugins/catalog-backend-module-github/report-alpha.api.md index fbe98b714e..4e596df822 100644 --- a/plugins/catalog-backend-module-github/report-alpha.api.md +++ b/plugins/catalog-backend-module-github/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-github/report.api.md b/plugins/catalog-backend-module-github/report.api.md index e81d0a0e81..dcc94e47bc 100644 --- a/plugins/catalog-backend-module-github/report.api.md +++ b/plugins/catalog-backend-module-github/report.api.md @@ -323,41 +323,4 @@ export type UserTransformer = ( item: GithubUser, ctx: TransformerContext, ) => Promise; - -// Warnings were encountered during analysis: -// -// src/analyzers/GithubLocationAnalyzer.d.ts:8:1 - (ae-undocumented) Missing documentation for "GithubLocationAnalyzerOptions". -// src/analyzers/GithubLocationAnalyzer.d.ts:17:1 - (ae-undocumented) Missing documentation for "GithubLocationAnalyzer". -// src/analyzers/GithubLocationAnalyzer.d.ts:23:5 - (ae-undocumented) Missing documentation for "supports". -// src/analyzers/GithubLocationAnalyzer.d.ts:24:5 - (ae-undocumented) Missing documentation for "analyze". -// src/deprecated.d.ts:9:1 - (ae-undocumented) Missing documentation for "GitHubOrgEntityProvider". -// src/deprecated.d.ts:10:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/deprecated.d.ts:16:1 - (ae-undocumented) Missing documentation for "GitHubOrgEntityProviderOptions". -// src/deprecated.d.ts:21:1 - (ae-undocumented) Missing documentation for "GitHubEntityProvider". -// src/deprecated.d.ts:23:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/deprecated.d.ts:29:5 - (ae-undocumented) Missing documentation for "connect". -// src/deprecated.d.ts:30:5 - (ae-undocumented) Missing documentation for "getProviderName". -// src/deprecated.d.ts:31:5 - (ae-undocumented) Missing documentation for "refresh". -// src/lib/defaultTransformers.d.ts:10:5 - (ae-undocumented) Missing documentation for "client". -// src/lib/defaultTransformers.d.ts:11:5 - (ae-undocumented) Missing documentation for "query". -// src/lib/defaultTransformers.d.ts:12:5 - (ae-undocumented) Missing documentation for "org". -// src/processors/GithubDiscoveryProcessor.d.ts:25:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/GithubDiscoveryProcessor.d.ts:34:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/GithubDiscoveryProcessor.d.ts:35:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/processors/GithubMultiOrgReaderProcessor.d.ts:19:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/GithubMultiOrgReaderProcessor.d.ts:33:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/GithubMultiOrgReaderProcessor.d.ts:34:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/processors/GithubOrgReaderProcessor.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/GithubOrgReaderProcessor.d.ts:27:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/GithubOrgReaderProcessor.d.ts:28:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/providers/GithubEntityProvider.d.ts:21:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/GithubEntityProvider.d.ts:33:5 - (ae-undocumented) Missing documentation for "refresh". -// src/providers/GithubEntityProvider.d.ts:51:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/providers/GithubEntityProvider.d.ts:60:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/providers/GithubEntityProvider.d.ts:71:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/providers/GithubEntityProvider.d.ts:81:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/providers/GithubEntityProvider.d.ts:93:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/providers/GithubEntityProvider.d.ts:102:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/providers/GithubMultiOrgEntityProvider.d.ts:84:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/GithubOrgEntityProvider.d.ts:71:5 - (ae-undocumented) Missing documentation for "fromConfig". ``` diff --git a/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.ts b/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.ts index 1c64174ee7..5c6dc75e48 100644 --- a/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.ts +++ b/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.ts @@ -472,7 +472,6 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { * Removes all entities associated with the repository. * * @param event - The repository archived event. - * @private */ private async onRepoArchived(event: RepositoryArchivedEvent) { const repository = this.createRepoFromEvent(event); @@ -488,7 +487,6 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { * Removes all entities associated with the repository. * * @param event - The repository deleted event. - * @private */ private async onRepoDeleted(event: RepositoryDeletedEvent) { const repository = this.createRepoFromEvent(event); @@ -506,7 +504,6 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { * Removes all entities associated with the repository if the repository no longer matches the filters. * * @param event - The repository edited event. - * @private */ private async onRepoEdited(event: RepositoryEditedEvent) { const repository = this.createRepoFromEvent(event); @@ -525,7 +522,6 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { * Creates new entities for the repository's new name if it still matches the filters. * * @param event - The repository renamed event. - * @private */ private async onRepoRenamed(event: RepositoryRenamedEvent) { const repository = this.createRepoFromEvent(event); @@ -560,7 +556,6 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { * Creates new entities for the repository if it matches the filters. * * @param event - The repository unarchived event. - * @private */ private async onRepoTransferred(event: RepositoryTransferredEvent) { const repository = this.createRepoFromEvent(event); @@ -582,7 +577,6 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { * Creates new entities for the repository if it matches the filters. * * @param event - The repository unarchived event. - * @private */ private async onRepoUnarchived(event: RepositoryUnarchivedEvent) { const repository = this.createRepoFromEvent(event); diff --git a/plugins/catalog-backend-module-gitlab/report-alpha.api.md b/plugins/catalog-backend-module-gitlab/report-alpha.api.md index 350411a6dc..e8ef479d82 100644 --- a/plugins/catalog-backend-module-gitlab/report-alpha.api.md +++ b/plugins/catalog-backend-module-gitlab/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-gitlab/report.api.md b/plugins/catalog-backend-module-gitlab/report.api.md index 07612bca88..890ca29eca 100644 --- a/plugins/catalog-backend-module-gitlab/report.api.md +++ b/plugins/catalog-backend-module-gitlab/report.api.md @@ -176,29 +176,4 @@ export interface UserTransformerOptions { // (undocumented) user: GitLabUser; } - -// Warnings were encountered during analysis: -// -// src/GitLabDiscoveryProcessor.d.ts:14:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/GitLabDiscoveryProcessor.d.ts:20:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/GitLabDiscoveryProcessor.d.ts:21:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/lib/types.d.ts:48:1 - (ae-undocumented) Missing documentation for "GitLabGroupSamlIdentity". -// src/lib/types.d.ts:234:5 - (ae-undocumented) Missing documentation for "group". -// src/lib/types.d.ts:235:5 - (ae-undocumented) Missing documentation for "providerConfig". -// src/lib/types.d.ts:249:5 - (ae-undocumented) Missing documentation for "user". -// src/lib/types.d.ts:250:5 - (ae-undocumented) Missing documentation for "integrationConfig". -// src/lib/types.d.ts:251:5 - (ae-undocumented) Missing documentation for "providerConfig". -// src/lib/types.d.ts:252:5 - (ae-undocumented) Missing documentation for "groupNameTransformer". -// src/lib/types.d.ts:266:5 - (ae-undocumented) Missing documentation for "groups". -// src/lib/types.d.ts:267:5 - (ae-undocumented) Missing documentation for "providerConfig". -// src/lib/types.d.ts:268:5 - (ae-undocumented) Missing documentation for "groupNameTransformer". -// src/providers/GitlabDiscoveryEntityProvider.d.ts:21:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/GitlabDiscoveryEntityProvider.d.ts:33:5 - (ae-undocumented) Missing documentation for "getProviderName". -// src/providers/GitlabDiscoveryEntityProvider.d.ts:34:5 - (ae-undocumented) Missing documentation for "connect". -// src/providers/GitlabDiscoveryEntityProvider.d.ts:75:15 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' -// src/providers/GitlabDiscoveryEntityProvider.d.ts:76:30 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/providers/GitlabDiscoveryEntityProvider.d.ts:76:17 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:21:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:31:5 - (ae-undocumented) Missing documentation for "getProviderName". -// src/providers/GitlabOrgDiscoveryEntityProvider.d.ts:32:5 - (ae-undocumented) Missing documentation for "connect". ``` diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts index fdd884e1fd..0ac45b93e1 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts @@ -418,8 +418,8 @@ export class GitlabDiscoveryEntityProvider implements EntityProvider { /** * Converts a target URL to a LocationSpec object. * - * @param {string} target - The target URL to be converted. - * @returns {LocationSpec} The LocationSpec object representing the URL. + * @param target - The target URL to be converted. + * @returns The LocationSpec object representing the URL. */ private toLocationSpec(target: string): LocationSpec { return { diff --git a/plugins/catalog-backend-module-incremental-ingestion/report-alpha.api.md b/plugins/catalog-backend-module-incremental-ingestion/report-alpha.api.md index 8f3a5fa780..cb1bb63d00 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/report-alpha.api.md +++ b/plugins/catalog-backend-module-incremental-ingestion/report-alpha.api.md @@ -4,28 +4,10 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -import { ExtensionPoint } from '@backstage/backend-plugin-api'; -import { IncrementalEntityProvider } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; -import { IncrementalEntityProviderOptions } from '@backstage/plugin-catalog-backend-module-incremental-ingestion'; // @alpha (undocumented) const _feature: BackendFeature; export default _feature; -// Warning: (ae-forgotten-export) The symbol "IncrementalIngestionProviderExtensionPoint_2" needs to be exported by the entry point alpha.d.ts -// -// @alpha (undocumented) -export type IncrementalIngestionProviderExtensionPoint = - IncrementalIngestionProviderExtensionPoint_2; - -// @alpha (undocumented) -export const incrementalIngestionProvidersExtensionPoint: ExtensionPoint; - -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". -// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "IncrementalIngestionProviderExtensionPoint". -// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "incrementalIngestionProvidersExtensionPoint". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-incremental-ingestion/report.api.md b/plugins/catalog-backend-module-incremental-ingestion/report.api.md index 4b7e473b48..9686a7ca57 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/report.api.md +++ b/plugins/catalog-backend-module-incremental-ingestion/report.api.md @@ -113,12 +113,4 @@ export type PluginEnvironment = { reader: UrlReaderService; permissions: PermissionEvaluator; }; - -// Warnings were encountered during analysis: -// -// src/service/IncrementalCatalogBuilder.d.ts:6:1 - (ae-undocumented) Missing documentation for "IncrementalCatalogBuilder". -// src/service/IncrementalCatalogBuilder.d.ts:20:5 - (ae-undocumented) Missing documentation for "build". -// src/service/IncrementalCatalogBuilder.d.ts:23:5 - (ae-undocumented) Missing documentation for "addIncrementalEntityProvider". -// src/types.d.ts:106:1 - (ae-undocumented) Missing documentation for "IncrementalEntityProviderOptions". -// src/types.d.ts:145:1 - (ae-undocumented) Missing documentation for "PluginEnvironment". ``` diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/alpha.ts b/plugins/catalog-backend-module-incremental-ingestion/src/alpha.ts index ee9c7ff415..cba672ce49 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/alpha.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/alpha.ts @@ -15,16 +15,7 @@ */ import { default as feature } from './module'; -import { - IncrementalIngestionProviderExtensionPoint as ExtensionPoint, - incrementalIngestionProvidersExtensionPoint as extensionPoint, -} from './module'; /** @alpha */ const _feature = feature; export default _feature; - -/** @alpha */ -export type IncrementalIngestionProviderExtensionPoint = ExtensionPoint; -/** @alpha */ -export const incrementalIngestionProvidersExtensionPoint = extensionPoint; diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/run.ts b/plugins/catalog-backend-module-incremental-ingestion/src/run.ts index 1a98c478a1..89698da1de 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/run.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/run.ts @@ -24,10 +24,11 @@ import { createServiceFactory, } from '@backstage/backend-plugin-api'; import { ConfigReader } from '@backstage/config'; -import { IncrementalEntityProvider } from '.'; -import catalogModuleIncrementalIngestionEntityProvider, { +import { + IncrementalEntityProvider, incrementalIngestionProvidersExtensionPoint, -} from './alpha'; +} from '.'; +import catalogModuleIncrementalIngestionEntityProvider from './alpha'; const provider: IncrementalEntityProvider = { getProviderName: () => 'test-provider', diff --git a/plugins/catalog-backend-module-ldap/report.api.md b/plugins/catalog-backend-module-ldap/report.api.md index e8b20073a3..16546cb773 100644 --- a/plugins/catalog-backend-module-ldap/report.api.md +++ b/plugins/catalog-backend-module-ldap/report.api.md @@ -275,13 +275,4 @@ export type VendorConfig = { dnAttributeName?: string; uuidAttributeName?: string; }; - -// Warnings were encountered during analysis: -// -// src/ldap/client.d.ts:16:5 - (ae-undocumented) Missing documentation for "create". -// src/processors/LdapOrgEntityProvider.d.ts:107:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/LdapOrgEntityProvider.d.ts:108:5 - (ae-undocumented) Missing documentation for "fromLegacyConfig". -// src/processors/LdapOrgReaderProcessor.d.ts:16:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/LdapOrgReaderProcessor.d.ts:27:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/LdapOrgReaderProcessor.d.ts:28:5 - (ae-undocumented) Missing documentation for "readLocation". ``` diff --git a/plugins/catalog-backend-module-msgraph/report-alpha.api.md b/plugins/catalog-backend-module-msgraph/report-alpha.api.md index 416c335bff..da981edd8d 100644 --- a/plugins/catalog-backend-module-msgraph/report-alpha.api.md +++ b/plugins/catalog-backend-module-msgraph/report-alpha.api.md @@ -4,30 +4,10 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -import { ExtensionPoint } from '@backstage/backend-plugin-api'; -import { GroupTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; -import { OrganizationTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; -import { ProviderConfigTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; -import { UserTransformer } from '@backstage/plugin-catalog-backend-module-msgraph'; // @alpha (undocumented) const _feature: BackendFeature; export default _feature; -// Warning: (ae-forgotten-export) The symbol "MicrosoftGraphOrgEntityProviderTransformsExtensionPoint_2" needs to be exported by the entry point alpha.d.ts -// -// @alpha (undocumented) -export const microsoftGraphOrgEntityProviderTransformExtensionPoint: ExtensionPoint; - -// @alpha (undocumented) -export type MicrosoftGraphOrgEntityProviderTransformsExtensionPoint = - MicrosoftGraphOrgEntityProviderTransformsExtensionPoint_2; - -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". -// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "MicrosoftGraphOrgEntityProviderTransformsExtensionPoint". -// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "microsoftGraphOrgEntityProviderTransformExtensionPoint". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-msgraph/report.api.md b/plugins/catalog-backend-module-msgraph/report.api.md index 4d7c0966a5..35ae148a25 100644 --- a/plugins/catalog-backend-module-msgraph/report.api.md +++ b/plugins/catalog-backend-module-msgraph/report.api.md @@ -323,14 +323,4 @@ export type UserTransformer = ( user: MicrosoftGraph.User, userPhoto?: string, ) => Promise; - -// Warnings were encountered during analysis: -// -// src/microsoftGraph/client.d.ts:109:5 - (ae-undocumented) Missing documentation for "getUserPhoto". -// src/microsoftGraph/client.d.ts:129:5 - (ae-undocumented) Missing documentation for "getGroupPhoto". -// src/microsoftGraph/client.d.ts:176:5 - (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-catalog-backend-module-msgraph" does not have an export "entityName" -// src/processors/MicrosoftGraphOrgEntityProvider.d.ts:119:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:18:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:31:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/MicrosoftGraphOrgReaderProcessor.d.ts:32:5 - (ae-undocumented) Missing documentation for "readLocation". ``` diff --git a/plugins/catalog-backend-module-msgraph/src/alpha.ts b/plugins/catalog-backend-module-msgraph/src/alpha.ts index 2c0cfe2fb4..cba672ce49 100644 --- a/plugins/catalog-backend-module-msgraph/src/alpha.ts +++ b/plugins/catalog-backend-module-msgraph/src/alpha.ts @@ -15,18 +15,7 @@ */ import { default as feature } from './module'; -import { - MicrosoftGraphOrgEntityProviderTransformsExtensionPoint as ExtensionPoint, - microsoftGraphOrgEntityProviderTransformExtensionPoint as extensionPoint, -} from './module'; /** @alpha */ const _feature = feature; export default _feature; - -/** @alpha */ -export type MicrosoftGraphOrgEntityProviderTransformsExtensionPoint = - ExtensionPoint; -/** @alpha */ -export const microsoftGraphOrgEntityProviderTransformExtensionPoint = - extensionPoint; diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts index c190e2a959..2dc2a65135 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts @@ -392,7 +392,7 @@ export class MicrosoftGraphClient { * from Graph API * * @param entityName - type of parent resource, either `User` or `Group` - * @param id - The unique identifier for the {@link entityName | entityName} resource + * @param id - The unique identifier for the `entityName` resource * @param maxSize - Maximum pixel height of the photo * */ diff --git a/plugins/catalog-backend-module-openapi/report.api.md b/plugins/catalog-backend-module-openapi/report.api.md index c913e63294..d79d852387 100644 --- a/plugins/catalog-backend-module-openapi/report.api.md +++ b/plugins/catalog-backend-module-openapi/report.api.md @@ -47,14 +47,5 @@ export class OpenApiRefProcessor implements CatalogProcessor { preProcessEntity(entity: Entity, location: LocationSpec): Promise; } -// Warnings were encountered during analysis: -// -// src/OpenApiRefProcessor.d.ts:12:1 - (ae-undocumented) Missing documentation for "OpenApiRefProcessor". -// src/OpenApiRefProcessor.d.ts:16:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/OpenApiRefProcessor.d.ts:25:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/OpenApiRefProcessor.d.ts:26:5 - (ae-undocumented) Missing documentation for "preProcessEntity". -// src/index.d.ts:8:22 - (ae-undocumented) Missing documentation for "openApiPlaceholderResolver". -// src/jsonSchemaRefPlaceholderResolver.d.ts:4:1 - (ae-undocumented) Missing documentation for "jsonSchemaRefPlaceholderResolver". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend-module-puppetdb/report.api.md b/plugins/catalog-backend-module-puppetdb/report.api.md index 00874a3b2f..f6fa5bfc83 100644 --- a/plugins/catalog-backend-module-puppetdb/report.api.md +++ b/plugins/catalog-backend-module-puppetdb/report.api.md @@ -75,12 +75,4 @@ export type ResourceTransformer = ( node: PuppetNode, config: PuppetDbEntityProviderConfig, ) => Promise; - -// Warnings were encountered during analysis: -// -// src/providers/PuppetDbEntityProvider.d.ts:39:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/providers/PuppetDbEntityProvider.d.ts:41:5 - (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-catalog-backend-module-puppetdb" does not have an export "LoggerService" -// src/providers/PuppetDbEntityProvider.d.ts:41:5 - (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-catalog-backend-module-puppetdb" does not have an export "SchedulerServiceTaskRunner" -// src/providers/PuppetDbEntityProvider.d.ts:51:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration -// src/providers/PuppetDbEntityProvider.d.ts:53:5 - (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-catalog-backend-module-puppetdb" does not have an export "SchedulerServiceTaskRunner" ``` diff --git a/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.ts b/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.ts index fc13f45c39..8849e32c16 100644 --- a/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.ts +++ b/plugins/catalog-backend-module-puppetdb/src/providers/PuppetDbEntityProvider.ts @@ -99,11 +99,10 @@ export class PuppetDbEntityProvider implements EntityProvider { * Creates an instance of {@link PuppetDbEntityProvider}. * * @param config - Configuration of the provider. - * @param logger - The instance of a {@link LoggerService}. - * @param taskRunner - The instance of {@link SchedulerServiceTaskRunner}. + * @param logger - The instance of a {@link @backstage/backend-plugin-api#LoggerService}. + * @param taskRunner - The instance of {@link @backstage/backend-plugin-api#SchedulerServiceTaskRunner}. * @param transformer - A {@link ResourceTransformer} function. * - * @private */ private constructor( config: PuppetDbEntityProviderConfig, @@ -133,9 +132,7 @@ export class PuppetDbEntityProvider implements EntityProvider { /** * Creates a function that can be used to schedule a refresh of the catalog. * - * @param taskRunner - The instance of {@link SchedulerServiceTaskRunner}. - * - * @private + * @param taskRunner - The instance of {@link @backstage/backend-plugin-api#SchedulerServiceTaskRunner}. */ private createScheduleFn( taskRunner: SchedulerServiceTaskRunner, @@ -218,7 +215,7 @@ function withLocations(baseUrl: string, entity: Entity): Entity { /** * Tracks the progress of the PuppetDB read and commit operations. * - * @param logger - The instance of a {@link LoggerService}. + * @param logger - The instance of a {@link @backstage/backend-plugin-api#LoggerService}. */ function trackProgress(logger: LoggerService) { let timestamp = Date.now(); diff --git a/plugins/catalog-backend-module-scaffolder-entity-model/report.api.md b/plugins/catalog-backend-module-scaffolder-entity-model/report.api.md index e4af5d5ef5..49542b0396 100644 --- a/plugins/catalog-backend-module-scaffolder-entity-model/report.api.md +++ b/plugins/catalog-backend-module-scaffolder-entity-model/report.api.md @@ -26,10 +26,4 @@ export class ScaffolderEntitiesProcessor implements CatalogProcessor { // (undocumented) validateEntityKind(entity: Entity): Promise; } - -// Warnings were encountered during analysis: -// -// src/processor/ScaffolderEntitiesProcessor.d.ts:10:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processor/ScaffolderEntitiesProcessor.d.ts:12:5 - (ae-undocumented) Missing documentation for "validateEntityKind". -// src/processor/ScaffolderEntitiesProcessor.d.ts:13:5 - (ae-undocumented) Missing documentation for "postProcessEntity". ``` diff --git a/plugins/catalog-backend-module-unprocessed/report.api.md b/plugins/catalog-backend-module-unprocessed/report.api.md index ea3a9d974c..493082ac7c 100644 --- a/plugins/catalog-backend-module-unprocessed/report.api.md +++ b/plugins/catalog-backend-module-unprocessed/report.api.md @@ -27,9 +27,4 @@ export class UnprocessedEntitiesModule { // (undocumented) registerRoutes(): void; } - -// Warnings were encountered during analysis: -// -// src/UnprocessedEntitiesModule.d.ts:15:5 - (ae-undocumented) Missing documentation for "create". -// src/UnprocessedEntitiesModule.d.ts:26:5 - (ae-undocumented) Missing documentation for "registerRoutes". ``` diff --git a/plugins/catalog-backend/report-alpha.api.md b/plugins/catalog-backend/report-alpha.api.md index 59155670ba..d32ef323c9 100644 --- a/plugins/catalog-backend/report-alpha.api.md +++ b/plugins/catalog-backend/report-alpha.api.md @@ -146,9 +146,5 @@ export const permissionRules: { >; }; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-backend/report.api.md b/plugins/catalog-backend/report.api.md index 9294c71377..a200057a3a 100644 --- a/plugins/catalog-backend/report.api.md +++ b/plugins/catalog-backend/report.api.md @@ -483,85 +483,4 @@ export class UrlReaderProcessor implements CatalogProcessor_2 { cache: CatalogProcessorCache_2, ): Promise; } - -// Warnings were encountered during analysis: -// -// src/constants.d.ts:2:22 - (ae-undocumented) Missing documentation for "CATALOG_CONFLICTS_TOPIC". -// src/constants.d.ts:4:22 - (ae-undocumented) Missing documentation for "CATALOG_ERRORS_TOPIC". -// src/deprecated.d.ts:8:22 - (ae-undocumented) Missing documentation for "locationSpecToMetadataName". -// src/deprecated.d.ts:13:22 - (ae-undocumented) Missing documentation for "locationSpecToLocationEntity". -// src/deprecated.d.ts:18:22 - (ae-undocumented) Missing documentation for "processingResult". -// src/deprecated.d.ts:31:1 - (ae-undocumented) Missing documentation for "EntitiesSearchFilter". -// src/deprecated.d.ts:36:1 - (ae-undocumented) Missing documentation for "EntityFilter". -// src/deprecated.d.ts:41:1 - (ae-undocumented) Missing documentation for "DeferredEntity". -// src/deprecated.d.ts:46:1 - (ae-undocumented) Missing documentation for "EntityRelationSpec". -// src/deprecated.d.ts:51:1 - (ae-undocumented) Missing documentation for "CatalogProcessor". -// src/deprecated.d.ts:56:1 - (ae-undocumented) Missing documentation for "CatalogProcessorParser". -// src/deprecated.d.ts:61:1 - (ae-undocumented) Missing documentation for "CatalogProcessorCache". -// src/deprecated.d.ts:66:1 - (ae-undocumented) Missing documentation for "CatalogProcessorEmit". -// src/deprecated.d.ts:71:1 - (ae-undocumented) Missing documentation for "CatalogProcessorLocationResult". -// src/deprecated.d.ts:76:1 - (ae-undocumented) Missing documentation for "CatalogProcessorEntityResult". -// src/deprecated.d.ts:81:1 - (ae-undocumented) Missing documentation for "CatalogProcessorRelationResult". -// src/deprecated.d.ts:86:1 - (ae-undocumented) Missing documentation for "CatalogProcessorErrorResult". -// src/deprecated.d.ts:91:1 - (ae-undocumented) Missing documentation for "CatalogProcessorRefreshKeysResult". -// src/deprecated.d.ts:96:1 - (ae-undocumented) Missing documentation for "CatalogProcessorResult". -// src/deprecated.d.ts:101:1 - (ae-undocumented) Missing documentation for "EntityProvider". -// src/deprecated.d.ts:106:1 - (ae-undocumented) Missing documentation for "EntityProviderConnection". -// src/deprecated.d.ts:111:1 - (ae-undocumented) Missing documentation for "EntityProviderMutation". -// src/deprecated.d.ts:129:1 - (ae-undocumented) Missing documentation for "AnalyzeOptions". -// src/deprecated.d.ts:134:1 - (ae-undocumented) Missing documentation for "LocationAnalyzer". -// src/deprecated.d.ts:139:1 - (ae-undocumented) Missing documentation for "ScmLocationAnalyzer". -// src/deprecated.d.ts:144:1 - (ae-undocumented) Missing documentation for "PlaceholderResolver". -// src/deprecated.d.ts:149:1 - (ae-undocumented) Missing documentation for "PlaceholderResolverParams". -// src/deprecated.d.ts:154:1 - (ae-undocumented) Missing documentation for "PlaceholderResolverRead". -// src/deprecated.d.ts:159:1 - (ae-undocumented) Missing documentation for "PlaceholderResolverResolveUrl". -// src/deprecated.d.ts:164:1 - (ae-undocumented) Missing documentation for "AnalyzeLocationRequest". -// src/deprecated.d.ts:169:1 - (ae-undocumented) Missing documentation for "AnalyzeLocationResponse". -// src/deprecated.d.ts:202:22 - (ae-undocumented) Missing documentation for "DefaultCatalogCollatorFactory". -// src/deprecated.d.ts:207:22 - (ae-undocumented) Missing documentation for "defaultCatalogCollatorEntityTransformer". -// src/deprecated.d.ts:212:1 - (ae-undocumented) Missing documentation for "DefaultCatalogCollatorFactoryOptions". -// src/deprecated.d.ts:217:1 - (ae-undocumented) Missing documentation for "CatalogCollatorEntityTransformer". -// src/processing/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "start". -// src/processing/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "stop". -// src/processors/AnnotateLocationEntityProcessor.d.ts:6:1 - (ae-undocumented) Missing documentation for "AnnotateLocationEntityProcessor". -// src/processors/AnnotateLocationEntityProcessor.d.ts:11:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/AnnotateLocationEntityProcessor.d.ts:12:5 - (ae-undocumented) Missing documentation for "preProcessEntity". -// src/processors/AnnotateScmSlugEntityProcessor.d.ts:7:1 - (ae-undocumented) Missing documentation for "AnnotateScmSlugEntityProcessor". -// src/processors/AnnotateScmSlugEntityProcessor.d.ts:13:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/AnnotateScmSlugEntityProcessor.d.ts:14:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/AnnotateScmSlugEntityProcessor.d.ts:17:5 - (ae-undocumented) Missing documentation for "preProcessEntity". -// src/processors/BuiltinKindsEntityProcessor.d.ts:5:1 - (ae-undocumented) Missing documentation for "BuiltinKindsEntityProcessor". -// src/processors/BuiltinKindsEntityProcessor.d.ts:7:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/BuiltinKindsEntityProcessor.d.ts:8:5 - (ae-undocumented) Missing documentation for "validateEntityKind". -// src/processors/BuiltinKindsEntityProcessor.d.ts:9:5 - (ae-undocumented) Missing documentation for "postProcessEntity". -// src/processors/CodeOwnersProcessor.d.ts:8:1 - (ae-undocumented) Missing documentation for "CodeOwnersProcessor". -// src/processors/CodeOwnersProcessor.d.ts:12:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/processors/CodeOwnersProcessor.d.ts:21:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/CodeOwnersProcessor.d.ts:22:5 - (ae-undocumented) Missing documentation for "preProcessEntity". -// src/processors/FileReaderProcessor.d.ts:4:1 - (ae-undocumented) Missing documentation for "FileReaderProcessor". -// src/processors/FileReaderProcessor.d.ts:5:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/FileReaderProcessor.d.ts:6:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/processors/LocationEntityProcessor.d.ts:10:1 - (ae-undocumented) Missing documentation for "LocationEntityProcessorOptions". -// src/processors/LocationEntityProcessor.d.ts:28:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/LocationEntityProcessor.d.ts:29:5 - (ae-undocumented) Missing documentation for "postProcessEntity". -// src/processors/PlaceholderProcessor.d.ts:8:1 - (ae-undocumented) Missing documentation for "PlaceholderProcessorOptions". -// src/processors/PlaceholderProcessor.d.ts:21:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/PlaceholderProcessor.d.ts:22:5 - (ae-undocumented) Missing documentation for "preProcessEntity". -// src/processors/UrlReaderProcessor.d.ts:5:1 - (ae-undocumented) Missing documentation for "UrlReaderProcessor". -// src/processors/UrlReaderProcessor.d.ts:12:5 - (ae-undocumented) Missing documentation for "getProcessorName". -// src/processors/UrlReaderProcessor.d.ts:13:5 - (ae-undocumented) Missing documentation for "readLocation". -// src/search/DefaultCatalogCollator.d.ts:11:1 - (ae-undocumented) Missing documentation for "DefaultCatalogCollator". -// src/search/DefaultCatalogCollator.d.ts:12:5 - (ae-undocumented) Missing documentation for "discovery". -// src/search/DefaultCatalogCollator.d.ts:13:5 - (ae-undocumented) Missing documentation for "locationTemplate". -// src/search/DefaultCatalogCollator.d.ts:14:5 - (ae-undocumented) Missing documentation for "filter". -// src/search/DefaultCatalogCollator.d.ts:15:5 - (ae-undocumented) Missing documentation for "catalogClient". -// src/search/DefaultCatalogCollator.d.ts:16:5 - (ae-undocumented) Missing documentation for "type". -// src/search/DefaultCatalogCollator.d.ts:17:5 - (ae-undocumented) Missing documentation for "visibilityPermission". -// src/search/DefaultCatalogCollator.d.ts:18:5 - (ae-undocumented) Missing documentation for "tokenManager". -// src/search/DefaultCatalogCollator.d.ts:19:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/search/DefaultCatalogCollator.d.ts:31:5 - (ae-undocumented) Missing documentation for "applyArgsToFormat". -// src/search/DefaultCatalogCollator.d.ts:33:5 - (ae-undocumented) Missing documentation for "execute". -// src/service/CatalogBuilder.d.ts:19:1 - (ae-undocumented) Missing documentation for "CatalogEnvironment". -// src/service/CatalogBuilder.d.ts:233:5 - (ae-undocumented) Missing documentation for "subscribe". -// src/util/parse.d.ts:6:1 - (ae-undocumented) Missing documentation for "parseEntityYaml". ``` diff --git a/plugins/catalog-common/report.api.md b/plugins/catalog-common/report.api.md index 95b1d9b6c6..231c8aac34 100644 --- a/plugins/catalog-common/report.api.md +++ b/plugins/catalog-common/report.api.md @@ -64,16 +64,4 @@ export type LocationSpec = { target: string; presence?: 'optional' | 'required'; }; - -// Warnings were encountered during analysis: -// -// src/ingestion/LocationAnalyzer.d.ts:5:1 - (ae-undocumented) Missing documentation for "AnalyzeLocationRequest". -// src/ingestion/LocationAnalyzer.d.ts:10:1 - (ae-undocumented) Missing documentation for "AnalyzeLocationResponse". -// src/ingestion/LocationAnalyzer.d.ts:39:1 - (ae-undocumented) Missing documentation for "AnalyzeLocationEntityField". -// src/search/CatalogEntityDocument.d.ts:9:5 - (ae-undocumented) Missing documentation for "componentType". -// src/search/CatalogEntityDocument.d.ts:10:5 - (ae-undocumented) Missing documentation for "type". -// src/search/CatalogEntityDocument.d.ts:11:5 - (ae-undocumented) Missing documentation for "namespace". -// src/search/CatalogEntityDocument.d.ts:12:5 - (ae-undocumented) Missing documentation for "kind". -// src/search/CatalogEntityDocument.d.ts:13:5 - (ae-undocumented) Missing documentation for "lifecycle". -// src/search/CatalogEntityDocument.d.ts:14:5 - (ae-undocumented) Missing documentation for "owner". ``` diff --git a/plugins/catalog-graph/report-alpha.api.md b/plugins/catalog-graph/report-alpha.api.md index 944fa203f1..f4699e9ceb 100644 --- a/plugins/catalog-graph/report-alpha.api.md +++ b/plugins/catalog-graph/report-alpha.api.md @@ -165,9 +165,5 @@ const _default: FrontendPlugin< >; export default _default; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-graph/report.api.md b/plugins/catalog-graph/report.api.md index b6e7388ac0..3f2dff2560 100644 --- a/plugins/catalog-graph/report.api.md +++ b/plugins/catalog-graph/report.api.md @@ -140,11 +140,4 @@ export type EntityRelationsGraphProps = { // @public export type RelationPairs = [string, string][]; - -// Warnings were encountered during analysis: -// -// src/components/EntityRelationsGraph/DefaultRenderLabel.d.ts:5:1 - (ae-undocumented) Missing documentation for "CustomLabelClassKey". -// src/components/EntityRelationsGraph/DefaultRenderNode.d.ts:5:1 - (ae-undocumented) Missing documentation for "CustomNodeClassKey". -// src/components/EntityRelationsGraph/EntityRelationsGraph.d.ts:7:1 - (ae-undocumented) Missing documentation for "EntityRelationsGraphClassKey". -// src/components/EntityRelationsGraph/EntityRelationsGraph.d.ts:11:1 - (ae-undocumented) Missing documentation for "EntityRelationsGraphProps". ``` diff --git a/plugins/catalog-import/report-alpha.api.md b/plugins/catalog-import/report-alpha.api.md index d966e04e7e..1706404b94 100644 --- a/plugins/catalog-import/report-alpha.api.md +++ b/plugins/catalog-import/report-alpha.api.md @@ -67,9 +67,5 @@ const _default: FrontendPlugin< >; export default _default; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-import/report.api.md b/plugins/catalog-import/report.api.md index 8c26da769d..c61aa97b06 100644 --- a/plugins/catalog-import/report.api.md +++ b/plugins/catalog-import/report.api.md @@ -366,46 +366,4 @@ export interface StepPrepareCreatePullRequestProps { // Warnings were encountered during analysis: // // src/api/CatalogImportApi.d.ts:25:5 - (ae-forgotten-export) The symbol "PartialEntity" needs to be exported by the entry point index.d.ts -// src/api/CatalogImportApi.d.ts:33:5 - (ae-undocumented) Missing documentation for "analyzeUrl". -// src/api/CatalogImportApi.d.ts:34:5 - (ae-undocumented) Missing documentation for "preparePullRequest". -// src/api/CatalogImportApi.d.ts:38:5 - (ae-undocumented) Missing documentation for "submitPullRequest". -// src/api/CatalogImportClient.d.ts:26:5 - (ae-undocumented) Missing documentation for "analyzeUrl". -// src/api/CatalogImportClient.d.ts:27:5 - (ae-undocumented) Missing documentation for "preparePullRequest". -// src/api/CatalogImportClient.d.ts:31:5 - (ae-undocumented) Missing documentation for "submitPullRequest". -// src/components/EntityListComponent/EntityListComponent.d.ts:9:5 - (ae-undocumented) Missing documentation for "locations". -// src/components/EntityListComponent/EntityListComponent.d.ts:13:5 - (ae-undocumented) Missing documentation for "locationListItemIcon". -// src/components/EntityListComponent/EntityListComponent.d.ts:14:5 - (ae-undocumented) Missing documentation for "collapsed". -// src/components/EntityListComponent/EntityListComponent.d.ts:15:5 - (ae-undocumented) Missing documentation for "firstListItem". -// src/components/EntityListComponent/EntityListComponent.d.ts:16:5 - (ae-undocumented) Missing documentation for "onItemClick". -// src/components/EntityListComponent/EntityListComponent.d.ts:17:5 - (ae-undocumented) Missing documentation for "withLinks". -// src/components/ImportInfoCard/ImportInfoCard.d.ts:8:5 - (ae-undocumented) Missing documentation for "exampleLocationUrl". -// src/components/ImportInfoCard/ImportInfoCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "exampleRepositoryUrl". -// src/components/ImportStepper/ImportStepper.d.ts:11:5 - (ae-undocumented) Missing documentation for "initialUrl". -// src/components/ImportStepper/ImportStepper.d.ts:12:5 - (ae-undocumented) Missing documentation for "generateStepper". -// src/components/ImportStepper/ImportStepper.d.ts:13:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.d.ts:10:5 - (ae-undocumented) Missing documentation for "onAnalysis". -// src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.d.ts:13:5 - (ae-undocumented) Missing documentation for "disablePullRequest". -// src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.d.ts:14:5 - (ae-undocumented) Missing documentation for "analysisUrl". -// src/components/StepInitAnalyzeUrl/StepInitAnalyzeUrl.d.ts:15:5 - (ae-undocumented) Missing documentation for "exampleLocationUrl". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:10:5 - (ae-undocumented) Missing documentation for "name". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:11:5 - (ae-undocumented) Missing documentation for "options". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:12:5 - (ae-undocumented) Missing documentation for "required". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:13:5 - (ae-undocumented) Missing documentation for "errors". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:14:5 - (ae-undocumented) Missing documentation for "rules". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:15:5 - (ae-undocumented) Missing documentation for "loading". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:16:5 - (ae-undocumented) Missing documentation for "loadingText". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:17:5 - (ae-undocumented) Missing documentation for "helperText". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:18:5 - (ae-undocumented) Missing documentation for "errorHelperText". -// src/components/StepPrepareCreatePullRequest/AutocompleteTextField.d.ts:19:5 - (ae-undocumented) Missing documentation for "textFieldProps". -// src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.d.ts:9:5 - (ae-undocumented) Missing documentation for "repositoryUrl". -// src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.d.ts:10:5 - (ae-undocumented) Missing documentation for "entities". -// src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.d.ts:11:5 - (ae-undocumented) Missing documentation for "classes". -// src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.d.ts:8:5 - (ae-undocumented) Missing documentation for "title". -// src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.d.ts:9:5 - (ae-undocumented) Missing documentation for "description". -// src/components/StepPrepareCreatePullRequest/PreviewPullRequestComponent.d.ts:10:5 - (ae-undocumented) Missing documentation for "classes". -// src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.d.ts:20:5 - (ae-undocumented) Missing documentation for "analyzeResult". -// src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.d.ts:23:5 - (ae-undocumented) Missing documentation for "onPrepare". -// src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.d.ts:26:5 - (ae-undocumented) Missing documentation for "onGoBack". -// src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.d.ts:27:5 - (ae-undocumented) Missing documentation for "renderFormFields". -// src/components/useImportState.d.ts:80:1 - (ae-undocumented) Missing documentation for "ImportState". ``` diff --git a/plugins/catalog-node/report-alpha.api.md b/plugins/catalog-node/report-alpha.api.md index 4ef79f1f3c..ba02079ceb 100644 --- a/plugins/catalog-node/report-alpha.api.md +++ b/plugins/catalog-node/report-alpha.api.md @@ -98,25 +98,5 @@ export const catalogProcessingExtensionPoint: ExtensionPoint; -// Warnings were encountered during analysis: -// -// src/extensions.d.ts:8:1 - (ae-undocumented) Missing documentation for "CatalogLocationsExtensionPoint". -// src/extensions.d.ts:18:22 - (ae-undocumented) Missing documentation for "catalogLocationsExtensionPoint". -// src/extensions.d.ts:22:1 - (ae-undocumented) Missing documentation for "CatalogProcessingExtensionPoint". -// src/extensions.d.ts:23:5 - (ae-undocumented) Missing documentation for "addProcessor". -// src/extensions.d.ts:24:5 - (ae-undocumented) Missing documentation for "addEntityProvider". -// src/extensions.d.ts:25:5 - (ae-undocumented) Missing documentation for "addPlaceholderResolver". -// src/extensions.d.ts:26:5 - (ae-undocumented) Missing documentation for "setOnProcessingErrorHandler". -// src/extensions.d.ts:32:1 - (ae-undocumented) Missing documentation for "CatalogModelExtensionPoint". -// src/extensions.d.ts:50:22 - (ae-undocumented) Missing documentation for "catalogProcessingExtensionPoint". -// src/extensions.d.ts:54:1 - (ae-undocumented) Missing documentation for "CatalogAnalysisExtensionPoint". -// src/extensions.d.ts:77:22 - (ae-undocumented) Missing documentation for "catalogAnalysisExtensionPoint". -// src/extensions.d.ts:79:22 - (ae-undocumented) Missing documentation for "catalogModelExtensionPoint". -// src/extensions.d.ts:83:1 - (ae-undocumented) Missing documentation for "CatalogPermissionRuleInput". -// src/extensions.d.ts:87:1 - (ae-undocumented) Missing documentation for "CatalogPermissionExtensionPoint". -// src/extensions.d.ts:88:5 - (ae-undocumented) Missing documentation for "addPermissions". -// src/extensions.d.ts:89:5 - (ae-undocumented) Missing documentation for "addPermissionRules". -// src/extensions.d.ts:94:22 - (ae-undocumented) Missing documentation for "catalogPermissionExtensionPoint". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-node/report.api.md b/plugins/catalog-node/report.api.md index 3702f933ee..43209aa862 100644 --- a/plugins/catalog-node/report.api.md +++ b/plugins/catalog-node/report.api.md @@ -243,22 +243,4 @@ export type ScmLocationAnalyzer = { existing: AnalyzeLocationExistingEntity[]; }>; }; - -// Warnings were encountered during analysis: -// -// src/api/processor.d.ts:10:1 - (ae-undocumented) Missing documentation for "CatalogProcessor". -// src/api/processor.d.ts:105:1 - (ae-undocumented) Missing documentation for "CatalogProcessorEmit". -// src/api/processor.d.ts:107:1 - (ae-undocumented) Missing documentation for "CatalogProcessorLocationResult". -// src/api/processor.d.ts:112:1 - (ae-undocumented) Missing documentation for "CatalogProcessorEntityResult". -// src/api/processor.d.ts:118:1 - (ae-undocumented) Missing documentation for "CatalogProcessorRelationResult". -// src/api/processor.d.ts:123:1 - (ae-undocumented) Missing documentation for "CatalogProcessorErrorResult". -// src/api/processor.d.ts:129:1 - (ae-undocumented) Missing documentation for "CatalogProcessorRefreshKeysResult". -// src/api/processor.d.ts:134:1 - (ae-undocumented) Missing documentation for "CatalogProcessorResult". -// src/processing/types.d.ts:17:1 - (ae-undocumented) Missing documentation for "PlaceholderResolverRead". -// src/processing/types.d.ts:19:1 - (ae-undocumented) Missing documentation for "PlaceholderResolverResolveUrl". -// src/processing/types.d.ts:21:1 - (ae-undocumented) Missing documentation for "PlaceholderResolverParams". -// src/processing/types.d.ts:30:1 - (ae-undocumented) Missing documentation for "PlaceholderResolver". -// src/processing/types.d.ts:32:1 - (ae-undocumented) Missing documentation for "LocationAnalyzer". -// src/processing/types.d.ts:42:1 - (ae-undocumented) Missing documentation for "AnalyzeOptions". -// src/processing/types.d.ts:47:1 - (ae-undocumented) Missing documentation for "ScmLocationAnalyzer". ``` diff --git a/plugins/catalog-react/report-alpha.api.md b/plugins/catalog-react/report-alpha.api.md index 6eec97b815..516d655967 100644 --- a/plugins/catalog-react/report-alpha.api.md +++ b/plugins/catalog-react/report-alpha.api.md @@ -221,11 +221,5 @@ export function useEntityPermission( error?: Error; }; -// Warnings were encountered during analysis: -// -// src/alpha/converters/convertLegacyEntityCardExtension.d.ts:5:1 - (ae-undocumented) Missing documentation for "convertLegacyEntityCardExtension". -// src/alpha/converters/convertLegacyEntityContentExtension.d.ts:5:1 - (ae-undocumented) Missing documentation for "convertLegacyEntityContentExtension". -// src/translation.d.ts:2:22 - (ae-undocumented) Missing documentation for "catalogReactTranslationRef". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog-react/report.api.md b/plugins/catalog-react/report.api.md index 515a3526be..af5102176d 100644 --- a/plugins/catalog-react/report.api.md +++ b/plugins/catalog-react/report.api.md @@ -840,118 +840,4 @@ export function useStarredEntity( toggleStarredEntity: () => void; isStarredEntity: boolean; }; - -// Warnings were encountered during analysis: -// -// src/apis/StarredEntitiesApi/MockStarredEntitiesApi.d.ts:12:5 - (ae-undocumented) Missing documentation for "toggleStarred". -// src/apis/StarredEntitiesApi/MockStarredEntitiesApi.d.ts:13:5 - (ae-undocumented) Missing documentation for "starredEntitie$". -// src/components/CatalogFilterLayout/CatalogFilterLayout.d.ts:15:22 - (ae-undocumented) Missing documentation for "CatalogFilterLayout". -// src/components/DefaultFilters/DefaultFilters.d.ts:16:22 - (ae-undocumented) Missing documentation for "DefaultFilters". -// src/components/EntityAutocompletePicker/EntityAutocompletePicker.d.ts:6:1 - (ae-undocumented) Missing documentation for "AllowedEntityFilters". -// src/components/EntityAutocompletePicker/EntityAutocompletePicker.d.ts:12:1 - (ae-undocumented) Missing documentation for "EntityAutocompletePickerProps". -// src/components/EntityAutocompletePicker/EntityAutocompletePicker.d.ts:25:1 - (ae-undocumented) Missing documentation for "CatalogReactEntityAutocompletePickerClassKey". -// src/components/EntityAutocompletePicker/EntityAutocompletePicker.d.ts:27:1 - (ae-undocumented) Missing documentation for "EntityAutocompletePicker". -// src/components/EntityKindPicker/EntityKindPicker.d.ts:13:5 - (ae-undocumented) Missing documentation for "initialFilter". -// src/components/EntityKindPicker/EntityKindPicker.d.ts:14:5 - (ae-undocumented) Missing documentation for "hidden". -// src/components/EntityKindPicker/EntityKindPicker.d.ts:17:22 - (ae-undocumented) Missing documentation for "EntityKindPicker". -// src/components/EntityLifecyclePicker/EntityLifecyclePicker.d.ts:3:1 - (ae-undocumented) Missing documentation for "CatalogReactEntityLifecyclePickerClassKey". -// src/components/EntityLifecyclePicker/EntityLifecyclePicker.d.ts:5:22 - (ae-undocumented) Missing documentation for "EntityLifecyclePicker". -// src/components/EntityNamespacePicker/EntityNamespacePicker.d.ts:3:1 - (ae-undocumented) Missing documentation for "CatalogReactEntityNamespacePickerClassKey". -// src/components/EntityNamespacePicker/EntityNamespacePicker.d.ts:10:5 - (ae-undocumented) Missing documentation for "initiallySelectedNamespaces". -// src/components/EntityNamespacePicker/EntityNamespacePicker.d.ts:13:22 - (ae-undocumented) Missing documentation for "EntityNamespacePicker". -// src/components/EntityOwnerPicker/EntityOwnerPicker.d.ts:3:1 - (ae-undocumented) Missing documentation for "CatalogReactEntityOwnerPickerClassKey". -// src/components/EntityOwnerPicker/EntityOwnerPicker.d.ts:5:1 - (ae-undocumented) Missing documentation for "FixedWidthFormControlLabelClassKey". -// src/components/EntityOwnerPicker/EntityOwnerPicker.d.ts:9:1 - (ae-undocumented) Missing documentation for "EntityOwnerPickerProps". -// src/components/EntityOwnerPicker/EntityOwnerPicker.d.ts:13:22 - (ae-undocumented) Missing documentation for "EntityOwnerPicker". -// src/components/EntityProcessingStatusPicker/EntityProcessingStatusPicker.d.ts:3:1 - (ae-undocumented) Missing documentation for "CatalogReactEntityProcessingStatusPickerClassKey". -// src/components/EntityProcessingStatusPicker/EntityProcessingStatusPicker.d.ts:5:22 - (ae-undocumented) Missing documentation for "EntityProcessingStatusPicker". -// src/components/EntityRefLink/humanize.d.ts:8:1 - (ae-undocumented) Missing documentation for "humanizeEntityRef". -// src/components/EntitySearchBar/EntitySearchBar.d.ts:3:1 - (ae-undocumented) Missing documentation for "CatalogReactEntitySearchBarClassKey". -// src/components/EntityTable/EntityTable.d.ts:10:5 - (ae-undocumented) Missing documentation for "title". -// src/components/EntityTable/EntityTable.d.ts:11:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/EntityTable/EntityTable.d.ts:12:5 - (ae-undocumented) Missing documentation for "entities". -// src/components/EntityTable/EntityTable.d.ts:13:5 - (ae-undocumented) Missing documentation for "emptyContent". -// src/components/EntityTable/EntityTable.d.ts:14:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/EntityTable/EntityTable.d.ts:15:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/EntityTable/columns.d.ts:4:22 - (ae-undocumented) Missing documentation for "columnFactories". -// src/components/EntityTagPicker/EntityTagPicker.d.ts:3:1 - (ae-undocumented) Missing documentation for "CatalogReactEntityTagPickerClassKey". -// src/components/EntityTagPicker/EntityTagPicker.d.ts:5:1 - (ae-undocumented) Missing documentation for "EntityTagPickerProps". -// src/components/EntityTagPicker/EntityTagPicker.d.ts:9:22 - (ae-undocumented) Missing documentation for "EntityTagPicker". -// src/components/EntityTypePicker/EntityTypePicker.d.ts:8:5 - (ae-undocumented) Missing documentation for "initialFilter". -// src/components/EntityTypePicker/EntityTypePicker.d.ts:9:5 - (ae-undocumented) Missing documentation for "hidden". -// src/components/EntityTypePicker/EntityTypePicker.d.ts:12:22 - (ae-undocumented) Missing documentation for "EntityTypePicker". -// src/components/FavoriteEntity/FavoriteEntity.d.ts:5:1 - (ae-undocumented) Missing documentation for "FavoriteEntityProps". -// src/components/MissingAnnotationEmptyState/MissingAnnotationEmptyState.d.ts:3:1 - (ae-undocumented) Missing documentation for "MissingAnnotationEmptyStateClassKey". -// src/components/UnregisterEntityDialog/UnregisterEntityDialog.d.ts:4:1 - (ae-undocumented) Missing documentation for "UnregisterEntityDialogProps". -// src/components/UnregisterEntityDialog/UnregisterEntityDialog.d.ts:11:22 - (ae-undocumented) Missing documentation for "UnregisterEntityDialog". -// src/components/UserListPicker/UserListPicker.d.ts:5:1 - (ae-undocumented) Missing documentation for "CatalogReactUserListPickerClassKey". -// src/components/UserListPicker/UserListPicker.d.ts:15:1 - (ae-undocumented) Missing documentation for "UserListPickerProps". -// src/components/UserListPicker/UserListPicker.d.ts:20:22 - (ae-undocumented) Missing documentation for "UserListPicker". -// src/deprecated.d.ts:7:1 - (ae-undocumented) Missing documentation for "MockEntityListContextProvider". -// src/filters.d.ts:8:5 - (ae-undocumented) Missing documentation for "value". -// src/filters.d.ts:10:5 - (ae-undocumented) Missing documentation for "getCatalogFilters". -// src/filters.d.ts:11:5 - (ae-undocumented) Missing documentation for "toQueryValue". -// src/filters.d.ts:18:5 - (ae-undocumented) Missing documentation for "value". -// src/filters.d.ts:20:5 - (ae-undocumented) Missing documentation for "getTypes". -// src/filters.d.ts:21:5 - (ae-undocumented) Missing documentation for "getCatalogFilters". -// src/filters.d.ts:22:5 - (ae-undocumented) Missing documentation for "toQueryValue". -// src/filters.d.ts:29:5 - (ae-undocumented) Missing documentation for "values". -// src/filters.d.ts:31:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/filters.d.ts:32:5 - (ae-undocumented) Missing documentation for "getCatalogFilters". -// src/filters.d.ts:33:5 - (ae-undocumented) Missing documentation for "toQueryValue". -// src/filters.d.ts:40:5 - (ae-undocumented) Missing documentation for "value". -// src/filters.d.ts:42:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/filters.d.ts:43:5 - (ae-undocumented) Missing documentation for "getFullTextFilters". -// src/filters.d.ts:47:5 - (ae-undocumented) Missing documentation for "toQueryValue". -// src/filters.d.ts:57:5 - (ae-undocumented) Missing documentation for "values". -// src/filters.d.ts:59:5 - (ae-undocumented) Missing documentation for "getCatalogFilters". -// src/filters.d.ts:60:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/filters.d.ts:72:5 - (ae-undocumented) Missing documentation for "values". -// src/filters.d.ts:74:5 - (ae-undocumented) Missing documentation for "getCatalogFilters". -// src/filters.d.ts:75:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/filters.d.ts:76:5 - (ae-undocumented) Missing documentation for "toQueryValue". -// src/filters.d.ts:83:5 - (ae-undocumented) Missing documentation for "values". -// src/filters.d.ts:85:5 - (ae-undocumented) Missing documentation for "getCatalogFilters". -// src/filters.d.ts:86:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/filters.d.ts:87:5 - (ae-undocumented) Missing documentation for "toQueryValue". -// src/filters.d.ts:92:1 - (ae-undocumented) Missing documentation for "EntityUserFilter". -// src/filters.d.ts:93:5 - (ae-undocumented) Missing documentation for "value". -// src/filters.d.ts:94:5 - (ae-undocumented) Missing documentation for "refs". -// src/filters.d.ts:96:5 - (ae-undocumented) Missing documentation for "owned". -// src/filters.d.ts:97:5 - (ae-undocumented) Missing documentation for "all". -// src/filters.d.ts:98:5 - (ae-undocumented) Missing documentation for "starred". -// src/filters.d.ts:99:5 - (ae-undocumented) Missing documentation for "getCatalogFilters". -// src/filters.d.ts:100:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/filters.d.ts:101:5 - (ae-undocumented) Missing documentation for "toQueryValue". -// src/filters.d.ts:109:5 - (ae-undocumented) Missing documentation for "value". -// src/filters.d.ts:110:5 - (ae-undocumented) Missing documentation for "isOwnedEntity". -// src/filters.d.ts:111:5 - (ae-undocumented) Missing documentation for "isStarredEntity". -// src/filters.d.ts:113:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/filters.d.ts:114:5 - (ae-undocumented) Missing documentation for "toQueryValue". -// src/filters.d.ts:121:5 - (ae-undocumented) Missing documentation for "value". -// src/filters.d.ts:123:5 - (ae-undocumented) Missing documentation for "getCatalogFilters". -// src/filters.d.ts:124:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/filters.d.ts:131:5 - (ae-undocumented) Missing documentation for "value". -// src/filters.d.ts:133:5 - (ae-undocumented) Missing documentation for "filterEntity". -// src/hooks/useEntity.d.ts:4:1 - (ae-undocumented) Missing documentation for "EntityLoadingStatus". -// src/hooks/useEntity.d.ts:16:5 - (ae-undocumented) Missing documentation for "children". -// src/hooks/useEntity.d.ts:17:5 - (ae-undocumented) Missing documentation for "entity". -// src/hooks/useEntity.d.ts:18:5 - (ae-undocumented) Missing documentation for "loading". -// src/hooks/useEntity.d.ts:19:5 - (ae-undocumented) Missing documentation for "error". -// src/hooks/useEntity.d.ts:20:5 - (ae-undocumented) Missing documentation for "refresh". -// src/hooks/useEntity.d.ts:34:5 - (ae-undocumented) Missing documentation for "children". -// src/hooks/useEntity.d.ts:35:5 - (ae-undocumented) Missing documentation for "entity". -// src/hooks/useEntityListProvider.d.ts:6:1 - (ae-undocumented) Missing documentation for "DefaultEntityFilters". -// src/hooks/useEntityListProvider.d.ts:19:1 - (ae-undocumented) Missing documentation for "PaginationMode". -// src/hooks/useEntityListProvider.d.ts:21:1 - (ae-undocumented) Missing documentation for "EntityListContextProps". -// src/hooks/useEntityListProvider.d.ts:65:1 - (ae-undocumented) Missing documentation for "EntityListProviderProps". -// src/hooks/useStarredEntities.d.ts:3:1 - (ae-undocumented) Missing documentation for "useStarredEntities". -// src/hooks/useStarredEntity.d.ts:3:1 - (ae-undocumented) Missing documentation for "useStarredEntity". -// src/overridableComponents.d.ts:6:1 - (ae-undocumented) Missing documentation for "CatalogReactComponentsNameToClassKey". -// src/overridableComponents.d.ts:19:1 - (ae-undocumented) Missing documentation for "BackstageOverrides". -// src/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "EntityFilter". -// src/types.d.ts:25:1 - (ae-undocumented) Missing documentation for "UserListFilterKind". -// src/types.d.ts:27:1 - (ae-undocumented) Missing documentation for "EntityListPagination". -// src/utils/getEntitySourceLocation.d.ts:4:1 - (ae-undocumented) Missing documentation for "EntitySourceLocation". -// src/utils/getEntitySourceLocation.d.ts:9:1 - (ae-undocumented) Missing documentation for "getEntitySourceLocation". ``` diff --git a/plugins/catalog-unprocessed-entities/report.api.md b/plugins/catalog-unprocessed-entities/report.api.md index dd0386204a..7d8f6299da 100644 --- a/plugins/catalog-unprocessed-entities/report.api.md +++ b/plugins/catalog-unprocessed-entities/report.api.md @@ -73,9 +73,5 @@ export type UnprocessedEntityError = { }; }; -// Warnings were encountered during analysis: -// -// src/components/UnprocessedEntities.d.ts:3:22 - (ae-undocumented) Missing documentation for "UnprocessedEntitiesContent". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog/report-alpha.api.md b/plugins/catalog/report-alpha.api.md index b7fa14d003..1b1ce54d92 100644 --- a/plugins/catalog/report-alpha.api.md +++ b/plugins/catalog/report-alpha.api.md @@ -870,10 +870,5 @@ const _default: FrontendPlugin< >; export default _default; -// Warnings were encountered during analysis: -// -// src/alpha/plugin.d.ts:3:15 - (ae-undocumented) Missing documentation for "_default". -// src/alpha/translation.d.ts:2:22 - (ae-undocumented) Missing documentation for "catalogTranslationRef". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/catalog/report.api.md b/plugins/catalog/report.api.md index a7538900a0..d817118e3a 100644 --- a/plugins/catalog/report.api.md +++ b/plugins/catalog/report.api.md @@ -667,131 +667,4 @@ export type SystemDiagramCardClassKey = | 'componentNode' | 'apiNode' | 'resourceNode'; - -// Warnings were encountered during analysis: -// -// src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.d.ts:15:5 - (ae-undocumented) Missing documentation for "toggleStarred". -// src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.d.ts:16:5 - (ae-undocumented) Missing documentation for "starredEntitie$". -// src/components/AboutCard/AboutCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/AboutCard/AboutContent.d.ts:9:5 - (ae-undocumented) Missing documentation for "entity". -// src/components/AboutCard/AboutContent.d.ts:12:1 - (ae-undocumented) Missing documentation for "AboutContent". -// src/components/AboutCard/AboutField.d.ts:8:5 - (ae-undocumented) Missing documentation for "label". -// src/components/AboutCard/AboutField.d.ts:9:5 - (ae-undocumented) Missing documentation for "value". -// src/components/AboutCard/AboutField.d.ts:10:5 - (ae-undocumented) Missing documentation for "gridSizes". -// src/components/AboutCard/AboutField.d.ts:11:5 - (ae-undocumented) Missing documentation for "children". -// src/components/AboutCard/AboutField.d.ts:14:1 - (ae-undocumented) Missing documentation for "AboutField". -// src/components/CatalogKindHeader/CatalogKindHeader.d.ts:23:1 - (ae-undocumented) Missing documentation for "CatalogKindHeader". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:12:5 - (ae-undocumented) Missing documentation for "initiallySelectedFilter". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:13:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:14:5 - (ae-undocumented) Missing documentation for "actions". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:15:5 - (ae-undocumented) Missing documentation for "initialKind". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:16:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:17:5 - (ae-undocumented) Missing documentation for "emptyContent". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:18:5 - (ae-undocumented) Missing documentation for "ownerPickerMode". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:19:5 - (ae-undocumented) Missing documentation for "filters". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:20:5 - (ae-undocumented) Missing documentation for "initiallySelectedNamespaces". -// src/components/CatalogPage/DefaultCatalogPage.d.ts:21:5 - (ae-undocumented) Missing documentation for "pagination". -// src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.d.ts:4:1 - (ae-undocumented) Missing documentation for "CatalogSearchResultListItemClassKey". -// src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.d.ts:11:5 - (ae-undocumented) Missing documentation for "icon". -// src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.d.ts:12:5 - (ae-undocumented) Missing documentation for "result". -// src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.d.ts:13:5 - (ae-undocumented) Missing documentation for "highlight". -// src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.d.ts:14:5 - (ae-undocumented) Missing documentation for "rank". -// src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.d.ts:15:5 - (ae-undocumented) Missing documentation for "lineClamp". -// src/components/CatalogTable/CatalogTable.d.ts:10:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/CatalogTable/CatalogTable.d.ts:11:5 - (ae-undocumented) Missing documentation for "actions". -// src/components/CatalogTable/CatalogTable.d.ts:12:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/CatalogTable/CatalogTable.d.ts:13:5 - (ae-undocumented) Missing documentation for "emptyContent". -// src/components/CatalogTable/CatalogTable.d.ts:14:5 - (ae-undocumented) Missing documentation for "subtitle". -// src/components/CatalogTable/CatalogTable.d.ts:17:22 - (ae-undocumented) Missing documentation for "CatalogTable". -// src/components/CatalogTable/CatalogTableToolbar.d.ts:3:1 - (ae-undocumented) Missing documentation for "CatalogTableToolbarClassKey". -// src/components/CatalogTable/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "CatalogTableRow". -// src/components/CatalogTable/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "entity". -// src/components/CatalogTable/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "resolved". -// src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "DependencyOfComponentsCardProps". -// src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "title". -// src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.d.ts:8:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/DependsOnComponentsCard/DependsOnComponentsCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "DependsOnComponentsCardProps". -// src/components/DependsOnComponentsCard/DependsOnComponentsCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/DependsOnComponentsCard/DependsOnComponentsCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "title". -// src/components/DependsOnComponentsCard/DependsOnComponentsCard.d.ts:8:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/DependsOnComponentsCard/DependsOnComponentsCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/DependsOnResourcesCard/DependsOnResourcesCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "DependsOnResourcesCardProps". -// src/components/DependsOnResourcesCard/DependsOnResourcesCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/DependsOnResourcesCard/DependsOnResourcesCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "title". -// src/components/DependsOnResourcesCard/DependsOnResourcesCard.d.ts:8:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/DependsOnResourcesCard/DependsOnResourcesCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/EntityContextMenu/EntityContextMenu.d.ts:5:1 - (ae-undocumented) Missing documentation for "EntityContextMenuClassKey". -// src/components/EntityLabelsCard/EntityLabelsCard.d.ts:4:1 - (ae-undocumented) Missing documentation for "EntityLabelsCardProps". -// src/components/EntityLabelsCard/EntityLabelsCard.d.ts:5:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/EntityLabelsCard/EntityLabelsCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "title". -// src/components/EntityLabelsCard/EntityLabelsEmptyState.d.ts:3:1 - (ae-undocumented) Missing documentation for "EntityLabelsEmptyStateClassKey". -// src/components/EntityLayout/EntityLayout.d.ts:6:1 - (ae-undocumented) Missing documentation for "EntityLayoutRouteProps". -// src/components/EntityLayout/EntityLayout.d.ts:25:1 - (ae-undocumented) Missing documentation for "EntityLayoutProps". -// src/components/EntityLayout/EntityLayout.d.ts:26:5 - (ae-undocumented) Missing documentation for "UNSTABLE_extraContextMenuItems". -// src/components/EntityLayout/EntityLayout.d.ts:27:5 - (ae-undocumented) Missing documentation for "UNSTABLE_contextMenuOptions". -// src/components/EntityLayout/EntityLayout.d.ts:28:5 - (ae-undocumented) Missing documentation for "children". -// src/components/EntityLayout/EntityLayout.d.ts:29:5 - (ae-undocumented) Missing documentation for "NotFoundComponent". -// src/components/EntityLinksCard/EntityLinksCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "EntityLinksCardProps". -// src/components/EntityLinksCard/EntityLinksCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "cols". -// src/components/EntityLinksCard/EntityLinksCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/EntityLinksCard/EntityLinksEmptyState.d.ts:3:1 - (ae-undocumented) Missing documentation for "EntityLinksEmptyStateClassKey". -// src/components/EntityLinksCard/types.d.ts:2:1 - (ae-undocumented) Missing documentation for "Breakpoint". -// src/components/EntityLinksCard/types.d.ts:4:1 - (ae-undocumented) Missing documentation for "ColumnBreakpoints". -// src/components/EntitySwitch/EntitySwitch.d.ts:5:1 - (ae-undocumented) Missing documentation for "EntitySwitchCaseProps". -// src/components/EntitySwitch/EntitySwitch.d.ts:6:5 - (ae-undocumented) Missing documentation for "if". -// src/components/EntitySwitch/EntitySwitch.d.ts:9:5 - (ae-undocumented) Missing documentation for "children". -// src/components/EntitySwitch/EntitySwitch.d.ts:16:5 - (ae-undocumented) Missing documentation for "children". -// src/components/EntitySwitch/EntitySwitch.d.ts:17:5 - (ae-undocumented) Missing documentation for "renderMultipleMatches". -// src/components/EntitySwitch/EntitySwitch.d.ts:20:22 - (ae-undocumented) Missing documentation for "EntitySwitch". -// src/components/EntitySwitch/conditions.d.ts:3:1 - (ae-undocumented) Missing documentation for "EntityPredicates". -// src/components/EntitySwitch/conditions.d.ts:4:5 - (ae-undocumented) Missing documentation for "kind". -// src/components/EntitySwitch/conditions.d.ts:5:5 - (ae-undocumented) Missing documentation for "type". -// src/components/FilteredEntityLayout/index.d.ts:6:22 - (ae-undocumented) Missing documentation for "FilteredEntityLayout". -// src/components/FilteredEntityLayout/index.d.ts:13:22 - (ae-undocumented) Missing documentation for "FilterContainer". -// src/components/FilteredEntityLayout/index.d.ts:24:22 - (ae-undocumented) Missing documentation for "EntityListContainer". -// src/components/HasComponentsCard/HasComponentsCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "HasComponentsCardProps". -// src/components/HasComponentsCard/HasComponentsCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/HasComponentsCard/HasComponentsCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "title". -// src/components/HasComponentsCard/HasComponentsCard.d.ts:8:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/HasComponentsCard/HasComponentsCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/HasResourcesCard/HasResourcesCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "HasResourcesCardProps". -// src/components/HasResourcesCard/HasResourcesCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/HasResourcesCard/HasResourcesCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "title". -// src/components/HasResourcesCard/HasResourcesCard.d.ts:8:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/HasResourcesCard/HasResourcesCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/HasSubcomponentsCard/HasSubcomponentsCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "HasSubcomponentsCardProps". -// src/components/HasSubcomponentsCard/HasSubcomponentsCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/HasSubcomponentsCard/HasSubcomponentsCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "title". -// src/components/HasSubcomponentsCard/HasSubcomponentsCard.d.ts:8:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/HasSubcomponentsCard/HasSubcomponentsCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/HasSubdomainsCard/HasSubdomainsCard.d.ts:4:1 - (ae-undocumented) Missing documentation for "HasSubdomainsCardProps". -// src/components/HasSubdomainsCard/HasSubdomainsCard.d.ts:5:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/HasSubdomainsCard/HasSubdomainsCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/HasSubdomainsCard/HasSubdomainsCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "title". -// src/components/HasSystemsCard/HasSystemsCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "HasSystemsCardProps". -// src/components/HasSystemsCard/HasSystemsCard.d.ts:6:5 - (ae-undocumented) Missing documentation for "variant". -// src/components/HasSystemsCard/HasSystemsCard.d.ts:7:5 - (ae-undocumented) Missing documentation for "title". -// src/components/HasSystemsCard/HasSystemsCard.d.ts:8:5 - (ae-undocumented) Missing documentation for "columns". -// src/components/HasSystemsCard/HasSystemsCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "tableOptions". -// src/components/RelatedEntitiesCard/RelatedEntitiesCard.d.ts:5:1 - (ae-undocumented) Missing documentation for "RelatedEntitiesCardProps". -// src/components/SystemDiagramCard/SystemDiagramCard.d.ts:3:1 - (ae-undocumented) Missing documentation for "SystemDiagramCardClassKey". -// src/overridableComponents.d.ts:10:1 - (ae-undocumented) Missing documentation for "PluginCatalogComponentsNameToClassKey". -// src/overridableComponents.d.ts:19:1 - (ae-undocumented) Missing documentation for "BackstageOverrides". -// src/plugin.d.ts:17:22 - (ae-undocumented) Missing documentation for "catalogPlugin". -// src/plugin.d.ts:38:22 - (ae-undocumented) Missing documentation for "CatalogIndexPage". -// src/plugin.d.ts:40:22 - (ae-undocumented) Missing documentation for "CatalogEntityPage". -// src/plugin.d.ts:55:22 - (ae-undocumented) Missing documentation for "EntityLinksCard". -// src/plugin.d.ts:57:22 - (ae-undocumented) Missing documentation for "EntityLabelsCard". -// src/plugin.d.ts:59:22 - (ae-undocumented) Missing documentation for "EntityHasSystemsCard". -// src/plugin.d.ts:61:22 - (ae-undocumented) Missing documentation for "EntityHasComponentsCard". -// src/plugin.d.ts:63:22 - (ae-undocumented) Missing documentation for "EntityHasSubcomponentsCard". -// src/plugin.d.ts:65:22 - (ae-undocumented) Missing documentation for "EntityHasSubdomainsCard". -// src/plugin.d.ts:67:22 - (ae-undocumented) Missing documentation for "EntityHasResourcesCard". -// src/plugin.d.ts:69:22 - (ae-undocumented) Missing documentation for "EntityDependsOnComponentsCard". -// src/plugin.d.ts:71:22 - (ae-undocumented) Missing documentation for "EntityDependencyOfComponentsCard". -// src/plugin.d.ts:73:22 - (ae-undocumented) Missing documentation for "EntityDependsOnResourcesCard". -// src/plugin.d.ts:75:22 - (ae-undocumented) Missing documentation for "RelatedEntitiesCard". -// src/plugin.d.ts:77:22 - (ae-undocumented) Missing documentation for "CatalogSearchResultListItem". ``` diff --git a/plugins/config-schema/report.api.md b/plugins/config-schema/report.api.md index 00a7a7fe0c..16630ae8d0 100644 --- a/plugins/config-schema/report.api.md +++ b/plugins/config-schema/report.api.md @@ -44,15 +44,4 @@ export class StaticSchemaLoader implements ConfigSchemaApi { // (undocumented) schema$(): Observable; } - -// Warnings were encountered during analysis: -// -// src/api/StaticSchemaLoader.d.ts:13:5 - (ae-undocumented) Missing documentation for "schema$". -// src/api/types.d.ts:4:1 - (ae-undocumented) Missing documentation for "ConfigSchemaResult". -// src/api/types.d.ts:5:5 - (ae-undocumented) Missing documentation for "schema". -// src/api/types.d.ts:8:1 - (ae-undocumented) Missing documentation for "ConfigSchemaApi". -// src/api/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "schema$". -// src/api/types.d.ts:12:22 - (ae-undocumented) Missing documentation for "configSchemaApiRef". -// src/plugin.d.ts:3:22 - (ae-undocumented) Missing documentation for "configSchemaPlugin". -// src/plugin.d.ts:7:22 - (ae-undocumented) Missing documentation for "ConfigSchemaPage". ``` diff --git a/plugins/devtools-backend/report.api.md b/plugins/devtools-backend/report.api.md index 1ca69d686e..5fceda3d46 100644 --- a/plugins/devtools-backend/report.api.md +++ b/plugins/devtools-backend/report.api.md @@ -48,19 +48,4 @@ export interface RouterOptions { // (undocumented) permissions: PermissionsService; } - -// Warnings were encountered during analysis: -// -// src/api/DevToolsBackendApi.d.ts:5:1 - (ae-undocumented) Missing documentation for "DevToolsBackendApi". -// src/api/DevToolsBackendApi.d.ts:9:5 - (ae-undocumented) Missing documentation for "listExternalDependencyDetails". -// src/api/DevToolsBackendApi.d.ts:12:5 - (ae-undocumented) Missing documentation for "listConfig". -// src/api/DevToolsBackendApi.d.ts:13:5 - (ae-undocumented) Missing documentation for "listInfo". -// src/service/router.d.ts:8:1 - (ae-undocumented) Missing documentation for "RouterOptions". -// src/service/router.d.ts:9:5 - (ae-undocumented) Missing documentation for "devToolsBackendApi". -// src/service/router.d.ts:10:5 - (ae-undocumented) Missing documentation for "logger". -// src/service/router.d.ts:11:5 - (ae-undocumented) Missing documentation for "config". -// src/service/router.d.ts:12:5 - (ae-undocumented) Missing documentation for "permissions". -// src/service/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "discovery". -// src/service/router.d.ts:14:5 - (ae-undocumented) Missing documentation for "httpAuth". -// src/service/router.d.ts:20:1 - (ae-undocumented) Missing documentation for "createRouter". ``` diff --git a/plugins/devtools-common/report.api.md b/plugins/devtools-common/report.api.md index bf71f1b87a..83af75d11a 100644 --- a/plugins/devtools-common/report.api.md +++ b/plugins/devtools-common/report.api.md @@ -73,20 +73,4 @@ export type PackageDependency = { name: string; versions: string; }; - -// Warnings were encountered during analysis: -// -// src/permissions.d.ts:4:22 - (ae-undocumented) Missing documentation for "devToolsAdministerPermission". -// src/permissions.d.ts:8:22 - (ae-undocumented) Missing documentation for "devToolsInfoReadPermission". -// src/permissions.d.ts:12:22 - (ae-undocumented) Missing documentation for "devToolsConfigReadPermission". -// src/permissions.d.ts:16:22 - (ae-undocumented) Missing documentation for "devToolsExternalDependenciesReadPermission". -// src/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "Endpoint". -// src/types.d.ts:9:1 - (ae-undocumented) Missing documentation for "ExternalDependency". -// src/types.d.ts:17:1 - (ae-undocumented) Missing documentation for "DevToolsInfo". -// src/types.d.ts:25:1 - (ae-undocumented) Missing documentation for "PackageDependency". -// src/types.d.ts:30:1 - (ae-undocumented) Missing documentation for "ExternalDependencyStatus". -// src/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "healthy". -// src/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "unhealthy". -// src/types.d.ts:35:1 - (ae-undocumented) Missing documentation for "ConfigInfo". -// src/types.d.ts:40:1 - (ae-undocumented) Missing documentation for "ConfigError". ``` diff --git a/plugins/devtools/report-alpha.api.md b/plugins/devtools/report-alpha.api.md index aa1806277e..1b026d1f78 100644 --- a/plugins/devtools/report-alpha.api.md +++ b/plugins/devtools/report-alpha.api.md @@ -89,9 +89,5 @@ const _default: FrontendPlugin< >; export default _default; -// Warnings were encountered during analysis: -// -// src/alpha/plugin.d.ts:53:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/devtools/report.api.md b/plugins/devtools/report.api.md index 75dfdc32f6..bba36a5a9a 100644 --- a/plugins/devtools/report.api.md +++ b/plugins/devtools/report.api.md @@ -57,14 +57,4 @@ export type SubRoute = { } >; }; - -// Warnings were encountered during analysis: -// -// src/components/Content/ConfigContent/ConfigContent.d.ts:7:22 - (ae-undocumented) Missing documentation for "ConfigContent". -// src/components/Content/ExternalDependenciesContent/ExternalDependenciesContent.d.ts:5:22 - (ae-undocumented) Missing documentation for "ExternalDependenciesContent". -// src/components/Content/InfoContent/InfoContent.d.ts:3:22 - (ae-undocumented) Missing documentation for "InfoContent". -// src/components/DevToolsLayout/DevToolsLayout.d.ts:4:1 - (ae-undocumented) Missing documentation for "SubRoute". -// src/components/DevToolsLayout/DevToolsLayout.d.ts:13:1 - (ae-undocumented) Missing documentation for "DevToolsLayoutProps". -// src/plugin.d.ts:3:22 - (ae-undocumented) Missing documentation for "devToolsPlugin". -// src/plugin.d.ts:7:22 - (ae-undocumented) Missing documentation for "DevToolsPage". ``` diff --git a/plugins/events-backend-module-aws-sqs/report-alpha.api.md b/plugins/events-backend-module-aws-sqs/report-alpha.api.md index 38ce74daa9..6770e7b872 100644 --- a/plugins/events-backend-module-aws-sqs/report-alpha.api.md +++ b/plugins/events-backend-module-aws-sqs/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-aws-sqs/report.api.md b/plugins/events-backend-module-aws-sqs/report.api.md index 5363884ea9..c23e05a3e8 100644 --- a/plugins/events-backend-module-aws-sqs/report.api.md +++ b/plugins/events-backend-module-aws-sqs/report.api.md @@ -25,9 +25,4 @@ export class AwsSqsConsumingEventPublisher { // @public const eventsModuleAwsSqsConsumingEventPublisher: BackendFeature; export default eventsModuleAwsSqsConsumingEventPublisher; - -// Warnings were encountered during analysis: -// -// src/publisher/AwsSqsConsumingEventPublisher.d.ts:21:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/publisher/AwsSqsConsumingEventPublisher.d.ts:28:5 - (ae-undocumented) Missing documentation for "start". ``` diff --git a/plugins/events-backend-module-azure/report-alpha.api.md b/plugins/events-backend-module-azure/report-alpha.api.md index d9f3a6f000..f90f9bcd13 100644 --- a/plugins/events-backend-module-azure/report-alpha.api.md +++ b/plugins/events-backend-module-azure/report-alpha.api.md @@ -12,10 +12,5 @@ export const eventsModuleAzureDevOpsEventRouter: BackendFeature; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/alpha.d.ts:5:22 - (ae-undocumented) Missing documentation for "eventsModuleAzureDevOpsEventRouter". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-azure/report.api.md b/plugins/events-backend-module-azure/report.api.md index d89a5608e3..a9fe4b176c 100644 --- a/plugins/events-backend-module-azure/report.api.md +++ b/plugins/events-backend-module-azure/report.api.md @@ -20,9 +20,4 @@ export class AzureDevOpsEventRouter extends SubTopicEventRouter { // @public const eventsModuleAzureDevOpsEventRouter: BackendFeature; export default eventsModuleAzureDevOpsEventRouter; - -// Warnings were encountered during analysis: -// -// src/router/AzureDevOpsEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". -// src/router/AzureDevOpsEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". ``` diff --git a/plugins/events-backend-module-bitbucket-cloud/report-alpha.api.md b/plugins/events-backend-module-bitbucket-cloud/report-alpha.api.md index b081759920..2ddc6dc766 100644 --- a/plugins/events-backend-module-bitbucket-cloud/report-alpha.api.md +++ b/plugins/events-backend-module-bitbucket-cloud/report-alpha.api.md @@ -12,10 +12,5 @@ export const eventsModuleBitbucketCloudEventRouter: BackendFeature; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/alpha.d.ts:5:22 - (ae-undocumented) Missing documentation for "eventsModuleBitbucketCloudEventRouter". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-bitbucket-cloud/report.api.md b/plugins/events-backend-module-bitbucket-cloud/report.api.md index 06bd71e7f7..c844e09cf0 100644 --- a/plugins/events-backend-module-bitbucket-cloud/report.api.md +++ b/plugins/events-backend-module-bitbucket-cloud/report.api.md @@ -20,9 +20,4 @@ export class BitbucketCloudEventRouter extends SubTopicEventRouter { // @public const eventsModuleBitbucketCloudEventRouter: BackendFeature; export default eventsModuleBitbucketCloudEventRouter; - -// Warnings were encountered during analysis: -// -// src/router/BitbucketCloudEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". -// src/router/BitbucketCloudEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". ``` diff --git a/plugins/events-backend-module-gerrit/report-alpha.api.md b/plugins/events-backend-module-gerrit/report-alpha.api.md index e37ca3050a..2be8d8d7a0 100644 --- a/plugins/events-backend-module-gerrit/report-alpha.api.md +++ b/plugins/events-backend-module-gerrit/report-alpha.api.md @@ -12,10 +12,5 @@ export const eventsModuleGerritEventRouter: BackendFeature; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/alpha.d.ts:5:22 - (ae-undocumented) Missing documentation for "eventsModuleGerritEventRouter". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend-module-gerrit/report.api.md b/plugins/events-backend-module-gerrit/report.api.md index 1206a50c88..8f80412d7b 100644 --- a/plugins/events-backend-module-gerrit/report.api.md +++ b/plugins/events-backend-module-gerrit/report.api.md @@ -20,9 +20,4 @@ export class GerritEventRouter extends SubTopicEventRouter { // (undocumented) protected getSubscriberId(): string; } - -// Warnings were encountered during analysis: -// -// src/router/GerritEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". -// src/router/GerritEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". ``` diff --git a/plugins/events-backend-module-github/report.api.md b/plugins/events-backend-module-github/report.api.md index a3b8adaaa5..5341f86039 100644 --- a/plugins/events-backend-module-github/report.api.md +++ b/plugins/events-backend-module-github/report.api.md @@ -22,9 +22,4 @@ export class GithubEventRouter extends SubTopicEventRouter { // (undocumented) protected getSubscriberId(): string; } - -// Warnings were encountered during analysis: -// -// src/router/GithubEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". -// src/router/GithubEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". ``` diff --git a/plugins/events-backend-module-gitlab/report.api.md b/plugins/events-backend-module-gitlab/report.api.md index 9753380364..f348436375 100644 --- a/plugins/events-backend-module-gitlab/report.api.md +++ b/plugins/events-backend-module-gitlab/report.api.md @@ -20,9 +20,4 @@ export class GitlabEventRouter extends SubTopicEventRouter { // (undocumented) protected getSubscriberId(): string; } - -// Warnings were encountered during analysis: -// -// src/router/GitlabEventRouter.d.ts:13:5 - (ae-undocumented) Missing documentation for "getSubscriberId". -// src/router/GitlabEventRouter.d.ts:14:5 - (ae-undocumented) Missing documentation for "determineSubTopic". ``` diff --git a/plugins/events-backend-test-utils/report.api.md b/plugins/events-backend-test-utils/report.api.md index d88a9dbee0..9630c3d4e2 100644 --- a/plugins/events-backend-test-utils/report.api.md +++ b/plugins/events-backend-test-utils/report.api.md @@ -60,27 +60,4 @@ export class TestEventSubscriber implements EventSubscriber { // (undocumented) readonly topics: string[]; } - -// Warnings were encountered during analysis: -// -// src/testUtils/TestEventBroker.d.ts:6:1 - (ae-undocumented) Missing documentation for "TestEventBroker". -// src/testUtils/TestEventBroker.d.ts:7:5 - (ae-undocumented) Missing documentation for "published". -// src/testUtils/TestEventBroker.d.ts:8:5 - (ae-undocumented) Missing documentation for "subscribed". -// src/testUtils/TestEventBroker.d.ts:9:5 - (ae-undocumented) Missing documentation for "publish". -// src/testUtils/TestEventBroker.d.ts:10:5 - (ae-undocumented) Missing documentation for "subscribe". -// src/testUtils/TestEventPublisher.d.ts:6:1 - (ae-undocumented) Missing documentation for "TestEventPublisher". -// src/testUtils/TestEventPublisher.d.ts:8:5 - (ae-undocumented) Missing documentation for "setEventBroker". -// src/testUtils/TestEventPublisher.d.ts:9:5 - (ae-undocumented) Missing documentation for "eventBroker". -// src/testUtils/TestEventSubscriber.d.ts:6:1 - (ae-undocumented) Missing documentation for "TestEventSubscriber". -// src/testUtils/TestEventSubscriber.d.ts:7:5 - (ae-undocumented) Missing documentation for "name". -// src/testUtils/TestEventSubscriber.d.ts:8:5 - (ae-undocumented) Missing documentation for "topics". -// src/testUtils/TestEventSubscriber.d.ts:9:5 - (ae-undocumented) Missing documentation for "receivedEvents". -// src/testUtils/TestEventSubscriber.d.ts:11:5 - (ae-undocumented) Missing documentation for "supportsEventTopics". -// src/testUtils/TestEventSubscriber.d.ts:12:5 - (ae-undocumented) Missing documentation for "onEvent". -// src/testUtils/TestEventsService.d.ts:3:1 - (ae-undocumented) Missing documentation for "TestEventsService". -// src/testUtils/TestEventsService.d.ts:5:5 - (ae-undocumented) Missing documentation for "publish". -// src/testUtils/TestEventsService.d.ts:6:5 - (ae-undocumented) Missing documentation for "subscribe". -// src/testUtils/TestEventsService.d.ts:7:5 - (ae-undocumented) Missing documentation for "published". -// src/testUtils/TestEventsService.d.ts:8:5 - (ae-undocumented) Missing documentation for "subscribed". -// src/testUtils/TestEventsService.d.ts:9:5 - (ae-undocumented) Missing documentation for "reset". ``` diff --git a/plugins/events-backend/report-alpha.api.md b/plugins/events-backend/report-alpha.api.md index c9f56bd226..00e51fd29f 100644 --- a/plugins/events-backend/report-alpha.api.md +++ b/plugins/events-backend/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-backend/report.api.md b/plugins/events-backend/report.api.md index e7a33deb07..fb9f5fb237 100644 --- a/plugins/events-backend/report.api.md +++ b/plugins/events-backend/report.api.md @@ -61,14 +61,4 @@ export class HttpPostIngressEventPublisher { logger: LoggerService; }): HttpPostIngressEventPublisher; } - -// Warnings were encountered during analysis: -// -// src/service/DefaultEventBroker.d.ts:21:5 - (ae-undocumented) Missing documentation for "publish". -// src/service/DefaultEventBroker.d.ts:22:5 - (ae-undocumented) Missing documentation for "subscribe". -// src/service/EventsBackend.d.ts:14:5 - (ae-undocumented) Missing documentation for "setEventBroker". -// src/service/EventsBackend.d.ts:15:5 - (ae-undocumented) Missing documentation for "addPublishers". -// src/service/EventsBackend.d.ts:16:5 - (ae-undocumented) Missing documentation for "addSubscribers". -// src/service/http/HttpPostIngressEventPublisher.d.ts:15:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/service/http/HttpPostIngressEventPublisher.d.ts:24:5 - (ae-undocumented) Missing documentation for "bind". ``` diff --git a/plugins/events-node/report-alpha.api.md b/plugins/events-node/report-alpha.api.md index d11b170365..f61048ac94 100644 --- a/plugins/events-node/report-alpha.api.md +++ b/plugins/events-node/report-alpha.api.md @@ -28,14 +28,5 @@ export interface EventsExtensionPoint { // @alpha (undocumented) export const eventsExtensionPoint: ExtensionPoint; -// Warnings were encountered during analysis: -// -// src/extensions.d.ts:5:1 - (ae-undocumented) Missing documentation for "EventsExtensionPoint". -// src/extensions.d.ts:9:5 - (ae-undocumented) Missing documentation for "setEventBroker". -// src/extensions.d.ts:13:5 - (ae-undocumented) Missing documentation for "addPublishers". -// src/extensions.d.ts:17:5 - (ae-undocumented) Missing documentation for "addSubscribers". -// src/extensions.d.ts:18:5 - (ae-undocumented) Missing documentation for "addHttpPostIngress". -// src/extensions.d.ts:23:22 - (ae-undocumented) Missing documentation for "eventsExtensionPoint". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/events-node/report.api.md b/plugins/events-node/report.api.md index 2c06f50d56..9ebaf1a536 100644 --- a/plugins/events-node/report.api.md +++ b/plugins/events-node/report.api.md @@ -139,26 +139,4 @@ export abstract class SubTopicEventRouter extends EventRouter { // (undocumented) protected abstract determineSubTopic(params: EventParams): string | undefined; } - -// Warnings were encountered during analysis: -// -// src/api/DefaultEventsService.d.ts:16:5 - (ae-undocumented) Missing documentation for "create". -// src/api/DefaultEventsService.d.ts:31:5 - (ae-undocumented) Missing documentation for "publish". -// src/api/DefaultEventsService.d.ts:32:5 - (ae-undocumented) Missing documentation for "subscribe". -// src/api/EventParams.d.ts:4:1 - (ae-undocumented) Missing documentation for "EventParams". -// src/api/EventPublisher.d.ts:15:5 - (ae-undocumented) Missing documentation for "setEventBroker". -// src/api/EventRouter.d.ts:18:5 - (ae-undocumented) Missing documentation for "getSubscriberId". -// src/api/EventRouter.d.ts:19:5 - (ae-undocumented) Missing documentation for "determineDestinationTopic". -// src/api/EventRouter.d.ts:26:5 - (ae-undocumented) Missing documentation for "onEvent". -// src/api/EventsService.d.ts:26:1 - (ae-undocumented) Missing documentation for "EventsServiceSubscribeOptions". -// src/api/EventsService.d.ts:37:1 - (ae-undocumented) Missing documentation for "EventsServiceEventHandler". -// src/api/SubTopicEventRouter.d.ts:18:5 - (ae-undocumented) Missing documentation for "determineSubTopic". -// src/api/SubTopicEventRouter.d.ts:19:5 - (ae-undocumented) Missing documentation for "determineDestinationTopic". -// src/api/http/HttpPostIngressOptions.d.ts:5:1 - (ae-undocumented) Missing documentation for "HttpPostIngressOptions". -// src/api/http/HttpPostIngressOptions.d.ts:6:5 - (ae-undocumented) Missing documentation for "topic". -// src/api/http/HttpPostIngressOptions.d.ts:7:5 - (ae-undocumented) Missing documentation for "validator". -// src/api/http/validation/RequestDetails.d.ts:4:1 - (ae-undocumented) Missing documentation for "RequestDetails". -// src/api/http/validation/RequestRejectionDetails.d.ts:8:5 - (ae-undocumented) Missing documentation for "status". -// src/api/http/validation/RequestRejectionDetails.d.ts:9:5 - (ae-undocumented) Missing documentation for "payload". -// src/service.d.ts:10:22 - (ae-undocumented) Missing documentation for "eventsServiceFactory". ``` diff --git a/plugins/home-react/report.api.md b/plugins/home-react/report.api.md index 802d73605c..268f598a63 100644 --- a/plugins/home-react/report.api.md +++ b/plugins/home-react/report.api.md @@ -74,15 +74,4 @@ export const SettingsModal: (props: { componentName?: string; children: JSX.Element; }) => React_2.JSX.Element; - -// Warnings were encountered during analysis: -// -// src/components/SettingsModal.d.ts:3:22 - (ae-undocumented) Missing documentation for "SettingsModal". -// src/extensions.d.ts:6:1 - (ae-undocumented) Missing documentation for "ComponentRenderer". -// src/extensions.d.ts:12:1 - (ae-undocumented) Missing documentation for "ComponentParts". -// src/extensions.d.ts:21:1 - (ae-undocumented) Missing documentation for "RendererProps". -// src/extensions.d.ts:27:1 - (ae-undocumented) Missing documentation for "CardExtensionProps". -// src/extensions.d.ts:33:1 - (ae-undocumented) Missing documentation for "CardLayout". -// src/extensions.d.ts:48:1 - (ae-undocumented) Missing documentation for "CardSettings". -// src/extensions.d.ts:55:1 - (ae-undocumented) Missing documentation for "CardConfig". ``` diff --git a/plugins/home/report-alpha.api.md b/plugins/home/report-alpha.api.md index e8f8ddf6a1..429af86a12 100644 --- a/plugins/home/report-alpha.api.md +++ b/plugins/home/report-alpha.api.md @@ -78,10 +78,5 @@ export const titleExtensionDataRef: ConfigurableExtensionDataRef< {} >; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:5:22 - (ae-undocumented) Missing documentation for "titleExtensionDataRef". -// src/alpha.d.ts:9:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/home/report.api.md b/plugins/home/report.api.md index 985aed50ca..023c649ab4 100644 --- a/plugins/home/report.api.md +++ b/plugins/home/report.api.md @@ -327,34 +327,4 @@ export const WelcomeTitle: ({ export type WelcomeTitleLanguageProps = { language?: string[]; }; - -// Warnings were encountered during analysis: -// -// src/api/VisitsApi.d.ts:106:22 - (ae-undocumented) Missing documentation for "visitsApiRef". -// src/api/VisitsStorageApi.d.ts:4:1 - (ae-undocumented) Missing documentation for "VisitsStorageApiOptions". -// src/api/VisitsStorageApi.d.ts:20:5 - (ae-undocumented) Missing documentation for "create". -// src/api/VisitsWebStorageApi.d.ts:4:1 - (ae-undocumented) Missing documentation for "VisitsWebStorageApiOptions". -// src/api/VisitsWebStorageApi.d.ts:14:5 - (ae-undocumented) Missing documentation for "create". -// src/assets/TemplateBackstageLogo.d.ts:3:22 - (ae-undocumented) Missing documentation for "TemplateBackstageLogo". -// src/assets/TemplateBackstageLogoIcon.d.ts:3:22 - (ae-undocumented) Missing documentation for "TemplateBackstageLogoIcon". -// src/deprecated.d.ts:7:22 - (ae-undocumented) Missing documentation for "createCardExtension". -// src/deprecated.d.ts:12:1 - (ae-undocumented) Missing documentation for "CardExtensionProps". -// src/deprecated.d.ts:17:1 - (ae-undocumented) Missing documentation for "CardLayout". -// src/deprecated.d.ts:22:1 - (ae-undocumented) Missing documentation for "CardSettings". -// src/deprecated.d.ts:27:1 - (ae-undocumented) Missing documentation for "CardConfig". -// src/deprecated.d.ts:32:1 - (ae-undocumented) Missing documentation for "ComponentParts". -// src/deprecated.d.ts:37:1 - (ae-undocumented) Missing documentation for "ComponentRenderer". -// src/deprecated.d.ts:42:1 - (ae-undocumented) Missing documentation for "RendererProps". -// src/deprecated.d.ts:47:22 - (ae-undocumented) Missing documentation for "SettingsModal". -// src/homePageComponents/HeaderWorldClock/HeaderWorldClock.d.ts:3:1 - (ae-undocumented) Missing documentation for "ClockConfig". -// src/homePageComponents/Toolkit/Context.d.ts:3:1 - (ae-undocumented) Missing documentation for "Tool". -// src/homePageComponents/VisitedByType/Content.d.ts:4:1 - (ae-undocumented) Missing documentation for "VisitedByTypeKind". -// src/homePageComponents/VisitedByType/Content.d.ts:6:1 - (ae-undocumented) Missing documentation for "VisitedByTypeProps". -// src/homePageComponents/WelcomeTitle/WelcomeTitle.d.ts:3:1 - (ae-undocumented) Missing documentation for "WelcomeTitleLanguageProps". -// src/plugin.d.ts:5:22 - (ae-undocumented) Missing documentation for "homePlugin". -// src/plugin.d.ts:9:22 - (ae-undocumented) Missing documentation for "HomepageCompositionRoot". -// src/plugin.d.ts:14:22 - (ae-undocumented) Missing documentation for "ComponentAccordion". -// src/plugin.d.ts:24:22 - (ae-undocumented) Missing documentation for "ComponentTabs". -// src/plugin.d.ts:32:22 - (ae-undocumented) Missing documentation for "ComponentTab". -// src/plugin.d.ts:53:22 - (ae-undocumented) Missing documentation for "HomePageRandomJoke". ``` diff --git a/plugins/kubernetes-backend/report-alpha.api.md b/plugins/kubernetes-backend/report-alpha.api.md index b4c4df2287..77bd4e1774 100644 --- a/plugins/kubernetes-backend/report-alpha.api.md +++ b/plugins/kubernetes-backend/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/kubernetes-backend/report.api.md b/plugins/kubernetes-backend/report.api.md index 9bcef16843..281c8e5cac 100644 --- a/plugins/kubernetes-backend/report.api.md +++ b/plugins/kubernetes-backend/report.api.md @@ -430,118 +430,4 @@ export type SigningCreds = { secretAccessKey: string | undefined; sessionToken: string | undefined; }; - -// Warnings were encountered during analysis: -// -// src/auth/AksStrategy.d.ts:7:1 - (ae-undocumented) Missing documentation for "AksStrategy". -// src/auth/AksStrategy.d.ts:8:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/AksStrategy.d.ts:9:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/AksStrategy.d.ts:10:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/AnonymousStrategy.d.ts:6:1 - (ae-undocumented) Missing documentation for "AnonymousStrategy". -// src/auth/AnonymousStrategy.d.ts:7:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/AnonymousStrategy.d.ts:8:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/AnonymousStrategy.d.ts:9:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/AwsIamStrategy.d.ts:7:1 - (ae-undocumented) Missing documentation for "SigningCreds". -// src/auth/AwsIamStrategy.d.ts:16:1 - (ae-undocumented) Missing documentation for "AwsIamStrategy". -// src/auth/AwsIamStrategy.d.ts:21:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/AwsIamStrategy.d.ts:22:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/AwsIamStrategy.d.ts:24:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/AzureIdentityStrategy.d.ts:8:1 - (ae-undocumented) Missing documentation for "AzureIdentityStrategy". -// src/auth/AzureIdentityStrategy.d.ts:14:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/AzureIdentityStrategy.d.ts:15:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/AzureIdentityStrategy.d.ts:19:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/DispatchStrategy.d.ts:7:1 - (ae-undocumented) Missing documentation for "DispatchStrategyOptions". -// src/auth/DispatchStrategy.d.ts:19:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/DispatchStrategy.d.ts:20:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/DispatchStrategy.d.ts:21:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/GoogleServiceAccountStrategy.d.ts:6:1 - (ae-undocumented) Missing documentation for "GoogleServiceAccountStrategy". -// src/auth/GoogleServiceAccountStrategy.d.ts:7:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/GoogleServiceAccountStrategy.d.ts:8:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/GoogleServiceAccountStrategy.d.ts:9:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/GoogleStrategy.d.ts:7:1 - (ae-undocumented) Missing documentation for "GoogleStrategy". -// src/auth/GoogleStrategy.d.ts:8:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/GoogleStrategy.d.ts:9:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/GoogleStrategy.d.ts:10:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/OidcStrategy.d.ts:7:1 - (ae-undocumented) Missing documentation for "OidcStrategy". -// src/auth/OidcStrategy.d.ts:8:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/OidcStrategy.d.ts:9:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/OidcStrategy.d.ts:10:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/ServiceAccountStrategy.d.ts:6:1 - (ae-undocumented) Missing documentation for "ServiceAccountStrategy". -// src/auth/ServiceAccountStrategy.d.ts:7:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/auth/ServiceAccountStrategy.d.ts:8:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/auth/ServiceAccountStrategy.d.ts:9:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/auth/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "AuthenticationStrategy". -// src/auth/types.d.ts:9:1 - (ae-undocumented) Missing documentation for "KubernetesCredential". -// src/service/KubernetesBuilder.d.ts:14:1 - (ae-undocumented) Missing documentation for "KubernetesEnvironment". -// src/service/KubernetesBuilder.d.ts:15:5 - (ae-undocumented) Missing documentation for "logger". -// src/service/KubernetesBuilder.d.ts:16:5 - (ae-undocumented) Missing documentation for "config". -// src/service/KubernetesBuilder.d.ts:17:5 - (ae-undocumented) Missing documentation for "catalogApi". -// src/service/KubernetesBuilder.d.ts:18:5 - (ae-undocumented) Missing documentation for "discovery". -// src/service/KubernetesBuilder.d.ts:19:5 - (ae-undocumented) Missing documentation for "permissions". -// src/service/KubernetesBuilder.d.ts:20:5 - (ae-undocumented) Missing documentation for "auth". -// src/service/KubernetesBuilder.d.ts:21:5 - (ae-undocumented) Missing documentation for "httpAuth". -// src/service/KubernetesBuilder.d.ts:44:1 - (ae-undocumented) Missing documentation for "KubernetesBuilder". -// src/service/KubernetesBuilder.d.ts:45:5 - (ae-undocumented) Missing documentation for "env". -// src/service/KubernetesBuilder.d.ts:53:5 - (ae-undocumented) Missing documentation for "createBuilder". -// src/service/KubernetesBuilder.d.ts:55:5 - (ae-undocumented) Missing documentation for "build". -// src/service/KubernetesBuilder.d.ts:56:5 - (ae-undocumented) Missing documentation for "setClusterSupplier". -// src/service/KubernetesBuilder.d.ts:57:5 - (ae-undocumented) Missing documentation for "setDefaultClusterRefreshInterval". -// src/service/KubernetesBuilder.d.ts:58:5 - (ae-undocumented) Missing documentation for "setObjectsProvider". -// src/service/KubernetesBuilder.d.ts:59:5 - (ae-undocumented) Missing documentation for "setFetcher". -// src/service/KubernetesBuilder.d.ts:60:5 - (ae-undocumented) Missing documentation for "setServiceLocator". -// src/service/KubernetesBuilder.d.ts:61:5 - (ae-undocumented) Missing documentation for "setProxy". -// src/service/KubernetesBuilder.d.ts:62:5 - (ae-undocumented) Missing documentation for "setAuthStrategyMap". -// src/service/KubernetesBuilder.d.ts:65:5 - (ae-undocumented) Missing documentation for "addAuthStrategy". -// src/service/KubernetesBuilder.d.ts:66:5 - (ae-undocumented) Missing documentation for "buildCustomResources". -// src/service/KubernetesBuilder.d.ts:67:5 - (ae-undocumented) Missing documentation for "buildClusterSupplier". -// src/service/KubernetesBuilder.d.ts:68:5 - (ae-undocumented) Missing documentation for "buildObjectsProvider". -// src/service/KubernetesBuilder.d.ts:69:5 - (ae-undocumented) Missing documentation for "buildFetcher". -// src/service/KubernetesBuilder.d.ts:70:5 - (ae-undocumented) Missing documentation for "buildServiceLocator". -// src/service/KubernetesBuilder.d.ts:71:5 - (ae-undocumented) Missing documentation for "buildMultiTenantServiceLocator". -// src/service/KubernetesBuilder.d.ts:72:5 - (ae-undocumented) Missing documentation for "buildSingleTenantServiceLocator". -// src/service/KubernetesBuilder.d.ts:73:5 - (ae-undocumented) Missing documentation for "buildCatalogRelationServiceLocator". -// src/service/KubernetesBuilder.d.ts:74:5 - (ae-undocumented) Missing documentation for "buildHttpServiceLocator". -// src/service/KubernetesBuilder.d.ts:75:5 - (ae-undocumented) Missing documentation for "buildProxy". -// src/service/KubernetesBuilder.d.ts:76:5 - (ae-undocumented) Missing documentation for "buildRouter". -// src/service/KubernetesBuilder.d.ts:77:5 - (ae-undocumented) Missing documentation for "buildAuthStrategyMap". -// src/service/KubernetesBuilder.d.ts:80:5 - (ae-undocumented) Missing documentation for "fetchClusterDetails". -// src/service/KubernetesBuilder.d.ts:83:5 - (ae-undocumented) Missing documentation for "getServiceLocatorMethod". -// src/service/KubernetesBuilder.d.ts:84:5 - (ae-undocumented) Missing documentation for "getFetcher". -// src/service/KubernetesBuilder.d.ts:85:5 - (ae-undocumented) Missing documentation for "getClusterSupplier". -// src/service/KubernetesBuilder.d.ts:86:5 - (ae-undocumented) Missing documentation for "getServiceLocator". -// src/service/KubernetesBuilder.d.ts:87:5 - (ae-undocumented) Missing documentation for "getObjectsProvider". -// src/service/KubernetesBuilder.d.ts:88:5 - (ae-undocumented) Missing documentation for "getObjectTypesToFetch". -// src/service/KubernetesBuilder.d.ts:89:5 - (ae-undocumented) Missing documentation for "getProxy". -// src/service/KubernetesBuilder.d.ts:90:5 - (ae-undocumented) Missing documentation for "getAuthStrategyMap". -// src/service/KubernetesFanOutHandler.d.ts:9:22 - (ae-undocumented) Missing documentation for "DEFAULT_OBJECTS". -// src/service/KubernetesProxy.d.ts:50:5 - (ae-undocumented) Missing documentation for "createRequestHandler". -// src/service/router.d.ts:11:1 - (ae-undocumented) Missing documentation for "RouterOptions". -// src/service/router.d.ts:12:5 - (ae-undocumented) Missing documentation for "logger". -// src/service/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "config". -// src/service/router.d.ts:14:5 - (ae-undocumented) Missing documentation for "catalogApi". -// src/service/router.d.ts:15:5 - (ae-undocumented) Missing documentation for "clusterSupplier". -// src/service/router.d.ts:16:5 - (ae-undocumented) Missing documentation for "discovery". -// src/service/router.d.ts:17:5 - (ae-undocumented) Missing documentation for "permissions". -// src/types/types.d.ts:9:1 - (ae-undocumented) Missing documentation for "ServiceLocatorMethod". -// src/types/types.d.ts:14:1 - (ae-undocumented) Missing documentation for "KubernetesObjectsProviderOptions". -// src/types/types.d.ts:15:5 - (ae-undocumented) Missing documentation for "logger". -// src/types/types.d.ts:16:5 - (ae-undocumented) Missing documentation for "config". -// src/types/types.d.ts:17:5 - (ae-undocumented) Missing documentation for "fetcher". -// src/types/types.d.ts:18:5 - (ae-undocumented) Missing documentation for "serviceLocator". -// src/types/types.d.ts:19:5 - (ae-undocumented) Missing documentation for "customResources". -// src/types/types.d.ts:20:5 - (ae-undocumented) Missing documentation for "objectTypesToFetch". -// src/types/types.d.ts:26:1 - (ae-undocumented) Missing documentation for "ObjectsByEntityRequest". -// src/types/types.d.ts:30:1 - (ae-undocumented) Missing documentation for "KubernetesObjectsProvider". -// src/types/types.d.ts:34:1 - (ae-undocumented) Missing documentation for "CustomResourcesByEntity". -// src/types/types.d.ts:39:1 - (ae-undocumented) Missing documentation for "AuthMetadata". -// src/types/types.d.ts:44:1 - (ae-undocumented) Missing documentation for "ClusterDetails". -// src/types/types.d.ts:49:1 - (ae-undocumented) Missing documentation for "KubernetesClustersSupplier". -// src/types/types.d.ts:53:1 - (ae-undocumented) Missing documentation for "KubernetesObjectTypes". -// src/types/types.d.ts:57:1 - (ae-undocumented) Missing documentation for "ObjectToFetch". -// src/types/types.d.ts:61:1 - (ae-undocumented) Missing documentation for "CustomResource". -// src/types/types.d.ts:65:1 - (ae-undocumented) Missing documentation for "ObjectFetchParams". -// src/types/types.d.ts:69:1 - (ae-undocumented) Missing documentation for "FetchResponseWrapper". -// src/types/types.d.ts:73:1 - (ae-undocumented) Missing documentation for "KubernetesFetcher". -// src/types/types.d.ts:77:1 - (ae-undocumented) Missing documentation for "ServiceLocatorRequestContext". -// src/types/types.d.ts:81:1 - (ae-undocumented) Missing documentation for "KubernetesServiceLocator". ``` diff --git a/plugins/kubernetes-cluster/report.api.md b/plugins/kubernetes-cluster/report.api.md index 5e16134c2d..10d248097a 100644 --- a/plugins/kubernetes-cluster/report.api.md +++ b/plugins/kubernetes-cluster/report.api.md @@ -21,9 +21,4 @@ export const isKubernetesClusterAvailable: (entity: Entity) => boolean; // @public (undocumented) export const Router: () => React_2.JSX.Element; - -// Warnings were encountered during analysis: -// -// src/Router.d.ts:8:22 - (ae-undocumented) Missing documentation for "isKubernetesClusterAvailable". -// src/Router.d.ts:14:22 - (ae-undocumented) Missing documentation for "Router". ``` diff --git a/plugins/kubernetes-common/report.api.md b/plugins/kubernetes-common/report.api.md index 283788cfe5..81e9ca28e7 100644 --- a/plugins/kubernetes-common/report.api.md +++ b/plugins/kubernetes-common/report.api.md @@ -465,140 +465,4 @@ export interface WorkloadsByEntityRequest { // (undocumented) entity: Entity; } - -// Warnings were encountered during analysis: -// -// src/error-detection/types.d.ts:19:5 - (ae-undocumented) Missing documentation for "name". -// src/error-detection/types.d.ts:20:5 - (ae-undocumented) Missing documentation for "namespace". -// src/error-detection/types.d.ts:21:5 - (ae-undocumented) Missing documentation for "kind". -// src/error-detection/types.d.ts:22:5 - (ae-undocumented) Missing documentation for "apiGroup". -// src/error-detection/types.d.ts:30:5 - (ae-undocumented) Missing documentation for "type". -// src/error-detection/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "severity". -// src/error-detection/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "message". -// src/error-detection/types.d.ts:33:5 - (ae-undocumented) Missing documentation for "proposedFix". -// src/error-detection/types.d.ts:34:5 - (ae-undocumented) Missing documentation for "sourceRef". -// src/error-detection/types.d.ts:35:5 - (ae-undocumented) Missing documentation for "occurrenceCount". -// src/error-detection/types.d.ts:38:1 - (ae-undocumented) Missing documentation for "ProposedFix". -// src/error-detection/types.d.ts:40:1 - (ae-undocumented) Missing documentation for "ProposedFixBase". -// src/error-detection/types.d.ts:41:5 - (ae-undocumented) Missing documentation for "errorType". -// src/error-detection/types.d.ts:42:5 - (ae-undocumented) Missing documentation for "rootCauseExplanation". -// src/error-detection/types.d.ts:43:5 - (ae-undocumented) Missing documentation for "actions". -// src/error-detection/types.d.ts:46:1 - (ae-undocumented) Missing documentation for "LogSolution". -// src/error-detection/types.d.ts:47:5 - (ae-undocumented) Missing documentation for "type". -// src/error-detection/types.d.ts:48:5 - (ae-undocumented) Missing documentation for "container". -// src/error-detection/types.d.ts:51:1 - (ae-undocumented) Missing documentation for "DocsSolution". -// src/error-detection/types.d.ts:52:5 - (ae-undocumented) Missing documentation for "type". -// src/error-detection/types.d.ts:53:5 - (ae-undocumented) Missing documentation for "docsLink". -// src/error-detection/types.d.ts:56:1 - (ae-undocumented) Missing documentation for "EventsSolution". -// src/error-detection/types.d.ts:57:5 - (ae-undocumented) Missing documentation for "type". -// src/error-detection/types.d.ts:58:5 - (ae-undocumented) Missing documentation for "podName". -// src/error-detection/types.d.ts:61:1 - (ae-undocumented) Missing documentation for "ErrorMapper". -// src/error-detection/types.d.ts:62:5 - (ae-undocumented) Missing documentation for "detectErrors". -// src/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "KubernetesRequestAuth". -// src/types.d.ts:9:1 - (ae-undocumented) Missing documentation for "CustomResourceMatcher". -// src/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "group". -// src/types.d.ts:11:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/types.d.ts:12:5 - (ae-undocumented) Missing documentation for "plural". -// src/types.d.ts:15:1 - (ae-undocumented) Missing documentation for "WorkloadsByEntityRequest". -// src/types.d.ts:16:5 - (ae-undocumented) Missing documentation for "auth". -// src/types.d.ts:17:5 - (ae-undocumented) Missing documentation for "entity". -// src/types.d.ts:20:1 - (ae-undocumented) Missing documentation for "CustomObjectsByEntityRequest". -// src/types.d.ts:21:5 - (ae-undocumented) Missing documentation for "auth". -// src/types.d.ts:22:5 - (ae-undocumented) Missing documentation for "customResources". -// src/types.d.ts:23:5 - (ae-undocumented) Missing documentation for "entity". -// src/types.d.ts:26:1 - (ae-undocumented) Missing documentation for "KubernetesRequestBody". -// src/types.d.ts:27:5 - (ae-undocumented) Missing documentation for "auth". -// src/types.d.ts:28:5 - (ae-undocumented) Missing documentation for "entity". -// src/types.d.ts:31:1 - (ae-undocumented) Missing documentation for "ClusterAttributes". -// src/types.d.ts:73:1 - (ae-undocumented) Missing documentation for "ClusterObjects". -// src/types.d.ts:74:5 - (ae-undocumented) Missing documentation for "cluster". -// src/types.d.ts:75:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:76:5 - (ae-undocumented) Missing documentation for "podMetrics". -// src/types.d.ts:77:5 - (ae-undocumented) Missing documentation for "errors". -// src/types.d.ts:80:1 - (ae-undocumented) Missing documentation for "ObjectsByEntityResponse". -// src/types.d.ts:81:5 - (ae-undocumented) Missing documentation for "items". -// src/types.d.ts:84:1 - (ae-undocumented) Missing documentation for "AuthProviderType". -// src/types.d.ts:86:1 - (ae-undocumented) Missing documentation for "FetchResponse". -// src/types.d.ts:88:1 - (ae-undocumented) Missing documentation for "PodFetchResponse". -// src/types.d.ts:89:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:90:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:93:1 - (ae-undocumented) Missing documentation for "ServiceFetchResponse". -// src/types.d.ts:94:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:95:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:98:1 - (ae-undocumented) Missing documentation for "ConfigMapFetchResponse". -// src/types.d.ts:99:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:100:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:103:1 - (ae-undocumented) Missing documentation for "DeploymentFetchResponse". -// src/types.d.ts:104:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:105:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:108:1 - (ae-undocumented) Missing documentation for "ReplicaSetsFetchResponse". -// src/types.d.ts:109:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:110:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:113:1 - (ae-undocumented) Missing documentation for "LimitRangeFetchResponse". -// src/types.d.ts:114:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:115:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:118:1 - (ae-undocumented) Missing documentation for "ResourceQuotaFetchResponse". -// src/types.d.ts:119:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:120:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:123:1 - (ae-undocumented) Missing documentation for "HorizontalPodAutoscalersFetchResponse". -// src/types.d.ts:124:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:125:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:128:1 - (ae-undocumented) Missing documentation for "JobsFetchResponse". -// src/types.d.ts:129:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:130:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:133:1 - (ae-undocumented) Missing documentation for "CronJobsFetchResponse". -// src/types.d.ts:134:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:135:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:138:1 - (ae-undocumented) Missing documentation for "IngressesFetchResponse". -// src/types.d.ts:139:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:140:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:143:1 - (ae-undocumented) Missing documentation for "CustomResourceFetchResponse". -// src/types.d.ts:144:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:145:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:148:1 - (ae-undocumented) Missing documentation for "StatefulSetsFetchResponse". -// src/types.d.ts:149:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:150:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:153:1 - (ae-undocumented) Missing documentation for "DaemonSetsFetchResponse". -// src/types.d.ts:154:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:155:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:158:1 - (ae-undocumented) Missing documentation for "PodStatusFetchResponse". -// src/types.d.ts:159:5 - (ae-undocumented) Missing documentation for "type". -// src/types.d.ts:160:5 - (ae-undocumented) Missing documentation for "resources". -// src/types.d.ts:163:1 - (ae-undocumented) Missing documentation for "KubernetesFetchError". -// src/types.d.ts:165:1 - (ae-undocumented) Missing documentation for "StatusError". -// src/types.d.ts:166:5 - (ae-undocumented) Missing documentation for "errorType". -// src/types.d.ts:167:5 - (ae-undocumented) Missing documentation for "statusCode". -// src/types.d.ts:168:5 - (ae-undocumented) Missing documentation for "resourcePath". -// src/types.d.ts:171:1 - (ae-undocumented) Missing documentation for "RawFetchError". -// src/types.d.ts:172:5 - (ae-undocumented) Missing documentation for "errorType". -// src/types.d.ts:173:5 - (ae-undocumented) Missing documentation for "message". -// src/types.d.ts:176:1 - (ae-undocumented) Missing documentation for "KubernetesErrorTypes". -// src/types.d.ts:178:1 - (ae-undocumented) Missing documentation for "ClientCurrentResourceUsage". -// src/types.d.ts:179:5 - (ae-undocumented) Missing documentation for "currentUsage". -// src/types.d.ts:180:5 - (ae-undocumented) Missing documentation for "requestTotal". -// src/types.d.ts:181:5 - (ae-undocumented) Missing documentation for "limitTotal". -// src/types.d.ts:184:1 - (ae-undocumented) Missing documentation for "ClientContainerStatus". -// src/types.d.ts:185:5 - (ae-undocumented) Missing documentation for "container". -// src/types.d.ts:186:5 - (ae-undocumented) Missing documentation for "cpuUsage". -// src/types.d.ts:187:5 - (ae-undocumented) Missing documentation for "memoryUsage". -// src/types.d.ts:190:1 - (ae-undocumented) Missing documentation for "ClientPodStatus". -// src/types.d.ts:191:5 - (ae-undocumented) Missing documentation for "pod". -// src/types.d.ts:192:5 - (ae-undocumented) Missing documentation for "cpu". -// src/types.d.ts:193:5 - (ae-undocumented) Missing documentation for "memory". -// src/types.d.ts:194:5 - (ae-undocumented) Missing documentation for "containers". -// src/types.d.ts:197:1 - (ae-undocumented) Missing documentation for "DeploymentResources". -// src/types.d.ts:198:5 - (ae-undocumented) Missing documentation for "pods". -// src/types.d.ts:199:5 - (ae-undocumented) Missing documentation for "replicaSets". -// src/types.d.ts:200:5 - (ae-undocumented) Missing documentation for "deployments". -// src/types.d.ts:201:5 - (ae-undocumented) Missing documentation for "horizontalPodAutoscalers". -// src/types.d.ts:204:1 - (ae-undocumented) Missing documentation for "GroupedResponses". -// src/types.d.ts:205:5 - (ae-undocumented) Missing documentation for "services". -// src/types.d.ts:206:5 - (ae-undocumented) Missing documentation for "configMaps". -// src/types.d.ts:207:5 - (ae-undocumented) Missing documentation for "ingresses". -// src/types.d.ts:208:5 - (ae-undocumented) Missing documentation for "jobs". -// src/types.d.ts:209:5 - (ae-undocumented) Missing documentation for "cronJobs". -// src/types.d.ts:210:5 - (ae-undocumented) Missing documentation for "customResources". -// src/types.d.ts:211:5 - (ae-undocumented) Missing documentation for "statefulsets". -// src/types.d.ts:212:5 - (ae-undocumented) Missing documentation for "daemonSets". -// src/util/response.d.ts:4:22 - (ae-undocumented) Missing documentation for "groupResponses". ``` diff --git a/plugins/kubernetes-node/report.api.md b/plugins/kubernetes-node/report.api.md index 20c7f76b1f..f5b210b424 100644 --- a/plugins/kubernetes-node/report.api.md +++ b/plugins/kubernetes-node/report.api.md @@ -282,60 +282,4 @@ export interface ServiceLocatorRequestContext { // (undocumented) objectTypesToFetch: Set; } - -// Warnings were encountered during analysis: -// -// src/auth/PinnipedHelper.d.ts:7:1 - (ae-undocumented) Missing documentation for "PinnipedClientCerts". -// src/auth/PinnipedHelper.d.ts:16:1 - (ae-undocumented) Missing documentation for "PinnipedParameters". -// src/auth/PinnipedHelper.d.ts:31:1 - (ae-undocumented) Missing documentation for "PinnipedHelper". -// src/auth/PinnipedHelper.d.ts:34:5 - (ae-undocumented) Missing documentation for "tokenCredentialRequest". -// src/extensions.d.ts:8:5 - (ae-undocumented) Missing documentation for "addObjectsProvider". -// src/extensions.d.ts:22:5 - (ae-undocumented) Missing documentation for "addClusterSupplier". -// src/extensions.d.ts:36:5 - (ae-undocumented) Missing documentation for "addAuthStrategy". -// src/extensions.d.ts:50:5 - (ae-undocumented) Missing documentation for "addFetcher". -// src/extensions.d.ts:64:5 - (ae-undocumented) Missing documentation for "addServiceLocator". -// src/types/types.d.ts:9:1 - (ae-undocumented) Missing documentation for "KubernetesObjectsProvider". -// src/types/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "getKubernetesObjectsByEntity". -// src/types/types.d.ts:13:5 - (ae-undocumented) Missing documentation for "getCustomResourcesByEntity". -// src/types/types.d.ts:21:1 - (ae-undocumented) Missing documentation for "KubernetesObjectsByEntity". -// src/types/types.d.ts:22:5 - (ae-undocumented) Missing documentation for "entity". -// src/types/types.d.ts:23:5 - (ae-undocumented) Missing documentation for "auth". -// src/types/types.d.ts:29:1 - (ae-undocumented) Missing documentation for "CustomResourcesByEntity". -// src/types/types.d.ts:30:5 - (ae-undocumented) Missing documentation for "customResources". -// src/types/types.d.ts:41:1 - (ae-undocumented) Missing documentation for "ClusterDetails". -// src/types/types.d.ts:50:5 - (ae-undocumented) Missing documentation for "url". -// src/types/types.d.ts:51:5 - (ae-undocumented) Missing documentation for "authMetadata". -// src/types/types.d.ts:52:5 - (ae-undocumented) Missing documentation for "skipTLSVerify". -// src/types/types.d.ts:58:5 - (ae-undocumented) Missing documentation for "caData". -// src/types/types.d.ts:59:5 - (ae-undocumented) Missing documentation for "caFile". -// src/types/types.d.ts:131:1 - (ae-undocumented) Missing documentation for "AuthenticationStrategy". -// src/types/types.d.ts:132:5 - (ae-undocumented) Missing documentation for "getCredential". -// src/types/types.d.ts:133:5 - (ae-undocumented) Missing documentation for "validateCluster". -// src/types/types.d.ts:134:5 - (ae-undocumented) Missing documentation for "presentAuthMetadata". -// src/types/types.d.ts:140:1 - (ae-undocumented) Missing documentation for "KubernetesObjectTypes". -// src/types/types.d.ts:145:1 - (ae-undocumented) Missing documentation for "ObjectToFetch". -// src/types/types.d.ts:146:5 - (ae-undocumented) Missing documentation for "objectType". -// src/types/types.d.ts:147:5 - (ae-undocumented) Missing documentation for "group". -// src/types/types.d.ts:148:5 - (ae-undocumented) Missing documentation for "apiVersion". -// src/types/types.d.ts:149:5 - (ae-undocumented) Missing documentation for "plural". -// src/types/types.d.ts:155:1 - (ae-undocumented) Missing documentation for "CustomResource". -// src/types/types.d.ts:156:5 - (ae-undocumented) Missing documentation for "objectType". -// src/types/types.d.ts:162:1 - (ae-undocumented) Missing documentation for "ObjectFetchParams". -// src/types/types.d.ts:163:5 - (ae-undocumented) Missing documentation for "serviceId". -// src/types/types.d.ts:164:5 - (ae-undocumented) Missing documentation for "clusterDetails". -// src/types/types.d.ts:165:5 - (ae-undocumented) Missing documentation for "credential". -// src/types/types.d.ts:166:5 - (ae-undocumented) Missing documentation for "objectTypesToFetch". -// src/types/types.d.ts:167:5 - (ae-undocumented) Missing documentation for "labelSelector". -// src/types/types.d.ts:168:5 - (ae-undocumented) Missing documentation for "customResources". -// src/types/types.d.ts:169:5 - (ae-undocumented) Missing documentation for "namespace". -// src/types/types.d.ts:175:1 - (ae-undocumented) Missing documentation for "FetchResponseWrapper". -// src/types/types.d.ts:176:5 - (ae-undocumented) Missing documentation for "errors". -// src/types/types.d.ts:177:5 - (ae-undocumented) Missing documentation for "responses". -// src/types/types.d.ts:185:5 - (ae-undocumented) Missing documentation for "fetchObjectsForService". -// src/types/types.d.ts:186:5 - (ae-undocumented) Missing documentation for "fetchPodMetricsByNamespaces". -// src/types/types.d.ts:191:1 - (ae-undocumented) Missing documentation for "ServiceLocatorRequestContext". -// src/types/types.d.ts:192:5 - (ae-undocumented) Missing documentation for "objectTypesToFetch". -// src/types/types.d.ts:193:5 - (ae-undocumented) Missing documentation for "customResources". -// src/types/types.d.ts:194:5 - (ae-undocumented) Missing documentation for "credentials". -// src/types/types.d.ts:201:5 - (ae-undocumented) Missing documentation for "getClustersByEntity". ``` diff --git a/plugins/kubernetes-react/report.api.md b/plugins/kubernetes-react/report.api.md index 9b0080f019..adb75a7d60 100644 --- a/plugins/kubernetes-react/report.api.md +++ b/plugins/kubernetes-react/report.api.md @@ -865,173 +865,4 @@ export const usePodMetrics: ( clusterName: string, matcher: PodMetricsMatcher, ) => ClientPodStatus | undefined; - -// Warnings were encountered during analysis: -// -// src/api/KubernetesBackendClient.d.ts:6:1 - (ae-undocumented) Missing documentation for "KubernetesBackendClient". -// src/api/KubernetesBackendClient.d.ts:17:5 - (ae-undocumented) Missing documentation for "getCluster". -// src/api/KubernetesBackendClient.d.ts:23:5 - (ae-undocumented) Missing documentation for "getObjectsByEntity". -// src/api/KubernetesBackendClient.d.ts:24:5 - (ae-undocumented) Missing documentation for "getWorkloadsByEntity". -// src/api/KubernetesBackendClient.d.ts:25:5 - (ae-undocumented) Missing documentation for "getCustomObjectsByEntity". -// src/api/KubernetesBackendClient.d.ts:26:5 - (ae-undocumented) Missing documentation for "getClusters". -// src/api/KubernetesBackendClient.d.ts:30:5 - (ae-undocumented) Missing documentation for "proxy". -// src/api/KubernetesClusterLinkFormatter.d.ts:4:1 - (ae-undocumented) Missing documentation for "KubernetesClusterLinkFormatter". -// src/api/KubernetesClusterLinkFormatter.d.ts:11:5 - (ae-undocumented) Missing documentation for "formatClusterLink". -// src/api/KubernetesProxyClient.d.ts:15:5 - (ae-undocumented) Missing documentation for "getEventsByInvolvedObjectName". -// src/api/KubernetesProxyClient.d.ts:20:5 - (ae-undocumented) Missing documentation for "getPodLogs". -// src/api/formatters/AksClusterLinksFormatter.d.ts:3:1 - (ae-undocumented) Missing documentation for "AksClusterLinksFormatter". -// src/api/formatters/AksClusterLinksFormatter.d.ts:4:5 - (ae-undocumented) Missing documentation for "formatClusterLink". -// src/api/formatters/EksClusterLinksFormatter.d.ts:3:1 - (ae-undocumented) Missing documentation for "EksClusterLinksFormatter". -// src/api/formatters/EksClusterLinksFormatter.d.ts:4:5 - (ae-undocumented) Missing documentation for "formatClusterLink". -// src/api/formatters/GkeClusterLinksFormatter.d.ts:4:1 - (ae-undocumented) Missing documentation for "GkeClusterLinksFormatter". -// src/api/formatters/GkeClusterLinksFormatter.d.ts:7:5 - (ae-undocumented) Missing documentation for "formatClusterLink". -// src/api/formatters/OpenshiftClusterLinksFormatter.d.ts:3:1 - (ae-undocumented) Missing documentation for "OpenshiftClusterLinksFormatter". -// src/api/formatters/OpenshiftClusterLinksFormatter.d.ts:4:5 - (ae-undocumented) Missing documentation for "formatClusterLink". -// src/api/formatters/RancherClusterLinksFormatter.d.ts:3:1 - (ae-undocumented) Missing documentation for "RancherClusterLinksFormatter". -// src/api/formatters/RancherClusterLinksFormatter.d.ts:4:5 - (ae-undocumented) Missing documentation for "formatClusterLink". -// src/api/formatters/StandardClusterLinksFormatter.d.ts:3:1 - (ae-undocumented) Missing documentation for "StandardClusterLinksFormatter". -// src/api/formatters/StandardClusterLinksFormatter.d.ts:4:5 - (ae-undocumented) Missing documentation for "formatClusterLink". -// src/api/formatters/index.d.ts:11:22 - (ae-undocumented) Missing documentation for "DEFAULT_FORMATTER_NAME". -// src/api/formatters/index.d.ts:13:1 - (ae-undocumented) Missing documentation for "getDefaultFormatters". -// src/api/types.d.ts:5:22 - (ae-undocumented) Missing documentation for "kubernetesApiRef". -// src/api/types.d.ts:7:22 - (ae-undocumented) Missing documentation for "kubernetesProxyApiRef". -// src/api/types.d.ts:9:22 - (ae-undocumented) Missing documentation for "kubernetesClusterLinkFormatterApiRef". -// src/api/types.d.ts:11:1 - (ae-undocumented) Missing documentation for "KubernetesApi". -// src/api/types.d.ts:12:5 - (ae-undocumented) Missing documentation for "getObjectsByEntity". -// src/api/types.d.ts:13:5 - (ae-undocumented) Missing documentation for "getClusters". -// src/api/types.d.ts:18:5 - (ae-undocumented) Missing documentation for "getCluster". -// src/api/types.d.ts:24:5 - (ae-undocumented) Missing documentation for "getWorkloadsByEntity". -// src/api/types.d.ts:25:5 - (ae-undocumented) Missing documentation for "getCustomObjectsByEntity". -// src/api/types.d.ts:26:5 - (ae-undocumented) Missing documentation for "proxy". -// src/api/types.d.ts:33:1 - (ae-undocumented) Missing documentation for "KubernetesProxyApi". -// src/api/types.d.ts:34:5 - (ae-undocumented) Missing documentation for "getPodLogs". -// src/api/types.d.ts:43:5 - (ae-undocumented) Missing documentation for "getEventsByInvolvedObjectName". -// src/api/types.d.ts:52:1 - (ae-undocumented) Missing documentation for "FormatClusterLinkOptions". -// src/api/types.d.ts:60:1 - (ae-undocumented) Missing documentation for "KubernetesClusterLinkFormatterApi". -// src/api/types.d.ts:61:5 - (ae-undocumented) Missing documentation for "formatClusterLink". -// src/components/CronJobsAccordions/CronJobsAccordions.d.ts:7:1 - (ae-undocumented) Missing documentation for "CronJobsAccordionsProps". -// src/components/CronJobsAccordions/CronJobsAccordions.d.ts:15:22 - (ae-undocumented) Missing documentation for "CronJobsAccordions". -// src/components/CustomResources/CustomResources.d.ts:7:1 - (ae-undocumented) Missing documentation for "CustomResourcesProps". -// src/components/CustomResources/CustomResources.d.ts:8:5 - (ae-undocumented) Missing documentation for "children". -// src/components/CustomResources/CustomResources.d.ts:15:22 - (ae-undocumented) Missing documentation for "CustomResources". -// src/components/ErrorPanel/ErrorPanel.d.ts:8:1 - (ae-undocumented) Missing documentation for "ErrorPanelProps". -// src/components/ErrorPanel/ErrorPanel.d.ts:19:22 - (ae-undocumented) Missing documentation for "ErrorPanel". -// src/components/ErrorReporting/ErrorReporting.d.ts:8:1 - (ae-undocumented) Missing documentation for "ErrorReportingProps". -// src/components/ErrorReporting/ErrorReporting.d.ts:17:22 - (ae-undocumented) Missing documentation for "ErrorReporting". -// src/components/HorizontalPodAutoscalers/HorizontalPodAutoscalerDrawer.d.ts:4:22 - (ae-undocumented) Missing documentation for "HorizontalPodAutoscalerDrawer". -// src/components/IngressesAccordions/IngressesAccordions.d.ts:7:1 - (ae-undocumented) Missing documentation for "IngressesAccordionsProps". -// src/components/IngressesAccordions/IngressesAccordions.d.ts:13:22 - (ae-undocumented) Missing documentation for "IngressesAccordions". -// src/components/JobsAccordions/JobsAccordions.d.ts:8:1 - (ae-undocumented) Missing documentation for "JobsAccordionsProps". -// src/components/JobsAccordions/JobsAccordions.d.ts:17:22 - (ae-undocumented) Missing documentation for "JobsAccordions". -// src/components/KubernetesDrawer/KubernetesDrawer.d.ts:9:5 - (ae-undocumented) Missing documentation for "kind". -// src/components/KubernetesDrawer/KubernetesDrawer.d.ts:10:5 - (ae-undocumented) Missing documentation for "metadata". -// src/components/KubernetesDrawer/KubernetesDrawer.d.ts:18:5 - (ae-undocumented) Missing documentation for "open". -// src/components/KubernetesDrawer/KubernetesDrawer.d.ts:19:5 - (ae-undocumented) Missing documentation for "kubernetesObject". -// src/components/KubernetesDrawer/KubernetesDrawer.d.ts:20:5 - (ae-undocumented) Missing documentation for "label". -// src/components/KubernetesDrawer/KubernetesDrawer.d.ts:21:5 - (ae-undocumented) Missing documentation for "drawerContentsHeader". -// src/components/KubernetesDrawer/KubernetesDrawer.d.ts:22:5 - (ae-undocumented) Missing documentation for "children". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:9:1 - (ae-undocumented) Missing documentation for "LinkErrorPanelProps". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:19:22 - (ae-undocumented) Missing documentation for "LinkErrorPanel". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:25:1 - (ae-undocumented) Missing documentation for "KubernetesDrawerable". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:26:5 - (ae-undocumented) Missing documentation for "metadata". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:32:1 - (ae-undocumented) Missing documentation for "KubernetesStructuredMetadataTableDrawerProps". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:33:5 - (ae-undocumented) Missing documentation for "object". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:34:5 - (ae-undocumented) Missing documentation for "renderObject". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:35:5 - (ae-undocumented) Missing documentation for "buttonVariant". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:36:5 - (ae-undocumented) Missing documentation for "kind". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:37:5 - (ae-undocumented) Missing documentation for "expanded". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:38:5 - (ae-undocumented) Missing documentation for "children". -// src/components/KubernetesDrawer/KubernetesStructuredMetadataTableDrawer.d.ts:44:22 - (ae-undocumented) Missing documentation for "KubernetesStructuredMetadataTableDrawer". -// src/components/KubernetesDrawer/ManifestYaml.d.ts:8:5 - (ae-undocumented) Missing documentation for "object". -// src/components/PodExecTerminal/PodExecTerminal.d.ts:10:5 - (ae-undocumented) Missing documentation for "cluster". -// src/components/PodExecTerminal/PodExecTerminal.d.ts:11:5 - (ae-undocumented) Missing documentation for "containerName". -// src/components/PodExecTerminal/PodExecTerminal.d.ts:12:5 - (ae-undocumented) Missing documentation for "podName". -// src/components/PodExecTerminal/PodExecTerminal.d.ts:13:5 - (ae-undocumented) Missing documentation for "podNamespace". -// src/components/Pods/ErrorList/ErrorList.d.ts:9:5 - (ae-undocumented) Missing documentation for "podAndErrors". -// src/components/Pods/Events/Events.d.ts:9:5 - (ae-undocumented) Missing documentation for "warningEventsOnly". -// src/components/Pods/Events/Events.d.ts:10:5 - (ae-undocumented) Missing documentation for "events". -// src/components/Pods/Events/Events.d.ts:24:5 - (ae-undocumented) Missing documentation for "involvedObjectName". -// src/components/Pods/Events/Events.d.ts:25:5 - (ae-undocumented) Missing documentation for "namespace". -// src/components/Pods/Events/Events.d.ts:26:5 - (ae-undocumented) Missing documentation for "clusterName". -// src/components/Pods/Events/Events.d.ts:27:5 - (ae-undocumented) Missing documentation for "warningEventsOnly". -// src/components/Pods/Events/useEvents.d.ts:7:5 - (ae-undocumented) Missing documentation for "involvedObjectName". -// src/components/Pods/Events/useEvents.d.ts:8:5 - (ae-undocumented) Missing documentation for "namespace". -// src/components/Pods/Events/useEvents.d.ts:9:5 - (ae-undocumented) Missing documentation for "clusterName". -// src/components/Pods/FixDialog/FixDialog.d.ts:10:5 - (ae-undocumented) Missing documentation for "open". -// src/components/Pods/FixDialog/FixDialog.d.ts:11:5 - (ae-undocumented) Missing documentation for "clusterName". -// src/components/Pods/FixDialog/FixDialog.d.ts:12:5 - (ae-undocumented) Missing documentation for "pod". -// src/components/Pods/FixDialog/FixDialog.d.ts:13:5 - (ae-undocumented) Missing documentation for "error". -// src/components/Pods/PodDrawer/ContainerCard.d.ts:11:5 - (ae-undocumented) Missing documentation for "podScope". -// src/components/Pods/PodDrawer/ContainerCard.d.ts:12:5 - (ae-undocumented) Missing documentation for "containerSpec". -// src/components/Pods/PodDrawer/ContainerCard.d.ts:13:5 - (ae-undocumented) Missing documentation for "containerStatus". -// src/components/Pods/PodDrawer/ContainerCard.d.ts:14:5 - (ae-undocumented) Missing documentation for "containerMetrics". -// src/components/Pods/PodDrawer/PendingPodContent.d.ts:9:5 - (ae-undocumented) Missing documentation for "pod". -// src/components/Pods/PodDrawer/PodDrawer.d.ts:9:5 - (ae-undocumented) Missing documentation for "open". -// src/components/Pods/PodDrawer/PodDrawer.d.ts:10:5 - (ae-undocumented) Missing documentation for "podAndErrors". -// src/components/Pods/PodLogs/PodLogs.d.ts:9:5 - (ae-undocumented) Missing documentation for "containerScope". -// src/components/Pods/PodLogs/PodLogs.d.ts:10:5 - (ae-undocumented) Missing documentation for "previous". -// src/components/Pods/PodLogs/PodLogsDialog.d.ts:9:5 - (ae-undocumented) Missing documentation for "containerScope". -// src/components/Pods/PodLogs/types.d.ts:8:5 - (ae-undocumented) Missing documentation for "podName". -// src/components/Pods/PodLogs/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "podNamespace". -// src/components/Pods/PodLogs/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "cluster". -// src/components/Pods/PodLogs/types.d.ts:18:5 - (ae-undocumented) Missing documentation for "containerName". -// src/components/Pods/PodLogs/usePodLogs.d.ts:8:5 - (ae-undocumented) Missing documentation for "containerScope". -// src/components/Pods/PodLogs/usePodLogs.d.ts:9:5 - (ae-undocumented) Missing documentation for "previous". -// src/components/Pods/PodsTable.d.ts:9:22 - (ae-undocumented) Missing documentation for "READY_COLUMNS". -// src/components/Pods/PodsTable.d.ts:15:22 - (ae-undocumented) Missing documentation for "RESOURCE_COLUMNS". -// src/components/Pods/PodsTable.d.ts:21:1 - (ae-undocumented) Missing documentation for "PodColumns". -// src/components/Pods/PodsTable.d.ts:27:1 - (ae-undocumented) Missing documentation for "PodsTablesProps". -// src/components/Pods/PodsTable.d.ts:37:22 - (ae-undocumented) Missing documentation for "PodsTable". -// src/components/Pods/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "cluster". -// src/components/Pods/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "pod". -// src/components/Pods/types.d.ts:11:5 - (ae-undocumented) Missing documentation for "errors". -// src/components/ResourceUtilization/ResourceUtilization.d.ts:8:5 - (ae-undocumented) Missing documentation for "compressed". -// src/components/ResourceUtilization/ResourceUtilization.d.ts:9:5 - (ae-undocumented) Missing documentation for "title". -// src/components/ResourceUtilization/ResourceUtilization.d.ts:10:5 - (ae-undocumented) Missing documentation for "usage". -// src/components/ResourceUtilization/ResourceUtilization.d.ts:11:5 - (ae-undocumented) Missing documentation for "total". -// src/components/ResourceUtilization/ResourceUtilization.d.ts:12:5 - (ae-undocumented) Missing documentation for "totalFormatted". -// src/components/ServicesAccordions/ServicesAccordions.d.ts:7:1 - (ae-undocumented) Missing documentation for "ServicesAccordionsProps". -// src/components/ServicesAccordions/ServicesAccordions.d.ts:13:22 - (ae-undocumented) Missing documentation for "ServicesAccordions". -// src/hooks/Cluster.d.ts:6:22 - (ae-undocumented) Missing documentation for "ClusterContext". -// src/hooks/GroupedResponses.d.ts:8:22 - (ae-undocumented) Missing documentation for "GroupedResponsesContext". -// src/hooks/PodNamesWithErrors.d.ts:5:22 - (ae-undocumented) Missing documentation for "PodNamesWithErrorsContext". -// src/hooks/PodNamesWithMetrics.d.ts:6:22 - (ae-undocumented) Missing documentation for "PodNamesWithMetricsContext". -// src/hooks/useKubernetesObjects.d.ts:7:1 - (ae-undocumented) Missing documentation for "KubernetesObjects". -// src/hooks/useKubernetesObjects.d.ts:8:5 - (ae-undocumented) Missing documentation for "kubernetesObjects". -// src/hooks/useKubernetesObjects.d.ts:9:5 - (ae-undocumented) Missing documentation for "loading". -// src/hooks/useKubernetesObjects.d.ts:10:5 - (ae-undocumented) Missing documentation for "error". -// src/hooks/useKubernetesObjects.d.ts:16:22 - (ae-undocumented) Missing documentation for "useKubernetesObjects". -// src/hooks/useMatchingErrors.d.ts:15:1 - (ae-undocumented) Missing documentation for "ErrorMatcher". -// src/hooks/usePodMetrics.d.ts:13:1 - (ae-undocumented) Missing documentation for "PodMetricsMatcher". -// src/kubernetes-auth-provider/AksKubernetesAuthProvider.d.ts:5:1 - (ae-undocumented) Missing documentation for "AksKubernetesAuthProvider". -// src/kubernetes-auth-provider/AksKubernetesAuthProvider.d.ts:8:5 - (ae-undocumented) Missing documentation for "decorateRequestBodyForAuth". -// src/kubernetes-auth-provider/AksKubernetesAuthProvider.d.ts:9:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.d.ts:5:1 - (ae-undocumented) Missing documentation for "GoogleKubernetesAuthProvider". -// src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.d.ts:6:5 - (ae-undocumented) Missing documentation for "authProvider". -// src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.d.ts:8:5 - (ae-undocumented) Missing documentation for "decorateRequestBodyForAuth". -// src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.d.ts:9:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/kubernetes-auth-provider/KubernetesAuthProviders.d.ts:5:1 - (ae-undocumented) Missing documentation for "KubernetesAuthProviders". -// src/kubernetes-auth-provider/KubernetesAuthProviders.d.ts:14:5 - (ae-undocumented) Missing documentation for "decorateRequestBodyForAuth". -// src/kubernetes-auth-provider/KubernetesAuthProviders.d.ts:15:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/kubernetes-auth-provider/OidcKubernetesAuthProvider.d.ts:5:1 - (ae-undocumented) Missing documentation for "OidcKubernetesAuthProvider". -// src/kubernetes-auth-provider/OidcKubernetesAuthProvider.d.ts:6:5 - (ae-undocumented) Missing documentation for "providerName". -// src/kubernetes-auth-provider/OidcKubernetesAuthProvider.d.ts:7:5 - (ae-undocumented) Missing documentation for "authProvider". -// src/kubernetes-auth-provider/OidcKubernetesAuthProvider.d.ts:9:5 - (ae-undocumented) Missing documentation for "decorateRequestBodyForAuth". -// src/kubernetes-auth-provider/OidcKubernetesAuthProvider.d.ts:10:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/kubernetes-auth-provider/ServerSideAuthProvider.d.ts:9:5 - (ae-undocumented) Missing documentation for "decorateRequestBodyForAuth". -// src/kubernetes-auth-provider/ServerSideAuthProvider.d.ts:10:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/kubernetes-auth-provider/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "KubernetesAuthProvider". -// src/kubernetes-auth-provider/types.d.ts:4:5 - (ae-undocumented) Missing documentation for "decorateRequestBodyForAuth". -// src/kubernetes-auth-provider/types.d.ts:5:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/kubernetes-auth-provider/types.d.ts:10:22 - (ae-undocumented) Missing documentation for "kubernetesAuthProvidersApiRef". -// src/kubernetes-auth-provider/types.d.ts:12:1 - (ae-undocumented) Missing documentation for "KubernetesAuthProvidersApi". -// src/kubernetes-auth-provider/types.d.ts:13:5 - (ae-undocumented) Missing documentation for "decorateRequestBodyForAuth". -// src/kubernetes-auth-provider/types.d.ts:14:5 - (ae-undocumented) Missing documentation for "getCredentials". -// src/types/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "ClusterLinksFormatterOptions". -// src/types/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "dashboardUrl". -// src/types/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "dashboardParameters". -// src/types/types.d.ts:8:5 - (ae-undocumented) Missing documentation for "object". -// src/types/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "kind". -// src/types/types.d.ts:14:1 - (ae-undocumented) Missing documentation for "ClusterLinksFormatter". -// src/types/types.d.ts:15:5 - (ae-undocumented) Missing documentation for "formatClusterLink". ``` diff --git a/plugins/kubernetes/report-alpha.api.md b/plugins/kubernetes/report-alpha.api.md index 93919acd47..9ba748577f 100644 --- a/plugins/kubernetes/report-alpha.api.md +++ b/plugins/kubernetes/report-alpha.api.md @@ -162,9 +162,5 @@ const _default: FrontendPlugin< >; export default _default; -// Warnings were encountered during analysis: -// -// src/alpha/plugin.d.ts:2:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/kubernetes/report.api.md b/plugins/kubernetes/report.api.md index e5038b674a..64b56cf786 100644 --- a/plugins/kubernetes/report.api.md +++ b/plugins/kubernetes/report.api.md @@ -47,11 +47,4 @@ export const Router: (props: { }) => React_2.JSX.Element; export * from '@backstage/plugin-kubernetes-react'; - -// Warnings were encountered during analysis: -// -// src/Router.d.ts:3:22 - (ae-undocumented) Missing documentation for "isKubernetesAvailable". -// src/Router.d.ts:4:22 - (ae-undocumented) Missing documentation for "Router". -// src/plugin.d.ts:3:22 - (ae-undocumented) Missing documentation for "kubernetesPlugin". -// src/plugin.d.ts:17:22 - (ae-undocumented) Missing documentation for "EntityKubernetesContent". ``` diff --git a/plugins/notifications-backend-module-email/report.api.md b/plugins/notifications-backend-module-email/report.api.md index 2116bd4ef4..be3b58d1fd 100644 --- a/plugins/notifications-backend-module-email/report.api.md +++ b/plugins/notifications-backend-module-email/report.api.md @@ -29,15 +29,4 @@ export interface NotificationTemplateRenderer { // (undocumented) getText?(notification: Notification_2): Promise; } - -// Warnings were encountered during analysis: -// -// src/extensions.d.ts:5:1 - (ae-undocumented) Missing documentation for "NotificationTemplateRenderer". -// src/extensions.d.ts:6:5 - (ae-undocumented) Missing documentation for "getSubject". -// src/extensions.d.ts:7:5 - (ae-undocumented) Missing documentation for "getText". -// src/extensions.d.ts:8:5 - (ae-undocumented) Missing documentation for "getHtml". -// src/extensions.d.ts:13:1 - (ae-undocumented) Missing documentation for "NotificationsEmailTemplateExtensionPoint". -// src/extensions.d.ts:14:5 - (ae-undocumented) Missing documentation for "setTemplateRenderer". -// src/extensions.d.ts:19:22 - (ae-undocumented) Missing documentation for "notificationsEmailTemplateExtensionPoint". -// src/module.d.ts:4:22 - (ae-undocumented) Missing documentation for "notificationsModuleEmail". ``` diff --git a/plugins/notifications-common/report.api.md b/plugins/notifications-common/report.api.md index a02bfb2eaa..0f59a85849 100644 --- a/plugins/notifications-common/report.api.md +++ b/plugins/notifications-common/report.api.md @@ -67,16 +67,4 @@ export type NotificationStatus = { unread: number; read: number; }; - -// Warnings were encountered during analysis: -// -// src/filters.d.ts:4:22 - (ae-undocumented) Missing documentation for "getProcessorFiltersFromConfig". -// src/types.d.ts:2:1 - (ae-undocumented) Missing documentation for "NotificationSeverity". -// src/types.d.ts:4:1 - (ae-undocumented) Missing documentation for "NotificationPayload". -// src/types.d.ts:36:1 - (ae-undocumented) Missing documentation for "Notification". -// src/types.d.ts:73:1 - (ae-undocumented) Missing documentation for "NotificationStatus". -// src/types.d.ts:84:1 - (ae-undocumented) Missing documentation for "NewNotificationSignal". -// src/types.d.ts:89:1 - (ae-undocumented) Missing documentation for "NotificationReadSignal". -// src/types.d.ts:94:1 - (ae-undocumented) Missing documentation for "NotificationSignal". -// src/types.d.ts:98:1 - (ae-undocumented) Missing documentation for "NotificationProcessorFilters". ``` diff --git a/plugins/notifications-node/report.api.md b/plugins/notifications-node/report.api.md index 869bf6c6bb..995b98bc21 100644 --- a/plugins/notifications-node/report.api.md +++ b/plugins/notifications-node/report.api.md @@ -87,20 +87,4 @@ export interface NotificationsProcessingExtensionPoint { // @public (undocumented) export const notificationsProcessingExtensionPoint: ExtensionPoint; - -// Warnings were encountered during analysis: -// -// src/extensions.d.ts:73:1 - (ae-undocumented) Missing documentation for "NotificationsProcessingExtensionPoint". -// src/extensions.d.ts:74:5 - (ae-undocumented) Missing documentation for "addProcessor". -// src/extensions.d.ts:79:22 - (ae-undocumented) Missing documentation for "notificationsProcessingExtensionPoint". -// src/extensions.d.ts:84:1 - (ae-undocumented) Missing documentation for "NotificationProcessorFilters". -// src/lib.d.ts:3:22 - (ae-undocumented) Missing documentation for "notificationService". -// src/service/DefaultNotificationService.d.ts:5:1 - (ae-undocumented) Missing documentation for "NotificationServiceOptions". -// src/service/DefaultNotificationService.d.ts:10:1 - (ae-undocumented) Missing documentation for "NotificationRecipients". -// src/service/DefaultNotificationService.d.ts:26:1 - (ae-undocumented) Missing documentation for "NotificationSendOptions". -// src/service/DefaultNotificationService.d.ts:31:1 - (ae-undocumented) Missing documentation for "DefaultNotificationService". -// src/service/DefaultNotificationService.d.ts:35:5 - (ae-undocumented) Missing documentation for "create". -// src/service/DefaultNotificationService.d.ts:36:5 - (ae-undocumented) Missing documentation for "send". -// src/service/NotificationService.d.ts:3:1 - (ae-undocumented) Missing documentation for "NotificationService". -// src/service/NotificationService.d.ts:4:5 - (ae-undocumented) Missing documentation for "send". ``` diff --git a/plugins/notifications/report.api.md b/plugins/notifications/report.api.md index ab1fc6d5a1..5e06ae2616 100644 --- a/plugins/notifications/report.api.md +++ b/plugins/notifications/report.api.md @@ -176,29 +176,5 @@ export function useNotificationsApi( value: T; }; -// Warnings were encountered during analysis: -// -// src/api/NotificationsApi.d.ts:3:22 - (ae-undocumented) Missing documentation for "notificationsApiRef". -// src/api/NotificationsApi.d.ts:5:1 - (ae-undocumented) Missing documentation for "GetNotificationsOptions". -// src/api/NotificationsApi.d.ts:17:1 - (ae-undocumented) Missing documentation for "UpdateNotificationsOptions". -// src/api/NotificationsApi.d.ts:23:1 - (ae-undocumented) Missing documentation for "GetNotificationsResponse". -// src/api/NotificationsApi.d.ts:28:1 - (ae-undocumented) Missing documentation for "NotificationsApi". -// src/api/NotificationsApi.d.ts:29:5 - (ae-undocumented) Missing documentation for "getNotifications". -// src/api/NotificationsApi.d.ts:30:5 - (ae-undocumented) Missing documentation for "getNotification". -// src/api/NotificationsApi.d.ts:31:5 - (ae-undocumented) Missing documentation for "getStatus". -// src/api/NotificationsApi.d.ts:32:5 - (ae-undocumented) Missing documentation for "updateNotifications". -// src/api/NotificationsClient.d.ts:5:1 - (ae-undocumented) Missing documentation for "NotificationsClient". -// src/api/NotificationsClient.d.ts:12:5 - (ae-undocumented) Missing documentation for "getNotifications". -// src/api/NotificationsClient.d.ts:13:5 - (ae-undocumented) Missing documentation for "getNotification". -// src/api/NotificationsClient.d.ts:14:5 - (ae-undocumented) Missing documentation for "getStatus". -// src/api/NotificationsClient.d.ts:15:5 - (ae-undocumented) Missing documentation for "updateNotifications". -// src/components/NotificationsPage/NotificationsPage.d.ts:3:1 - (ae-undocumented) Missing documentation for "NotificationsPageProps". -// src/components/NotificationsSideBarItem/NotificationsSideBarItem.d.ts:12:22 - (ae-undocumented) Missing documentation for "NotificationsSidebarItem". -// src/components/NotificationsTable/NotificationsTable.d.ts:5:1 - (ae-undocumented) Missing documentation for "NotificationsTableProps". -// src/components/NotificationsTable/NotificationsTable.d.ts:15:22 - (ae-undocumented) Missing documentation for "NotificationsTable". -// src/hooks/useNotificationsApi.d.ts:3:1 - (ae-undocumented) Missing documentation for "useNotificationsApi". -// src/plugin.d.ts:3:22 - (ae-undocumented) Missing documentation for "notificationsPlugin". -// src/plugin.d.ts:7:22 - (ae-undocumented) Missing documentation for "NotificationsPage". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/org-react/report.api.md b/plugins/org-react/report.api.md index 924f1ea7ca..5cfe5ca90a 100644 --- a/plugins/org-react/report.api.md +++ b/plugins/org-react/report.api.md @@ -19,9 +19,5 @@ export type GroupListPickerProps = { onChange: (value: GroupEntity | undefined) => void; }; -// Warnings were encountered during analysis: -// -// src/components/GroupListPicker/GroupListPicker.d.ts:15:22 - (ae-undocumented) Missing documentation for "GroupListPicker". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/org/report-alpha.api.md b/plugins/org/report-alpha.api.md index 14833df450..1040b61733 100644 --- a/plugins/org/report-alpha.api.md +++ b/plugins/org/report-alpha.api.md @@ -161,9 +161,5 @@ const _default: FrontendPlugin< >; export default _default; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/org/report.api.md b/plugins/org/report.api.md index 033d363606..af03687240 100644 --- a/plugins/org/report.api.md +++ b/plugins/org/report.api.md @@ -102,19 +102,4 @@ export const UserProfileCard: (props: { variant?: InfoCardVariants; showLinks?: boolean; }) => React_2.JSX.Element; - -// Warnings were encountered during analysis: -// -// src/components/Cards/Group/GroupProfile/GroupProfileCard.d.ts:4:22 - (ae-undocumented) Missing documentation for "GroupProfileCard". -// src/components/Cards/Group/MembersList/MembersListCard.d.ts:4:1 - (ae-undocumented) Missing documentation for "MemberComponentClassKey". -// src/components/Cards/Group/MembersList/MembersListCard.d.ts:6:1 - (ae-undocumented) Missing documentation for "MembersListCardClassKey". -// src/components/Cards/Group/MembersList/MembersListCard.d.ts:8:22 - (ae-undocumented) Missing documentation for "MembersListCard". -// src/components/Cards/OwnershipCard/OwnershipCard.d.ts:5:22 - (ae-undocumented) Missing documentation for "OwnershipCard". -// src/components/Cards/User/UserProfileCard/UserProfileCard.d.ts:4:22 - (ae-undocumented) Missing documentation for "UserProfileCard". -// src/components/Cards/types.d.ts:2:1 - (ae-undocumented) Missing documentation for "EntityRelationAggregation". -// src/plugin.d.ts:3:22 - (ae-undocumented) Missing documentation for "orgPlugin". -// src/plugin.d.ts:7:22 - (ae-undocumented) Missing documentation for "EntityGroupProfileCard". -// src/plugin.d.ts:12:22 - (ae-undocumented) Missing documentation for "EntityMembersListCard". -// src/plugin.d.ts:21:22 - (ae-undocumented) Missing documentation for "EntityOwnershipCard". -// src/plugin.d.ts:30:22 - (ae-undocumented) Missing documentation for "EntityUserProfileCard". ``` diff --git a/plugins/permission-backend/report-alpha.api.md b/plugins/permission-backend/report-alpha.api.md index e2d43b0195..289eb2b685 100644 --- a/plugins/permission-backend/report-alpha.api.md +++ b/plugins/permission-backend/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/permission-backend/report.api.md b/plugins/permission-backend/report.api.md index fd559c4a6a..48395265f7 100644 --- a/plugins/permission-backend/report.api.md +++ b/plugins/permission-backend/report.api.md @@ -40,15 +40,4 @@ export interface RouterOptions { // (undocumented) userInfo?: UserInfoService; } - -// Warnings were encountered during analysis: -// -// src/service/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "logger". -// src/service/router.d.ts:14:5 - (ae-undocumented) Missing documentation for "discovery". -// src/service/router.d.ts:15:5 - (ae-undocumented) Missing documentation for "policy". -// src/service/router.d.ts:16:5 - (ae-undocumented) Missing documentation for "identity". -// src/service/router.d.ts:17:5 - (ae-undocumented) Missing documentation for "config". -// src/service/router.d.ts:18:5 - (ae-undocumented) Missing documentation for "auth". -// src/service/router.d.ts:19:5 - (ae-undocumented) Missing documentation for "httpAuth". -// src/service/router.d.ts:20:5 - (ae-undocumented) Missing documentation for "userInfo". ``` diff --git a/plugins/permission-common/report.api.md b/plugins/permission-common/report.api.md index 856b650dba..465c43846f 100644 --- a/plugins/permission-common/report.api.md +++ b/plugins/permission-common/report.api.md @@ -261,8 +261,4 @@ export type ResourcePermission = export function toPermissionEvaluator( permissionAuthorizer: PermissionAuthorizer, ): PermissionEvaluator; - -// Warnings were encountered during analysis: -// -// src/types/permission.d.ts:71:5 - (ae-undocumented) Missing documentation for "authorize". ``` diff --git a/plugins/permission-node/report.api.md b/plugins/permission-node/report.api.md index 3deb87d141..83730c6050 100644 --- a/plugins/permission-node/report.api.md +++ b/plugins/permission-node/report.api.md @@ -295,11 +295,4 @@ export class ServerPermissionClient implements PermissionsService { }, ): ServerPermissionClient; } - -// Warnings were encountered during analysis: -// -// src/ServerPermissionClient.d.ts:13:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/ServerPermissionClient.d.ts:20:5 - (ae-undocumented) Missing documentation for "authorizeConditional". -// src/ServerPermissionClient.d.ts:21:5 - (ae-undocumented) Missing documentation for "authorize". -// src/policy/types.d.ts:67:5 - (ae-undocumented) Missing documentation for "handle". ``` diff --git a/plugins/permission-react/report.api.md b/plugins/permission-react/report.api.md index d1b5de1d9e..4c51d16b80 100644 --- a/plugins/permission-react/report.api.md +++ b/plugins/permission-react/report.api.md @@ -100,10 +100,4 @@ export function usePermission( resourceRef: string | undefined; }, ): AsyncPermissionResult; - -// Warnings were encountered during analysis: -// -// src/apis/IdentityPermissionApi.d.ts:14:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/IdentityPermissionApi.d.ts:19:5 - (ae-undocumented) Missing documentation for "authorize". -// src/hooks/usePermission.d.ts:3:1 - (ae-undocumented) Missing documentation for "AsyncPermissionResult". ``` diff --git a/plugins/proxy-backend/report-alpha.api.md b/plugins/proxy-backend/report-alpha.api.md index a32524352e..4b3b1dfdc6 100644 --- a/plugins/proxy-backend/report-alpha.api.md +++ b/plugins/proxy-backend/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/proxy-backend/report.api.md b/plugins/proxy-backend/report.api.md index 0a68a03cfe..c0601eac30 100644 --- a/plugins/proxy-backend/report.api.md +++ b/plugins/proxy-backend/report.api.md @@ -29,13 +29,4 @@ export interface RouterOptions { // (undocumented) skipInvalidProxies?: boolean; } - -// Warnings were encountered during analysis: -// -// src/service/router.d.ts:9:1 - (ae-undocumented) Missing documentation for "RouterOptions". -// src/service/router.d.ts:10:5 - (ae-undocumented) Missing documentation for "logger". -// src/service/router.d.ts:11:5 - (ae-undocumented) Missing documentation for "config". -// src/service/router.d.ts:12:5 - (ae-undocumented) Missing documentation for "discovery". -// src/service/router.d.ts:13:5 - (ae-undocumented) Missing documentation for "skipInvalidProxies". -// src/service/router.d.ts:14:5 - (ae-undocumented) Missing documentation for "reviveConsumedRequestBodies". ``` diff --git a/plugins/scaffolder-backend-module-bitbucket/report.api.md b/plugins/scaffolder-backend-module-bitbucket/report.api.md index 8721760248..952b1665fb 100644 --- a/plugins/scaffolder-backend-module-bitbucket/report.api.md +++ b/plugins/scaffolder-backend-module-bitbucket/report.api.md @@ -56,11 +56,4 @@ export const createPublishBitbucketServerAction: typeof bitbucketServer.createPu // @public @deprecated (undocumented) export const createPublishBitbucketServerPullRequestAction: typeof bitbucketServer.createPublishBitbucketServerPullRequestAction; - -// Warnings were encountered during analysis: -// -// src/deprecated.d.ts:8:22 - (ae-undocumented) Missing documentation for "createPublishBitbucketCloudAction". -// src/deprecated.d.ts:13:22 - (ae-undocumented) Missing documentation for "createBitbucketPipelinesRunAction". -// src/deprecated.d.ts:29:22 - (ae-undocumented) Missing documentation for "createPublishBitbucketServerAction". -// src/deprecated.d.ts:34:22 - (ae-undocumented) Missing documentation for "createPublishBitbucketServerPullRequestAction". ``` diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/report.api.md b/plugins/scaffolder-backend-module-confluence-to-markdown/report.api.md index 4d08c12e7d..2dd5e244dd 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/report.api.md +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/report.api.md @@ -26,8 +26,4 @@ export const createConfluenceToMarkdownAction: (options: { }, JsonObject >; - -// Warnings were encountered during analysis: -// -// src/actions/confluence/confluenceToMarkdown.d.ts:7:22 - (ae-undocumented) Missing documentation for "createConfluenceToMarkdownAction". ``` diff --git a/plugins/scaffolder-backend-module-gitlab/report.api.md b/plugins/scaffolder-backend-module-gitlab/report.api.md index f00055a876..49bda648f6 100644 --- a/plugins/scaffolder-backend-module-gitlab/report.api.md +++ b/plugins/scaffolder-backend-module-gitlab/report.api.md @@ -277,13 +277,4 @@ export enum IssueType { // (undocumented) TEST = 'test_case', } - -// Warnings were encountered during analysis: -// -// src/commonGitlabConfig.d.ts:23:5 - (ae-undocumented) Missing documentation for "ISSUE". -// src/commonGitlabConfig.d.ts:24:5 - (ae-undocumented) Missing documentation for "INCIDENT". -// src/commonGitlabConfig.d.ts:25:5 - (ae-undocumented) Missing documentation for "TEST". -// src/commonGitlabConfig.d.ts:26:5 - (ae-undocumented) Missing documentation for "TASK". -// src/commonGitlabConfig.d.ts:34:5 - (ae-undocumented) Missing documentation for "CLOSE". -// src/commonGitlabConfig.d.ts:35:5 - (ae-undocumented) Missing documentation for "REOPEN". ``` diff --git a/plugins/scaffolder-backend-module-notifications/report.api.md b/plugins/scaffolder-backend-module-notifications/report.api.md index 7e283573b0..091782449f 100644 --- a/plugins/scaffolder-backend-module-notifications/report.api.md +++ b/plugins/scaffolder-backend-module-notifications/report.api.md @@ -29,8 +29,4 @@ export function createSendNotificationAction(options: { // @public const scaffolderModuleNotifications: BackendFeature; export default scaffolderModuleNotifications; - -// Warnings were encountered during analysis: -// -// src/actions/sendNotification.d.ts:6:1 - (ae-undocumented) Missing documentation for "createSendNotificationAction". ``` diff --git a/plugins/scaffolder-backend/report-alpha.api.md b/plugins/scaffolder-backend/report-alpha.api.md index 89d4fecd8c..c35b743f6a 100644 --- a/plugins/scaffolder-backend/report-alpha.api.md +++ b/plugins/scaffolder-backend/report-alpha.api.md @@ -93,10 +93,5 @@ export const scaffolderTemplateConditions: Conditions<{ >; }>; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". -// src/service/conditionExports.d.ts:48:22 - (ae-undocumented) Missing documentation for "createScaffolderActionConditionalDecision". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/scaffolder-backend/report.api.md b/plugins/scaffolder-backend/report.api.md index d3dddc21e9..fb7a9361c2 100644 --- a/plugins/scaffolder-backend/report.api.md +++ b/plugins/scaffolder-backend/report.api.md @@ -844,117 +844,4 @@ export type TemplatePermissionRuleInput< typeof RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, TParams >; - -// Warnings were encountered during analysis: -// -// src/deprecated.d.ts:8:1 - (ae-undocumented) Missing documentation for "ActionContext". -// src/deprecated.d.ts:13:22 - (ae-undocumented) Missing documentation for "createTemplateAction". -// src/deprecated.d.ts:18:1 - (ae-undocumented) Missing documentation for "TaskSecrets". -// src/deprecated.d.ts:23:1 - (ae-undocumented) Missing documentation for "TemplateAction". -// src/lib/templating/SecureTemplater.d.ts:6:1 - (ae-undocumented) Missing documentation for "TemplateFilter". -// src/lib/templating/SecureTemplater.d.ts:11:1 - (ae-undocumented) Missing documentation for "TemplateGlobal". -// src/scaffolder/actions/TemplateActionRegistry.d.ts:8:5 - (ae-undocumented) Missing documentation for "register". -// src/scaffolder/actions/TemplateActionRegistry.d.ts:9:5 - (ae-undocumented) Missing documentation for "get". -// src/scaffolder/actions/TemplateActionRegistry.d.ts:10:5 - (ae-undocumented) Missing documentation for "list". -// src/scaffolder/actions/builtin/createBuiltinActions.d.ts:36:5 - (ae-undocumented) Missing documentation for "additionalTemplateGlobals". -// src/scaffolder/actions/deprecated.d.ts:12:22 - (ae-undocumented) Missing documentation for "createGithubActionsDispatchAction". -// src/scaffolder/actions/deprecated.d.ts:17:22 - (ae-undocumented) Missing documentation for "createGithubDeployKeyAction". -// src/scaffolder/actions/deprecated.d.ts:22:22 - (ae-undocumented) Missing documentation for "createGithubEnvironmentAction". -// src/scaffolder/actions/deprecated.d.ts:27:22 - (ae-undocumented) Missing documentation for "createGithubIssuesLabelAction". -// src/scaffolder/actions/deprecated.d.ts:32:1 - (ae-undocumented) Missing documentation for "CreateGithubPullRequestActionOptions". -// src/scaffolder/actions/deprecated.d.ts:37:22 - (ae-undocumented) Missing documentation for "createGithubRepoCreateAction". -// src/scaffolder/actions/deprecated.d.ts:42:22 - (ae-undocumented) Missing documentation for "createGithubRepoPushAction". -// src/scaffolder/actions/deprecated.d.ts:47:22 - (ae-undocumented) Missing documentation for "createGithubWebhookAction". -// src/scaffolder/actions/deprecated.d.ts:52:22 - (ae-undocumented) Missing documentation for "createPublishGithubAction". -// src/scaffolder/actions/deprecated.d.ts:57:22 - (ae-undocumented) Missing documentation for "createPublishGithubPullRequestAction". -// src/scaffolder/actions/deprecated.d.ts:79:22 - (ae-undocumented) Missing documentation for "createPublishBitbucketAction". -// src/scaffolder/actions/deprecated.d.ts:84:22 - (ae-undocumented) Missing documentation for "createPublishBitbucketCloudAction". -// src/scaffolder/actions/deprecated.d.ts:89:22 - (ae-undocumented) Missing documentation for "createPublishBitbucketServerAction". -// src/scaffolder/actions/deprecated.d.ts:94:22 - (ae-undocumented) Missing documentation for "createPublishBitbucketServerPullRequestAction". -// src/scaffolder/actions/deprecated.d.ts:99:22 - (ae-undocumented) Missing documentation for "createPublishAzureAction". -// src/scaffolder/actions/deprecated.d.ts:104:22 - (ae-undocumented) Missing documentation for "createPublishGerritAction". -// src/scaffolder/actions/deprecated.d.ts:109:22 - (ae-undocumented) Missing documentation for "createPublishGerritReviewAction". -// src/scaffolder/actions/deprecated.d.ts:114:22 - (ae-undocumented) Missing documentation for "createPublishGitlabAction". -// src/scaffolder/actions/deprecated.d.ts:119:22 - (ae-undocumented) Missing documentation for "createPublishGitlabMergeRequestAction". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:42:5 - (ae-undocumented) Missing documentation for "create". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:49:5 - (ae-undocumented) Missing documentation for "list". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:68:5 - (ae-undocumented) Missing documentation for "getTask". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:69:5 - (ae-undocumented) Missing documentation for "createTask". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:70:5 - (ae-undocumented) Missing documentation for "claimTask". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:71:5 - (ae-undocumented) Missing documentation for "heartbeatTask". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:72:5 - (ae-undocumented) Missing documentation for "listStaleTasks". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:80:5 - (ae-undocumented) Missing documentation for "completeTask". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:85:5 - (ae-undocumented) Missing documentation for "emitLogEvent". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:88:5 - (ae-undocumented) Missing documentation for "getTaskState". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:93:5 - (ae-undocumented) Missing documentation for "saveTaskState". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:97:5 - (ae-undocumented) Missing documentation for "listEvents". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:100:5 - (ae-undocumented) Missing documentation for "shutdownTask". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:101:5 - (ae-undocumented) Missing documentation for "rehydrateWorkspace". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:105:5 - (ae-undocumented) Missing documentation for "cleanWorkspace". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:108:5 - (ae-undocumented) Missing documentation for "serializeWorkspace". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:112:5 - (ae-undocumented) Missing documentation for "cancelTask". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:115:5 - (ae-undocumented) Missing documentation for "retryTask". -// src/scaffolder/tasks/DatabaseTaskStore.d.ts:118:5 - (ae-undocumented) Missing documentation for "recoverTasks". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:25:5 - (ae-undocumented) Missing documentation for "create". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:27:5 - (ae-undocumented) Missing documentation for "spec". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:28:5 - (ae-undocumented) Missing documentation for "cancelSignal". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:29:5 - (ae-undocumented) Missing documentation for "secrets". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:30:5 - (ae-undocumented) Missing documentation for "createdBy". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:31:5 - (ae-undocumented) Missing documentation for "getWorkspaceName". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:32:5 - (ae-undocumented) Missing documentation for "rehydrateWorkspace". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:36:5 - (ae-undocumented) Missing documentation for "done". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:37:5 - (ae-undocumented) Missing documentation for "emitLog". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:38:5 - (ae-undocumented) Missing documentation for "getTaskState". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:41:5 - (ae-undocumented) Missing documentation for "updateCheckpoint". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:50:5 - (ae-undocumented) Missing documentation for "serializeWorkspace". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:53:5 - (ae-undocumented) Missing documentation for "cleanWorkspace". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:54:5 - (ae-undocumented) Missing documentation for "complete". -// src/scaffolder/tasks/StorageTaskBroker.d.ts:56:5 - (ae-undocumented) Missing documentation for "getInitiatorCredentials". -// src/scaffolder/tasks/TaskWorker.d.ts:60:5 - (ae-undocumented) Missing documentation for "create". -// src/scaffolder/tasks/TaskWorker.d.ts:61:5 - (ae-undocumented) Missing documentation for "recoverTasks". -// src/scaffolder/tasks/TaskWorker.d.ts:62:5 - (ae-undocumented) Missing documentation for "start". -// src/scaffolder/tasks/TaskWorker.d.ts:63:5 - (ae-undocumented) Missing documentation for "stop". -// src/scaffolder/tasks/TaskWorker.d.ts:64:5 - (ae-undocumented) Missing documentation for "onReadyToClaimTask". -// src/scaffolder/tasks/TaskWorker.d.ts:65:5 - (ae-undocumented) Missing documentation for "runOneTask". -// src/scaffolder/tasks/types.d.ts:124:5 - (ae-undocumented) Missing documentation for "cancelTask". -// src/scaffolder/tasks/types.d.ts:125:5 - (ae-undocumented) Missing documentation for "createTask". -// src/scaffolder/tasks/types.d.ts:126:5 - (ae-undocumented) Missing documentation for "retryTask". -// src/scaffolder/tasks/types.d.ts:129:5 - (ae-undocumented) Missing documentation for "recoverTasks". -// src/scaffolder/tasks/types.d.ts:132:5 - (ae-undocumented) Missing documentation for "getTask". -// src/scaffolder/tasks/types.d.ts:133:5 - (ae-undocumented) Missing documentation for "claimTask". -// src/scaffolder/tasks/types.d.ts:134:5 - (ae-undocumented) Missing documentation for "completeTask". -// src/scaffolder/tasks/types.d.ts:139:5 - (ae-undocumented) Missing documentation for "heartbeatTask". -// src/scaffolder/tasks/types.d.ts:140:5 - (ae-undocumented) Missing documentation for "listStaleTasks". -// src/scaffolder/tasks/types.d.ts:147:5 - (ae-undocumented) Missing documentation for "list". -// src/scaffolder/tasks/types.d.ts:167:5 - (ae-undocumented) Missing documentation for "list". -// src/scaffolder/tasks/types.d.ts:186:5 - (ae-undocumented) Missing documentation for "emitLogEvent". -// src/scaffolder/tasks/types.d.ts:187:5 - (ae-undocumented) Missing documentation for "getTaskState". -// src/scaffolder/tasks/types.d.ts:192:5 - (ae-undocumented) Missing documentation for "saveTaskState". -// src/scaffolder/tasks/types.d.ts:196:5 - (ae-undocumented) Missing documentation for "listEvents". -// src/scaffolder/tasks/types.d.ts:199:5 - (ae-undocumented) Missing documentation for "shutdownTask". -// src/scaffolder/tasks/types.d.ts:200:5 - (ae-undocumented) Missing documentation for "rehydrateWorkspace". -// src/scaffolder/tasks/types.d.ts:204:5 - (ae-undocumented) Missing documentation for "cleanWorkspace". -// src/scaffolder/tasks/types.d.ts:207:5 - (ae-undocumented) Missing documentation for "serializeWorkspace". -// src/service/router.d.ts:17:1 - (ae-undocumented) Missing documentation for "TemplatePermissionRuleInput". -// src/service/router.d.ts:22:1 - (ae-undocumented) Missing documentation for "ActionPermissionRuleInput". -// src/service/router.d.ts:30:5 - (ae-undocumented) Missing documentation for "logger". -// src/service/router.d.ts:31:5 - (ae-undocumented) Missing documentation for "config". -// src/service/router.d.ts:32:5 - (ae-undocumented) Missing documentation for "reader". -// src/service/router.d.ts:33:5 - (ae-undocumented) Missing documentation for "lifecycle". -// src/service/router.d.ts:34:5 - (ae-undocumented) Missing documentation for "database". -// src/service/router.d.ts:35:5 - (ae-undocumented) Missing documentation for "catalogClient". -// src/service/router.d.ts:36:5 - (ae-undocumented) Missing documentation for "scheduler". -// src/service/router.d.ts:37:5 - (ae-undocumented) Missing documentation for "actions". -// src/service/router.d.ts:42:5 - (ae-undocumented) Missing documentation for "taskWorkers". -// src/service/router.d.ts:48:5 - (ae-undocumented) Missing documentation for "taskBroker". -// src/service/router.d.ts:49:5 - (ae-undocumented) Missing documentation for "additionalTemplateFilters". -// src/service/router.d.ts:50:5 - (ae-undocumented) Missing documentation for "additionalTemplateGlobals". -// src/service/router.d.ts:51:5 - (ae-undocumented) Missing documentation for "additionalWorkspaceProviders". -// src/service/router.d.ts:52:5 - (ae-undocumented) Missing documentation for "permissions". -// src/service/router.d.ts:53:5 - (ae-undocumented) Missing documentation for "permissionRules". -// src/service/router.d.ts:54:5 - (ae-undocumented) Missing documentation for "auth". -// src/service/router.d.ts:55:5 - (ae-undocumented) Missing documentation for "httpAuth". -// src/service/router.d.ts:56:5 - (ae-undocumented) Missing documentation for "identity". -// src/service/router.d.ts:57:5 - (ae-undocumented) Missing documentation for "discovery". -// src/service/router.d.ts:58:5 - (ae-undocumented) Missing documentation for "autocompleteHandlers". ``` diff --git a/plugins/scaffolder-common/report.api.md b/plugins/scaffolder-common/report.api.md index 2058c08203..8d7a61910d 100644 --- a/plugins/scaffolder-common/report.api.md +++ b/plugins/scaffolder-common/report.api.md @@ -123,15 +123,4 @@ export interface TemplatePresentationV1beta3 extends JsonObject { export interface TemplateRecoveryV1beta3 extends JsonObject { EXPERIMENTAL_strategy?: 'none' | 'startOver'; } - -// Warnings were encountered during analysis: -// -// src/TemplateEntityV1beta3.d.ts:102:5 - (ae-undocumented) Missing documentation for "id". -// src/TemplateEntityV1beta3.d.ts:103:5 - (ae-undocumented) Missing documentation for "name". -// src/TemplateEntityV1beta3.d.ts:104:5 - (ae-undocumented) Missing documentation for "action". -// src/TemplateEntityV1beta3.d.ts:105:5 - (ae-undocumented) Missing documentation for "input". -// src/TemplateEntityV1beta3.d.ts:106:5 - (ae-undocumented) Missing documentation for "if". -// src/TemplateEntityV1beta3.d.ts:107:5 - (ae-undocumented) Missing documentation for ""backstage:permissions"". -// src/TemplateEntityV1beta3.d.ts:115:5 - (ae-undocumented) Missing documentation for ""backstage:permissions"". -// src/TemplateEntityV1beta3.d.ts:123:5 - (ae-undocumented) Missing documentation for "tags". ``` diff --git a/plugins/scaffolder-node/report-alpha.api.md b/plugins/scaffolder-node/report-alpha.api.md index 2258515b6d..c9b8130f0e 100644 --- a/plugins/scaffolder-node/report-alpha.api.md +++ b/plugins/scaffolder-node/report-alpha.api.md @@ -109,17 +109,5 @@ export interface WorkspaceProvider { }): Promise; } -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:9:5 - (ae-undocumented) Missing documentation for "addActions". -// src/alpha.d.ts:23:5 - (ae-undocumented) Missing documentation for "setTaskBroker". -// src/alpha.d.ts:37:5 - (ae-undocumented) Missing documentation for "addTemplateFilters". -// src/alpha.d.ts:38:5 - (ae-undocumented) Missing documentation for "addTemplateGlobals". -// src/alpha.d.ts:64:5 - (ae-undocumented) Missing documentation for "addAutocompleteProvider". -// src/alpha.d.ts:81:5 - (ae-undocumented) Missing documentation for "serializeWorkspace". -// src/alpha.d.ts:85:5 - (ae-undocumented) Missing documentation for "cleanWorkspace". -// src/alpha.d.ts:88:5 - (ae-undocumented) Missing documentation for "rehydrateWorkspace". -// src/alpha.d.ts:99:5 - (ae-undocumented) Missing documentation for "addProviders". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/scaffolder-node/report.api.md b/plugins/scaffolder-node/report.api.md index c6cabda02c..6328f94bfd 100644 --- a/plugins/scaffolder-node/report.api.md +++ b/plugins/scaffolder-node/report.api.md @@ -481,51 +481,4 @@ export type TemplateFilter = (...args: JsonValue[]) => JsonValue | undefined; export type TemplateGlobal = | ((...args: JsonValue[]) => JsonValue | undefined) | JsonValue; - -// Warnings were encountered during analysis: -// -// src/actions/createTemplateAction.d.ts:6:1 - (ae-undocumented) Missing documentation for "TemplateExample". -// src/actions/createTemplateAction.d.ts:11:1 - (ae-undocumented) Missing documentation for "TemplateActionOptions". -// src/actions/gitHelpers.d.ts:5:1 - (ae-undocumented) Missing documentation for "initRepoAndPush". -// src/actions/gitHelpers.d.ts:27:1 - (ae-undocumented) Missing documentation for "commitAndPushRepo". -// src/actions/gitHelpers.d.ts:49:1 - (ae-undocumented) Missing documentation for "cloneRepo". -// src/actions/gitHelpers.d.ts:66:1 - (ae-undocumented) Missing documentation for "createBranch". -// src/actions/gitHelpers.d.ts:80:1 - (ae-undocumented) Missing documentation for "addFiles". -// src/actions/gitHelpers.d.ts:94:1 - (ae-undocumented) Missing documentation for "commitAndPushBranch". -// src/actions/types.d.ts:60:1 - (ae-undocumented) Missing documentation for "TemplateAction". -// src/actions/util.d.ts:5:22 - (ae-undocumented) Missing documentation for "getRepoSourceDirectory". -// src/actions/util.d.ts:9:22 - (ae-undocumented) Missing documentation for "parseRepoUrl". -// src/files/serializeDirectoryContents.d.ts:6:1 - (ae-undocumented) Missing documentation for "serializeDirectoryContents". -// src/files/types.d.ts:6:1 - (ae-undocumented) Missing documentation for "SerializedFile". -// src/files/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "path". -// src/files/types.d.ts:8:5 - (ae-undocumented) Missing documentation for "content". -// src/files/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "executable". -// src/files/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "symlink". -// src/tasks/types.d.ts:83:5 - (ae-undocumented) Missing documentation for "cancelSignal". -// src/tasks/types.d.ts:84:5 - (ae-undocumented) Missing documentation for "spec". -// src/tasks/types.d.ts:85:5 - (ae-undocumented) Missing documentation for "secrets". -// src/tasks/types.d.ts:86:5 - (ae-undocumented) Missing documentation for "createdBy". -// src/tasks/types.d.ts:87:5 - (ae-undocumented) Missing documentation for "done". -// src/tasks/types.d.ts:88:5 - (ae-undocumented) Missing documentation for "isDryRun". -// src/tasks/types.d.ts:89:5 - (ae-undocumented) Missing documentation for "complete". -// src/tasks/types.d.ts:90:5 - (ae-undocumented) Missing documentation for "emitLog". -// src/tasks/types.d.ts:91:5 - (ae-undocumented) Missing documentation for "getTaskState". -// src/tasks/types.d.ts:94:5 - (ae-undocumented) Missing documentation for "updateCheckpoint". -// src/tasks/types.d.ts:103:5 - (ae-undocumented) Missing documentation for "serializeWorkspace". -// src/tasks/types.d.ts:106:5 - (ae-undocumented) Missing documentation for "cleanWorkspace". -// src/tasks/types.d.ts:107:5 - (ae-undocumented) Missing documentation for "rehydrateWorkspace". -// src/tasks/types.d.ts:111:5 - (ae-undocumented) Missing documentation for "getWorkspaceName". -// src/tasks/types.d.ts:112:5 - (ae-undocumented) Missing documentation for "getInitiatorCredentials". -// src/tasks/types.d.ts:120:5 - (ae-undocumented) Missing documentation for "cancel". -// src/tasks/types.d.ts:121:5 - (ae-undocumented) Missing documentation for "retry". -// src/tasks/types.d.ts:122:5 - (ae-undocumented) Missing documentation for "claim". -// src/tasks/types.d.ts:123:5 - (ae-undocumented) Missing documentation for "recoverTasks". -// src/tasks/types.d.ts:124:5 - (ae-undocumented) Missing documentation for "dispatch". -// src/tasks/types.d.ts:125:5 - (ae-undocumented) Missing documentation for "vacuumTasks". -// src/tasks/types.d.ts:128:5 - (ae-undocumented) Missing documentation for "event$". -// src/tasks/types.d.ts:134:5 - (ae-undocumented) Missing documentation for "get". -// src/tasks/types.d.ts:135:5 - (ae-undocumented) Missing documentation for "list". -// src/tasks/types.d.ts:155:5 - (ae-undocumented) Missing documentation for "list". -// src/types.d.ts:3:1 - (ae-undocumented) Missing documentation for "TemplateFilter". -// src/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "TemplateGlobal". ``` diff --git a/plugins/scaffolder-react/report-alpha.api.md b/plugins/scaffolder-react/report-alpha.api.md index e15ee181d2..7084625ad4 100644 --- a/plugins/scaffolder-react/report-alpha.api.md +++ b/plugins/scaffolder-react/report-alpha.api.md @@ -48,6 +48,12 @@ export type BackstageOverrides = Overrides & { >; }; +// @alpha (undocumented) +export type BackstageTemplateStepperClassKey = + | 'backButton' + | 'footer' + | 'formWrapper'; + // @alpha (undocumented) export const createAsyncValidators: ( rootSchema: JsonObject, @@ -374,52 +380,5 @@ export type WorkflowProps = { | 'layouts' >; -// Warnings were encountered during analysis: -// -// src/next/blueprints/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "FormFieldExtensionData". -// src/next/components/ScaffolderField/ScaffolderField.d.ts:7:5 - (ae-undocumented) Missing documentation for "rawDescription". -// src/next/components/ScaffolderField/ScaffolderField.d.ts:8:5 - (ae-undocumented) Missing documentation for "errors". -// src/next/components/ScaffolderField/ScaffolderField.d.ts:9:5 - (ae-undocumented) Missing documentation for "rawErrors". -// src/next/components/ScaffolderField/ScaffolderField.d.ts:10:5 - (ae-undocumented) Missing documentation for "help". -// src/next/components/ScaffolderField/ScaffolderField.d.ts:11:5 - (ae-undocumented) Missing documentation for "rawHelp". -// src/next/components/ScaffolderField/ScaffolderField.d.ts:12:5 - (ae-undocumented) Missing documentation for "required". -// src/next/components/ScaffolderField/ScaffolderField.d.ts:13:5 - (ae-undocumented) Missing documentation for "disabled". -// src/next/components/ScaffolderField/ScaffolderField.d.ts:14:5 - (ae-undocumented) Missing documentation for "displayLabel". -// src/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.d.ts:5:1 - (ae-undocumented) Missing documentation for "ScaffolderPageContextMenuProps". -// src/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.d.ts:14:1 - (ae-undocumented) Missing documentation for "ScaffolderPageContextMenu". -// src/next/components/Stepper/createAsyncValidators.d.ts:6:1 - (ae-undocumented) Missing documentation for "FormValidation". -// src/next/components/Stepper/createAsyncValidators.d.ts:10:22 - (ae-undocumented) Missing documentation for "createAsyncValidators". -// src/next/components/TaskSteps/TaskSteps.d.ts:10:5 - (ae-undocumented) Missing documentation for "steps". -// src/next/components/TaskSteps/TaskSteps.d.ts:11:5 - (ae-undocumented) Missing documentation for "activeStep". -// src/next/components/TaskSteps/TaskSteps.d.ts:12:5 - (ae-undocumented) Missing documentation for "isComplete". -// src/next/components/TaskSteps/TaskSteps.d.ts:13:5 - (ae-undocumented) Missing documentation for "isError". -// src/next/components/TemplateCard/TemplateCard.d.ts:9:5 - (ae-undocumented) Missing documentation for "template". -// src/next/components/TemplateCard/TemplateCard.d.ts:10:5 - (ae-undocumented) Missing documentation for "additionalLinks". -// src/next/components/TemplateCard/TemplateCard.d.ts:15:5 - (ae-undocumented) Missing documentation for "onSelected". -// src/next/components/TemplateCategoryPicker/TemplateCategoryPicker.d.ts:3:1 - (ae-undocumented) Missing documentation for "ScaffolderReactTemplateCategoryPickerClassKey". -// src/next/components/TemplateGroup/TemplateGroup.d.ts:10:5 - (ae-undocumented) Missing documentation for "templates". -// src/next/components/TemplateGroup/TemplateGroup.d.ts:18:5 - (ae-undocumented) Missing documentation for "onSelected". -// src/next/components/TemplateGroup/TemplateGroup.d.ts:19:5 - (ae-undocumented) Missing documentation for "title". -// src/next/components/TemplateGroup/TemplateGroup.d.ts:20:5 - (ae-undocumented) Missing documentation for "components". -// src/next/components/TemplateGroups/TemplateGroups.d.ts:8:1 - (ae-undocumented) Missing documentation for "TemplateGroupsProps". -// src/next/components/TemplateGroups/TemplateGroups.d.ts:9:5 - (ae-undocumented) Missing documentation for "groups". -// src/next/components/TemplateGroups/TemplateGroups.d.ts:10:5 - (ae-undocumented) Missing documentation for "templateFilter". -// src/next/components/TemplateGroups/TemplateGroups.d.ts:11:5 - (ae-undocumented) Missing documentation for "TemplateCardComponent". -// src/next/components/TemplateGroups/TemplateGroups.d.ts:14:5 - (ae-undocumented) Missing documentation for "onTemplateSelected". -// src/next/components/TemplateGroups/TemplateGroups.d.ts:15:5 - (ae-undocumented) Missing documentation for "additionalLinksForEntity". -// src/next/components/TemplateGroups/TemplateGroups.d.ts:24:22 - (ae-undocumented) Missing documentation for "TemplateGroups". -// src/next/components/Workflow/Workflow.d.ts:7:1 - (ae-undocumented) Missing documentation for "WorkflowProps". -// src/next/components/Workflow/Workflow.d.ts:20:22 - (ae-undocumented) Missing documentation for "Workflow". -// src/next/components/Workflow/Workflow.d.ts:24:22 - (ae-undocumented) Missing documentation for "EmbeddableWorkflow". -// src/next/hooks/useTemplateParameterSchema.d.ts:5:22 - (ae-undocumented) Missing documentation for "useTemplateParameterSchema". -// src/next/hooks/useTemplateSchema.d.ts:10:5 - (ae-undocumented) Missing documentation for "uiSchema". -// src/next/hooks/useTemplateSchema.d.ts:11:5 - (ae-undocumented) Missing documentation for "mergedSchema". -// src/next/hooks/useTemplateSchema.d.ts:12:5 - (ae-undocumented) Missing documentation for "schema". -// src/next/hooks/useTemplateSchema.d.ts:13:5 - (ae-undocumented) Missing documentation for "title". -// src/next/hooks/useTemplateSchema.d.ts:14:5 - (ae-undocumented) Missing documentation for "description". -// src/next/overridableComponents.d.ts:6:1 - (ae-undocumented) Missing documentation for "ScaffolderReactComponentsNameToClassKey". -// src/next/overridableComponents.d.ts:8:5 - (ae-forgotten-export) The symbol "BackstageTemplateStepperClassKey" needs to be exported by the entry point alpha.d.ts -// src/next/overridableComponents.d.ts:11:1 - (ae-undocumented) Missing documentation for "BackstageOverrides". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/scaffolder-react/report.api.md b/plugins/scaffolder-react/report.api.md index 73573b25c4..5523b52ad9 100644 --- a/plugins/scaffolder-react/report.api.md +++ b/plugins/scaffolder-react/report.api.md @@ -558,50 +558,5 @@ export const useTaskEventStream: (taskId: string) => TaskStream; // @public export const useTemplateSecrets: () => ScaffolderUseTemplateSecrets; -// Warnings were encountered during analysis: -// -// src/api/ref.d.ts:3:22 - (ae-undocumented) Missing documentation for "scaffolderApiRef". -// src/api/types.d.ts:53:1 - (ae-undocumented) Missing documentation for "ScaffolderOutputLink". -// src/api/types.d.ts:60:1 - (ae-undocumented) Missing documentation for "ScaffolderOutputText". -// src/api/types.d.ts:67:1 - (ae-undocumented) Missing documentation for "ScaffolderTaskOutput". -// src/api/types.d.ts:95:5 - (ae-undocumented) Missing documentation for "templateRef". -// src/api/types.d.ts:96:5 - (ae-undocumented) Missing documentation for "values". -// src/api/types.d.ts:97:5 - (ae-undocumented) Missing documentation for "secrets". -// src/api/types.d.ts:105:5 - (ae-undocumented) Missing documentation for "taskId". -// src/api/types.d.ts:113:5 - (ae-undocumented) Missing documentation for "allowedHosts". -// src/api/types.d.ts:121:5 - (ae-undocumented) Missing documentation for "integrations". -// src/api/types.d.ts:133:5 - (ae-undocumented) Missing documentation for "isTaskRecoverable". -// src/api/types.d.ts:134:5 - (ae-undocumented) Missing documentation for "taskId". -// src/api/types.d.ts:135:5 - (ae-undocumented) Missing documentation for "after". -// src/api/types.d.ts:138:1 - (ae-undocumented) Missing documentation for "ScaffolderDryRunOptions". -// src/api/types.d.ts:139:5 - (ae-undocumented) Missing documentation for "template". -// src/api/types.d.ts:140:5 - (ae-undocumented) Missing documentation for "values". -// src/api/types.d.ts:141:5 - (ae-undocumented) Missing documentation for "secrets". -// src/api/types.d.ts:142:5 - (ae-undocumented) Missing documentation for "directoryContents". -// src/api/types.d.ts:148:1 - (ae-undocumented) Missing documentation for "ScaffolderDryRunResponse". -// src/api/types.d.ts:149:5 - (ae-undocumented) Missing documentation for "directoryContents". -// src/api/types.d.ts:154:5 - (ae-undocumented) Missing documentation for "log". -// src/api/types.d.ts:155:5 - (ae-undocumented) Missing documentation for "steps". -// src/api/types.d.ts:156:5 - (ae-undocumented) Missing documentation for "output". -// src/api/types.d.ts:164:5 - (ae-undocumented) Missing documentation for "getTemplateParameterSchema". -// src/api/types.d.ts:172:5 - (ae-undocumented) Missing documentation for "getTask". -// src/api/types.d.ts:185:5 - (ae-undocumented) Missing documentation for "listTasks". -// src/api/types.d.ts:193:5 - (ae-undocumented) Missing documentation for "getIntegrationsList". -// src/api/types.d.ts:198:5 - (ae-undocumented) Missing documentation for "streamLogs". -// src/api/types.d.ts:199:5 - (ae-undocumented) Missing documentation for "dryRun". -// src/api/types.d.ts:200:5 - (ae-undocumented) Missing documentation for "autocomplete". -// src/components/types.d.ts:7:1 - (ae-undocumented) Missing documentation for "TemplateGroupFilter". -// src/extensions/types.d.ts:13:5 - (ae-undocumented) Missing documentation for "uiSchema". -// src/extensions/types.d.ts:30:5 - (ae-undocumented) Missing documentation for ""ui:options"". -// src/layouts/createScaffolderLayout.d.ts:16:5 - (ae-undocumented) Missing documentation for "name". -// src/layouts/createScaffolderLayout.d.ts:17:5 - (ae-undocumented) Missing documentation for "component". -// src/secrets/SecretsContext.d.ts:14:5 - (ae-undocumented) Missing documentation for "setSecrets". -// src/secrets/SecretsContext.d.ts:15:5 - (ae-undocumented) Missing documentation for "secrets". -// src/utils.d.ts:4:1 - (ae-undocumented) Missing documentation for "makeFieldSchema". -// src/utils.d.ts:15:5 - (ae-undocumented) Missing documentation for "type". -// src/utils.d.ts:17:5 - (ae-undocumented) Missing documentation for "uiOptionsType". -// src/utils.d.ts:18:5 - (ae-undocumented) Missing documentation for "schema". -// src/utils.d.ts:19:5 - (ae-undocumented) Missing documentation for "TProps". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/scaffolder-react/src/next/components/Stepper/index.ts b/plugins/scaffolder-react/src/next/components/Stepper/index.ts index 5f33c2ff78..113d18bf18 100644 --- a/plugins/scaffolder-react/src/next/components/Stepper/index.ts +++ b/plugins/scaffolder-react/src/next/components/Stepper/index.ts @@ -13,7 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { Stepper, type StepperProps } from './Stepper'; +export { + Stepper, + type StepperProps, + type BackstageTemplateStepperClassKey, +} from './Stepper'; export { createAsyncValidators, type FormValidation, diff --git a/plugins/scaffolder/report-alpha.api.md b/plugins/scaffolder/report-alpha.api.md index 2dcef12726..4253b2b914 100644 --- a/plugins/scaffolder/report-alpha.api.md +++ b/plugins/scaffolder/report-alpha.api.md @@ -379,15 +379,5 @@ export type TemplateWizardPageProps = { }; }; -// Warnings were encountered during analysis: -// -// src/alpha/components/TemplateEditorPage/CustomFieldExplorer.d.ts:4:1 - (ae-undocumented) Missing documentation for "ScaffolderCustomFieldExplorerClassKey". -// src/alpha/components/TemplateEditorPage/TemplateEditor.d.ts:4:1 - (ae-undocumented) Missing documentation for "ScaffolderTemplateEditorClassKey". -// src/alpha/components/TemplateEditorPage/TemplateFormPreviewer.d.ts:4:1 - (ae-undocumented) Missing documentation for "ScaffolderTemplateFormPreviewerClassKey". -// src/alpha/components/TemplateListPage/TemplateListPage.d.ts:7:1 - (ae-undocumented) Missing documentation for "TemplateListPageProps". -// src/alpha/components/TemplateWizardPage/TemplateWizardPage.d.ts:6:1 - (ae-undocumented) Missing documentation for "TemplateWizardPageProps". -// src/alpha/plugin.d.ts:3:15 - (ae-undocumented) Missing documentation for "_default". -// src/translation.d.ts:2:22 - (ae-undocumented) Missing documentation for "scaffolderTranslationRef". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/scaffolder/report.api.md b/plugins/scaffolder/report.api.md index 35b3dad66e..8a1d3db179 100644 --- a/plugins/scaffolder/report.api.md +++ b/plugins/scaffolder/report.api.md @@ -671,56 +671,4 @@ export const TemplateTypePicker: () => React_2.JSX.Element | null; // @public @deprecated (undocumented) export const useTemplateSecrets: () => ScaffolderUseTemplateSecrets_2; - -// Warnings were encountered during analysis: -// -// src/api.d.ts:23:5 - (ae-undocumented) Missing documentation for "listTasks". -// src/api.d.ts:31:5 - (ae-undocumented) Missing documentation for "getIntegrationsList". -// src/api.d.ts:32:5 - (ae-undocumented) Missing documentation for "getTemplateParameterSchema". -// src/api.d.ts:33:5 - (ae-undocumented) Missing documentation for "scaffold". -// src/api.d.ts:34:5 - (ae-undocumented) Missing documentation for "getTask". -// src/api.d.ts:35:5 - (ae-undocumented) Missing documentation for "streamLogs". -// src/api.d.ts:36:5 - (ae-undocumented) Missing documentation for "dryRun". -// src/api.d.ts:39:5 - (ae-undocumented) Missing documentation for "listActions". -// src/api.d.ts:40:5 - (ae-undocumented) Missing documentation for "cancelTask". -// src/api.d.ts:41:5 - (ae-undocumented) Missing documentation for "retry". -// src/api.d.ts:42:5 - (ae-undocumented) Missing documentation for "autocomplete". -// src/components/OngoingTask/OngoingTask.d.ts:6:22 - (ae-undocumented) Missing documentation for "OngoingTask". -// src/components/fields/EntityPicker/schema.d.ts:15:22 - (ae-undocumented) Missing documentation for "EntityPickerFieldSchema". -// src/components/fields/EntityTagsPicker/schema.d.ts:4:22 - (ae-undocumented) Missing documentation for "EntityTagsPickerFieldSchema". -// src/components/fields/OwnedEntityPicker/schema.d.ts:4:22 - (ae-undocumented) Missing documentation for "OwnedEntityPickerFieldSchema". -// src/components/fields/OwnerPicker/schema.d.ts:4:22 - (ae-undocumented) Missing documentation for "OwnerPickerFieldSchema". -// src/components/fields/RepoUrlPicker/schema.d.ts:4:22 - (ae-undocumented) Missing documentation for "RepoUrlPickerFieldSchema". -// src/components/fields/utils.d.ts:7:1 - (ae-undocumented) Missing documentation for "FieldSchema". -// src/components/fields/utils.d.ts:15:1 - (ae-undocumented) Missing documentation for "makeFieldSchemaFromZod". -// src/deprecated.d.ts:7:22 - (ae-undocumented) Missing documentation for "rootRouteRef". -// src/deprecated.d.ts:12:22 - (ae-undocumented) Missing documentation for "createScaffolderFieldExtension". -// src/deprecated.d.ts:17:22 - (ae-undocumented) Missing documentation for "ScaffolderFieldExtensions". -// src/deprecated.d.ts:24:22 - (ae-undocumented) Missing documentation for "useTemplateSecrets". -// src/deprecated.d.ts:29:22 - (ae-undocumented) Missing documentation for "scaffolderApiRef". -// src/deprecated.d.ts:34:1 - (ae-undocumented) Missing documentation for "ScaffolderApi". -// src/deprecated.d.ts:39:1 - (ae-undocumented) Missing documentation for "ScaffolderUseTemplateSecrets". -// src/deprecated.d.ts:44:1 - (ae-undocumented) Missing documentation for "TemplateParameterSchema". -// src/deprecated.d.ts:49:1 - (ae-undocumented) Missing documentation for "CustomFieldExtensionSchema". -// src/deprecated.d.ts:54:1 - (ae-undocumented) Missing documentation for "CustomFieldValidator". -// src/deprecated.d.ts:59:1 - (ae-undocumented) Missing documentation for "FieldExtensionOptions". -// src/deprecated.d.ts:64:1 - (ae-undocumented) Missing documentation for "FieldExtensionComponentProps". -// src/deprecated.d.ts:69:1 - (ae-undocumented) Missing documentation for "FieldExtensionComponent". -// src/deprecated.d.ts:74:1 - (ae-undocumented) Missing documentation for "ListActionsResponse". -// src/deprecated.d.ts:79:1 - (ae-undocumented) Missing documentation for "LogEvent". -// src/deprecated.d.ts:84:1 - (ae-undocumented) Missing documentation for "ScaffolderDryRunOptions". -// src/deprecated.d.ts:89:1 - (ae-undocumented) Missing documentation for "ScaffolderDryRunResponse". -// src/deprecated.d.ts:94:1 - (ae-undocumented) Missing documentation for "ScaffolderGetIntegrationsListOptions". -// src/deprecated.d.ts:99:1 - (ae-undocumented) Missing documentation for "ScaffolderGetIntegrationsListResponse". -// src/deprecated.d.ts:104:1 - (ae-undocumented) Missing documentation for "ScaffolderOutputlink". -// src/deprecated.d.ts:109:1 - (ae-undocumented) Missing documentation for "ScaffolderScaffoldOptions". -// src/deprecated.d.ts:114:1 - (ae-undocumented) Missing documentation for "ScaffolderScaffoldResponse". -// src/deprecated.d.ts:119:1 - (ae-undocumented) Missing documentation for "ScaffolderStreamLogsOptions". -// src/deprecated.d.ts:124:1 - (ae-undocumented) Missing documentation for "ScaffolderTask". -// src/deprecated.d.ts:129:1 - (ae-undocumented) Missing documentation for "ScaffolderTaskOutput". -// src/deprecated.d.ts:134:1 - (ae-undocumented) Missing documentation for "ScaffolderTaskStatus". -// src/deprecated.d.ts:139:22 - (ae-undocumented) Missing documentation for "createScaffolderLayout". -// src/deprecated.d.ts:144:22 - (ae-undocumented) Missing documentation for "ScaffolderLayouts". -// src/deprecated.d.ts:151:1 - (ae-undocumented) Missing documentation for "LayoutTemplate". -// src/deprecated.d.ts:156:1 - (ae-undocumented) Missing documentation for "LayoutOptions". ``` diff --git a/plugins/search-backend-module-catalog/report-alpha.api.md b/plugins/search-backend-module-catalog/report-alpha.api.md index 8a91ccdb5e..a622e05a3e 100644 --- a/plugins/search-backend-module-catalog/report-alpha.api.md +++ b/plugins/search-backend-module-catalog/report-alpha.api.md @@ -4,26 +4,10 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -import { CatalogCollatorEntityTransformer } from '@backstage/plugin-search-backend-module-catalog'; -import { ExtensionPoint } from '@backstage/backend-plugin-api'; - -// Warning: (ae-forgotten-export) The symbol "CatalogCollatorExtensionPoint_2" needs to be exported by the entry point alpha.d.ts -// -// @alpha (undocumented) -export type CatalogCollatorExtensionPoint = CatalogCollatorExtensionPoint_2; - -// @alpha (undocumented) -export const catalogCollatorExtensionPoint: ExtensionPoint; // @alpha (undocumented) const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". -// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "CatalogCollatorExtensionPoint". -// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "catalogCollatorExtensionPoint". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-catalog/report.api.md b/plugins/search-backend-module-catalog/report.api.md index f20907494e..76314dcdf5 100644 --- a/plugins/search-backend-module-catalog/report.api.md +++ b/plugins/search-backend-module-catalog/report.api.md @@ -66,14 +66,4 @@ export type DefaultCatalogCollatorFactoryOptions = { catalogClient?: CatalogApi; entityTransformer?: CatalogCollatorEntityTransformer; }; - -// Warnings were encountered during analysis: -// -// src/collators/CatalogCollatorEntityTransformer.d.ts:4:1 - (ae-undocumented) Missing documentation for "CatalogCollatorEntityTransformer". -// src/collators/DefaultCatalogCollatorFactory.d.ts:14:1 - (ae-undocumented) Missing documentation for "DefaultCatalogCollatorFactoryOptions". -// src/collators/DefaultCatalogCollatorFactory.d.ts:43:5 - (ae-undocumented) Missing documentation for "type". -// src/collators/DefaultCatalogCollatorFactory.d.ts:44:5 - (ae-undocumented) Missing documentation for "visibilityPermission". -// src/collators/DefaultCatalogCollatorFactory.d.ts:51:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/collators/DefaultCatalogCollatorFactory.d.ts:53:5 - (ae-undocumented) Missing documentation for "getCollator". -// src/collators/defaultCatalogCollatorEntityTransformer.d.ts:3:22 - (ae-undocumented) Missing documentation for "defaultCatalogCollatorEntityTransformer". ``` diff --git a/plugins/search-backend-module-catalog/src/alpha.ts b/plugins/search-backend-module-catalog/src/alpha.ts index b5fbb5e0c6..e5554e85bd 100644 --- a/plugins/search-backend-module-catalog/src/alpha.ts +++ b/plugins/search-backend-module-catalog/src/alpha.ts @@ -14,17 +14,8 @@ * limitations under the License. */ -import { - default as feature, - CatalogCollatorExtensionPoint as ExtensionPoint, - catalogCollatorExtensionPoint as extensionPoint, -} from './module'; +import { default as feature } from './module'; /** @alpha */ const _feature = feature; export default _feature; - -/** @alpha */ -export type CatalogCollatorExtensionPoint = ExtensionPoint; -/** @alpha */ -export const catalogCollatorExtensionPoint = extensionPoint; diff --git a/plugins/search-backend-module-elasticsearch/report-alpha.api.md b/plugins/search-backend-module-elasticsearch/report-alpha.api.md index 344718f5e5..17107defe3 100644 --- a/plugins/search-backend-module-elasticsearch/report-alpha.api.md +++ b/plugins/search-backend-module-elasticsearch/report-alpha.api.md @@ -4,27 +4,10 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -import { ElasticSearchQueryTranslator } from '@backstage/plugin-search-backend-module-elasticsearch'; -import { ExtensionPoint } from '@backstage/backend-plugin-api'; - -// Warning: (ae-forgotten-export) The symbol "ElasticSearchQueryTranslatorExtensionPoint_2" needs to be exported by the entry point alpha.d.ts -// -// @alpha (undocumented) -export type ElasticSearchQueryTranslatorExtensionPoint = - ElasticSearchQueryTranslatorExtensionPoint_2; - -// @alpha (undocumented) -export const elasticsearchTranslatorExtensionPoint: ExtensionPoint; // @alpha (undocumented) const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". -// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "ElasticSearchQueryTranslatorExtensionPoint". -// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "elasticsearchTranslatorExtensionPoint". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-elasticsearch/report.api.md b/plugins/search-backend-module-elasticsearch/report.api.md index d1ec3b171d..74e70af364 100644 --- a/plugins/search-backend-module-elasticsearch/report.api.md +++ b/plugins/search-backend-module-elasticsearch/report.api.md @@ -473,101 +473,4 @@ export interface OpenSearchNodeOptions { // (undocumented) url: URL; } - -// Warnings were encountered during analysis: -// -// src/engines/ElasticSearchClientOptions.d.ts:29:5 - (ae-undocumented) Missing documentation for "provider". -// src/engines/ElasticSearchClientOptions.d.ts:30:5 - (ae-undocumented) Missing documentation for "region". -// src/engines/ElasticSearchClientOptions.d.ts:31:5 - (ae-undocumented) Missing documentation for "service". -// src/engines/ElasticSearchClientOptions.d.ts:32:5 - (ae-undocumented) Missing documentation for "auth". -// src/engines/ElasticSearchClientOptions.d.ts:33:5 - (ae-undocumented) Missing documentation for "connection". -// src/engines/ElasticSearchClientOptions.d.ts:34:5 - (ae-undocumented) Missing documentation for "node". -// src/engines/ElasticSearchClientOptions.d.ts:35:5 - (ae-undocumented) Missing documentation for "nodes". -// src/engines/ElasticSearchClientOptions.d.ts:46:5 - (ae-undocumented) Missing documentation for "provider". -// src/engines/ElasticSearchClientOptions.d.ts:47:5 - (ae-undocumented) Missing documentation for "auth". -// src/engines/ElasticSearchClientOptions.d.ts:48:5 - (ae-undocumented) Missing documentation for "Connection". -// src/engines/ElasticSearchClientOptions.d.ts:49:5 - (ae-undocumented) Missing documentation for "node". -// src/engines/ElasticSearchClientOptions.d.ts:50:5 - (ae-undocumented) Missing documentation for "nodes". -// src/engines/ElasticSearchClientOptions.d.ts:51:5 - (ae-undocumented) Missing documentation for "cloud". -// src/engines/ElasticSearchClientOptions.d.ts:64:5 - (ae-undocumented) Missing documentation for "Transport". -// src/engines/ElasticSearchClientOptions.d.ts:65:5 - (ae-undocumented) Missing documentation for "maxRetries". -// src/engines/ElasticSearchClientOptions.d.ts:66:5 - (ae-undocumented) Missing documentation for "requestTimeout". -// src/engines/ElasticSearchClientOptions.d.ts:67:5 - (ae-undocumented) Missing documentation for "pingTimeout". -// src/engines/ElasticSearchClientOptions.d.ts:68:5 - (ae-undocumented) Missing documentation for "sniffInterval". -// src/engines/ElasticSearchClientOptions.d.ts:69:5 - (ae-undocumented) Missing documentation for "sniffOnStart". -// src/engines/ElasticSearchClientOptions.d.ts:70:5 - (ae-undocumented) Missing documentation for "sniffEndpoint". -// src/engines/ElasticSearchClientOptions.d.ts:71:5 - (ae-undocumented) Missing documentation for "sniffOnConnectionFault". -// src/engines/ElasticSearchClientOptions.d.ts:72:5 - (ae-undocumented) Missing documentation for "resurrectStrategy". -// src/engines/ElasticSearchClientOptions.d.ts:73:5 - (ae-undocumented) Missing documentation for "suggestCompression". -// src/engines/ElasticSearchClientOptions.d.ts:74:5 - (ae-undocumented) Missing documentation for "compression". -// src/engines/ElasticSearchClientOptions.d.ts:75:5 - (ae-undocumented) Missing documentation for "ssl". -// src/engines/ElasticSearchClientOptions.d.ts:76:5 - (ae-undocumented) Missing documentation for "agent". -// src/engines/ElasticSearchClientOptions.d.ts:77:5 - (ae-undocumented) Missing documentation for "nodeFilter". -// src/engines/ElasticSearchClientOptions.d.ts:78:5 - (ae-undocumented) Missing documentation for "nodeSelector". -// src/engines/ElasticSearchClientOptions.d.ts:79:5 - (ae-undocumented) Missing documentation for "headers". -// src/engines/ElasticSearchClientOptions.d.ts:80:5 - (ae-undocumented) Missing documentation for "opaqueIdPrefix". -// src/engines/ElasticSearchClientOptions.d.ts:81:5 - (ae-undocumented) Missing documentation for "name". -// src/engines/ElasticSearchClientOptions.d.ts:82:5 - (ae-undocumented) Missing documentation for "proxy". -// src/engines/ElasticSearchClientOptions.d.ts:83:5 - (ae-undocumented) Missing documentation for "enableMetaHeader". -// src/engines/ElasticSearchClientOptions.d.ts:84:5 - (ae-undocumented) Missing documentation for "disablePrototypePoisoningProtection". -// src/engines/ElasticSearchClientOptions.d.ts:89:1 - (ae-undocumented) Missing documentation for "OpenSearchAuth". -// src/engines/ElasticSearchClientOptions.d.ts:96:1 - (ae-undocumented) Missing documentation for "ElasticSearchAuth". -// src/engines/ElasticSearchClientOptions.d.ts:105:1 - (ae-undocumented) Missing documentation for "ElasticSearchNodeOptions". -// src/engines/ElasticSearchClientOptions.d.ts:106:5 - (ae-undocumented) Missing documentation for "url". -// src/engines/ElasticSearchClientOptions.d.ts:107:5 - (ae-undocumented) Missing documentation for "id". -// src/engines/ElasticSearchClientOptions.d.ts:108:5 - (ae-undocumented) Missing documentation for "agent". -// src/engines/ElasticSearchClientOptions.d.ts:109:5 - (ae-undocumented) Missing documentation for "ssl". -// src/engines/ElasticSearchClientOptions.d.ts:110:5 - (ae-undocumented) Missing documentation for "headers". -// src/engines/ElasticSearchClientOptions.d.ts:111:5 - (ae-undocumented) Missing documentation for "roles". -// src/engines/ElasticSearchClientOptions.d.ts:121:1 - (ae-undocumented) Missing documentation for "OpenSearchNodeOptions". -// src/engines/ElasticSearchClientOptions.d.ts:122:5 - (ae-undocumented) Missing documentation for "url". -// src/engines/ElasticSearchClientOptions.d.ts:123:5 - (ae-undocumented) Missing documentation for "id". -// src/engines/ElasticSearchClientOptions.d.ts:124:5 - (ae-undocumented) Missing documentation for "agent". -// src/engines/ElasticSearchClientOptions.d.ts:125:5 - (ae-undocumented) Missing documentation for "ssl". -// src/engines/ElasticSearchClientOptions.d.ts:126:5 - (ae-undocumented) Missing documentation for "headers". -// src/engines/ElasticSearchClientOptions.d.ts:127:5 - (ae-undocumented) Missing documentation for "roles". -// src/engines/ElasticSearchClientOptions.d.ts:136:1 - (ae-undocumented) Missing documentation for "ElasticSearchAgentOptions". -// src/engines/ElasticSearchClientOptions.d.ts:137:5 - (ae-undocumented) Missing documentation for "keepAlive". -// src/engines/ElasticSearchClientOptions.d.ts:138:5 - (ae-undocumented) Missing documentation for "keepAliveMsecs". -// src/engines/ElasticSearchClientOptions.d.ts:139:5 - (ae-undocumented) Missing documentation for "maxSockets". -// src/engines/ElasticSearchClientOptions.d.ts:140:5 - (ae-undocumented) Missing documentation for "maxFreeSockets". -// src/engines/ElasticSearchClientOptions.d.ts:145:1 - (ae-undocumented) Missing documentation for "ElasticSearchConnectionConstructor". -// src/engines/ElasticSearchClientOptions.d.ts:146:5 - (ae-undocumented) Missing documentation for "__new". -// src/engines/ElasticSearchClientOptions.d.ts:147:5 - (ae-undocumented) Missing documentation for "statuses". -// src/engines/ElasticSearchClientOptions.d.ts:151:5 - (ae-undocumented) Missing documentation for "roles". -// src/engines/ElasticSearchClientOptions.d.ts:161:1 - (ae-undocumented) Missing documentation for "OpenSearchConnectionConstructor". -// src/engines/ElasticSearchClientOptions.d.ts:162:5 - (ae-undocumented) Missing documentation for "__new". -// src/engines/ElasticSearchClientOptions.d.ts:163:5 - (ae-undocumented) Missing documentation for "statuses". -// src/engines/ElasticSearchClientOptions.d.ts:167:5 - (ae-undocumented) Missing documentation for "roles". -// src/engines/ElasticSearchClientOptions.d.ts:176:1 - (ae-undocumented) Missing documentation for "ElasticSearchTransportConstructor". -// src/engines/ElasticSearchClientOptions.d.ts:177:5 - (ae-undocumented) Missing documentation for "__new". -// src/engines/ElasticSearchClientOptions.d.ts:178:5 - (ae-undocumented) Missing documentation for "sniffReasons". -// src/engines/ElasticSearchClientWrapper.d.ts:8:1 - (ae-undocumented) Missing documentation for "ElasticSearchAliasAction". -// src/engines/ElasticSearchClientWrapper.d.ts:32:1 - (ae-undocumented) Missing documentation for "ElasticSearchIndexAction". -// src/engines/ElasticSearchClientWrapper.d.ts:57:5 - (ae-undocumented) Missing documentation for "fromClientOptions". -// src/engines/ElasticSearchClientWrapper.d.ts:58:5 - (ae-undocumented) Missing documentation for "search". -// src/engines/ElasticSearchClientWrapper.d.ts:62:5 - (ae-undocumented) Missing documentation for "bulk". -// src/engines/ElasticSearchClientWrapper.d.ts:67:5 - (ae-undocumented) Missing documentation for "putIndexTemplate". -// src/engines/ElasticSearchClientWrapper.d.ts:68:5 - (ae-undocumented) Missing documentation for "listIndices". -// src/engines/ElasticSearchClientWrapper.d.ts:71:5 - (ae-undocumented) Missing documentation for "indexExists". -// src/engines/ElasticSearchClientWrapper.d.ts:74:5 - (ae-undocumented) Missing documentation for "deleteIndex". -// src/engines/ElasticSearchClientWrapper.d.ts:80:5 - (ae-undocumented) Missing documentation for "getAliases". -// src/engines/ElasticSearchClientWrapper.d.ts:83:5 - (ae-undocumented) Missing documentation for "createIndex". -// src/engines/ElasticSearchClientWrapper.d.ts:86:5 - (ae-undocumented) Missing documentation for "updateAliases". -// src/engines/ElasticSearchSearchEngine.d.ts:44:1 - (ae-undocumented) Missing documentation for "ElasticSearchHighlightOptions". -// src/engines/ElasticSearchSearchEngine.d.ts:52:1 - (ae-undocumented) Missing documentation for "ElasticSearchHighlightConfig". -// src/engines/ElasticSearchSearchEngine.d.ts:62:1 - (ae-undocumented) Missing documentation for "ElasticSearchSearchEngine". -// src/engines/ElasticSearchSearchEngine.d.ts:71:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/engines/ElasticSearchSearchEngine.d.ts:93:5 - (ae-undocumented) Missing documentation for "translator". -// src/engines/ElasticSearchSearchEngine.d.ts:94:5 - (ae-undocumented) Missing documentation for "setTranslator". -// src/engines/ElasticSearchSearchEngine.d.ts:95:5 - (ae-undocumented) Missing documentation for "setIndexTemplate". -// src/engines/ElasticSearchSearchEngine.d.ts:96:5 - (ae-undocumented) Missing documentation for "getIndexer". -// src/engines/ElasticSearchSearchEngine.d.ts:97:5 - (ae-undocumented) Missing documentation for "query". -// src/engines/ElasticSearchSearchEngine.d.ts:107:1 - (ae-undocumented) Missing documentation for "decodePageCursor". -// src/engines/ElasticSearchSearchEngineIndexer.d.ts:28:5 - (ae-undocumented) Missing documentation for "indexName". -// src/engines/ElasticSearchSearchEngineIndexer.d.ts:39:5 - (ae-undocumented) Missing documentation for "initialize". -// src/engines/ElasticSearchSearchEngineIndexer.d.ts:40:5 - (ae-undocumented) Missing documentation for "index". -// src/engines/ElasticSearchSearchEngineIndexer.d.ts:41:5 - (ae-undocumented) Missing documentation for "finalize". -// src/module.d.ts:3:1 - (ae-undocumented) Missing documentation for "ElasticSearchQueryTranslatorExtensionPoint". -// src/module.d.ts:4:5 - (ae-undocumented) Missing documentation for "setTranslator". ``` diff --git a/plugins/search-backend-module-elasticsearch/src/alpha.ts b/plugins/search-backend-module-elasticsearch/src/alpha.ts index 22ff705cd2..e5554e85bd 100644 --- a/plugins/search-backend-module-elasticsearch/src/alpha.ts +++ b/plugins/search-backend-module-elasticsearch/src/alpha.ts @@ -14,17 +14,8 @@ * limitations under the License. */ -import { - default as feature, - ElasticSearchQueryTranslatorExtensionPoint as ExtensionPoint, - elasticsearchTranslatorExtensionPoint as extensionPoint, -} from './module'; +import { default as feature } from './module'; /** @alpha */ const _feature = feature; export default _feature; - -/** @alpha */ -export type ElasticSearchQueryTranslatorExtensionPoint = ExtensionPoint; -/** @alpha */ -export const elasticsearchTranslatorExtensionPoint = extensionPoint; diff --git a/plugins/search-backend-module-explore/report-alpha.api.md b/plugins/search-backend-module-explore/report-alpha.api.md index 0a383dc7d0..bcfdc6b14d 100644 --- a/plugins/search-backend-module-explore/report-alpha.api.md +++ b/plugins/search-backend-module-explore/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-explore/report.api.md b/plugins/search-backend-module-explore/report.api.md index b8ec1aa9c3..1b764129b2 100644 --- a/plugins/search-backend-module-explore/report.api.md +++ b/plugins/search-backend-module-explore/report.api.md @@ -45,12 +45,4 @@ export type ToolDocumentCollatorFactoryOptions = { tokenManager?: TokenManager; auth?: AuthService; }; - -// Warnings were encountered during analysis: -// -// src/collators/ToolDocumentCollatorFactory.d.ts:19:1 - (ae-undocumented) Missing documentation for "ToolDocumentCollatorFactoryOptions". -// src/collators/ToolDocumentCollatorFactory.d.ts:32:5 - (ae-undocumented) Missing documentation for "type". -// src/collators/ToolDocumentCollatorFactory.d.ts:37:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/collators/ToolDocumentCollatorFactory.d.ts:38:5 - (ae-undocumented) Missing documentation for "getCollator". -// src/collators/ToolDocumentCollatorFactory.d.ts:39:5 - (ae-undocumented) Missing documentation for "execute". ``` diff --git a/plugins/search-backend-module-pg/report-alpha.api.md b/plugins/search-backend-module-pg/report-alpha.api.md index c5d011b95f..ce87037e02 100644 --- a/plugins/search-backend-module-pg/report-alpha.api.md +++ b/plugins/search-backend-module-pg/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-pg/report.api.md b/plugins/search-backend-module-pg/report.api.md index 77e795321a..104821328c 100644 --- a/plugins/search-backend-module-pg/report.api.md +++ b/plugins/search-backend-module-pg/report.api.md @@ -193,51 +193,4 @@ export interface RawDocumentRow { // (undocumented) type: string; } - -// Warnings were encountered during analysis: -// -// src/PgSearchEngine/PgSearchEngine.d.ts:51:1 - (ae-undocumented) Missing documentation for "PgSearchEngine". -// src/PgSearchEngine/PgSearchEngine.d.ts:63:5 - (ae-undocumented) Missing documentation for "from". -// src/PgSearchEngine/PgSearchEngine.d.ts:68:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/PgSearchEngine/PgSearchEngine.d.ts:69:5 - (ae-undocumented) Missing documentation for "supported". -// src/PgSearchEngine/PgSearchEngine.d.ts:70:5 - (ae-undocumented) Missing documentation for "translator". -// src/PgSearchEngine/PgSearchEngine.d.ts:71:5 - (ae-undocumented) Missing documentation for "setTranslator". -// src/PgSearchEngine/PgSearchEngine.d.ts:72:5 - (ae-undocumented) Missing documentation for "getIndexer". -// src/PgSearchEngine/PgSearchEngine.d.ts:73:5 - (ae-undocumented) Missing documentation for "query". -// src/PgSearchEngine/PgSearchEngineIndexer.d.ts:6:1 - (ae-undocumented) Missing documentation for "PgSearchEngineIndexerOptions". -// src/PgSearchEngine/PgSearchEngineIndexer.d.ts:13:1 - (ae-undocumented) Missing documentation for "PgSearchEngineIndexer". -// src/PgSearchEngine/PgSearchEngineIndexer.d.ts:20:5 - (ae-undocumented) Missing documentation for "initialize". -// src/PgSearchEngine/PgSearchEngineIndexer.d.ts:21:5 - (ae-undocumented) Missing documentation for "index". -// src/PgSearchEngine/PgSearchEngineIndexer.d.ts:22:5 - (ae-undocumented) Missing documentation for "finalize". -// src/database/DatabaseDocumentStore.d.ts:6:1 - (ae-undocumented) Missing documentation for "DatabaseDocumentStore". -// src/database/DatabaseDocumentStore.d.ts:8:5 - (ae-undocumented) Missing documentation for "create". -// src/database/DatabaseDocumentStore.d.ts:9:5 - (ae-undocumented) Missing documentation for "supported". -// src/database/DatabaseDocumentStore.d.ts:11:5 - (ae-undocumented) Missing documentation for "transaction". -// src/database/DatabaseDocumentStore.d.ts:12:5 - (ae-undocumented) Missing documentation for "getTransaction". -// src/database/DatabaseDocumentStore.d.ts:13:5 - (ae-undocumented) Missing documentation for "prepareInsert". -// src/database/DatabaseDocumentStore.d.ts:14:5 - (ae-undocumented) Missing documentation for "completeInsert". -// src/database/DatabaseDocumentStore.d.ts:15:5 - (ae-undocumented) Missing documentation for "insertDocuments". -// src/database/DatabaseDocumentStore.d.ts:16:5 - (ae-undocumented) Missing documentation for "query". -// src/database/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "PgSearchQuery". -// src/database/types.d.ts:6:5 - (ae-undocumented) Missing documentation for "fields". -// src/database/types.d.ts:7:5 - (ae-undocumented) Missing documentation for "types". -// src/database/types.d.ts:8:5 - (ae-undocumented) Missing documentation for "pgTerm". -// src/database/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "offset". -// src/database/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "limit". -// src/database/types.d.ts:11:5 - (ae-undocumented) Missing documentation for "options". -// src/database/types.d.ts:14:1 - (ae-undocumented) Missing documentation for "DatabaseStore". -// src/database/types.d.ts:15:5 - (ae-undocumented) Missing documentation for "transaction". -// src/database/types.d.ts:16:5 - (ae-undocumented) Missing documentation for "getTransaction". -// src/database/types.d.ts:17:5 - (ae-undocumented) Missing documentation for "prepareInsert". -// src/database/types.d.ts:18:5 - (ae-undocumented) Missing documentation for "insertDocuments". -// src/database/types.d.ts:19:5 - (ae-undocumented) Missing documentation for "completeInsert". -// src/database/types.d.ts:20:5 - (ae-undocumented) Missing documentation for "query". -// src/database/types.d.ts:23:1 - (ae-undocumented) Missing documentation for "RawDocumentRow". -// src/database/types.d.ts:24:5 - (ae-undocumented) Missing documentation for "document". -// src/database/types.d.ts:25:5 - (ae-undocumented) Missing documentation for "type". -// src/database/types.d.ts:26:5 - (ae-undocumented) Missing documentation for "hash". -// src/database/types.d.ts:29:1 - (ae-undocumented) Missing documentation for "DocumentResultRow". -// src/database/types.d.ts:30:5 - (ae-undocumented) Missing documentation for "document". -// src/database/types.d.ts:31:5 - (ae-undocumented) Missing documentation for "type". -// src/database/types.d.ts:32:5 - (ae-undocumented) Missing documentation for "highlight". ``` diff --git a/plugins/search-backend-module-stack-overflow-collator/report.api.md b/plugins/search-backend-module-stack-overflow-collator/report.api.md index aeb7bd03ea..3b9b79c597 100644 --- a/plugins/search-backend-module-stack-overflow-collator/report.api.md +++ b/plugins/search-backend-module-stack-overflow-collator/report.api.md @@ -58,14 +58,4 @@ export type StackOverflowQuestionsCollatorFactoryOptions = { export type StackOverflowQuestionsRequestParams = { [key: string]: string | string[] | number; }; - -// Warnings were encountered during analysis: -// -// src/collators/StackOverflowQuestionsCollatorFactory.d.ts:12:5 - (ae-undocumented) Missing documentation for "answers". -// src/collators/StackOverflowQuestionsCollatorFactory.d.ts:13:5 - (ae-undocumented) Missing documentation for "tags". -// src/collators/StackOverflowQuestionsCollatorFactory.d.ts:43:5 - (ae-undocumented) Missing documentation for "requestParams". -// src/collators/StackOverflowQuestionsCollatorFactory.d.ts:50:5 - (ae-undocumented) Missing documentation for "type". -// src/collators/StackOverflowQuestionsCollatorFactory.d.ts:52:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/collators/StackOverflowQuestionsCollatorFactory.d.ts:53:5 - (ae-undocumented) Missing documentation for "getCollator". -// src/collators/StackOverflowQuestionsCollatorFactory.d.ts:54:5 - (ae-undocumented) Missing documentation for "execute". ``` diff --git a/plugins/search-backend-module-techdocs/report-alpha.api.md b/plugins/search-backend-module-techdocs/report-alpha.api.md index 678f9a679d..6a68382919 100644 --- a/plugins/search-backend-module-techdocs/report-alpha.api.md +++ b/plugins/search-backend-module-techdocs/report-alpha.api.md @@ -4,28 +4,10 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -import { ExtensionPoint } from '@backstage/backend-plugin-api'; -import { TechDocsCollatorDocumentTransformer } from '@backstage/plugin-search-backend-module-techdocs'; -import { TechDocsCollatorEntityTransformer } from '@backstage/plugin-search-backend-module-techdocs'; // @alpha (undocumented) const _feature: BackendFeature; export default _feature; -// Warning: (ae-forgotten-export) The symbol "TechDocsCollatorEntityTransformerExtensionPoint_2" needs to be exported by the entry point alpha.d.ts -// -// @alpha (undocumented) -export type TechDocsCollatorEntityTransformerExtensionPoint = - TechDocsCollatorEntityTransformerExtensionPoint_2; - -// @alpha (undocumented) -export const techdocsCollatorEntityTransformerExtensionPoint: ExtensionPoint; - -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:15 - (ae-undocumented) Missing documentation for "_feature". -// src/alpha.d.ts:6:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorEntityTransformerExtensionPoint". -// src/alpha.d.ts:8:22 - (ae-undocumented) Missing documentation for "techdocsCollatorEntityTransformerExtensionPoint". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-module-techdocs/report.api.md b/plugins/search-backend-module-techdocs/report.api.md index 9f03812e44..ef041e6900 100644 --- a/plugins/search-backend-module-techdocs/report.api.md +++ b/plugins/search-backend-module-techdocs/report.api.md @@ -104,22 +104,4 @@ export type TechDocsCollatorFactoryOptions = { entityTransformer?: TechDocsCollatorEntityTransformer; documentTransformer?: TechDocsCollatorDocumentTransformer; }; - -// Warnings were encountered during analysis: -// -// src/collators/DefaultTechDocsCollatorFactory.d.ts:38:5 - (ae-undocumented) Missing documentation for "type". -// src/collators/DefaultTechDocsCollatorFactory.d.ts:39:5 - (ae-undocumented) Missing documentation for "visibilityPermission". -// src/collators/DefaultTechDocsCollatorFactory.d.ts:50:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/collators/DefaultTechDocsCollatorFactory.d.ts:51:5 - (ae-undocumented) Missing documentation for "getCollator". -// src/collators/TechDocsCollatorDocumentTransformer.d.ts:3:1 - (ae-undocumented) Missing documentation for "MkSearchIndexDoc". -// src/collators/TechDocsCollatorDocumentTransformer.d.ts:4:5 - (ae-undocumented) Missing documentation for "title". -// src/collators/TechDocsCollatorDocumentTransformer.d.ts:5:5 - (ae-undocumented) Missing documentation for "text". -// src/collators/TechDocsCollatorDocumentTransformer.d.ts:6:5 - (ae-undocumented) Missing documentation for "location". -// src/collators/TechDocsCollatorDocumentTransformer.d.ts:7:5 - (ae-undocumented) Missing documentation for "tags". -// src/collators/TechDocsCollatorDocumentTransformer.d.ts:10:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorDocumentTransformer". -// src/collators/TechDocsCollatorEntityTransformer.d.ts:4:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorEntityTransformer". -// src/collators/defaultTechDocsCollatorEntityTransformer.d.ts:3:22 - (ae-undocumented) Missing documentation for "defaultTechDocsCollatorEntityTransformer". -// src/module.d.ts:3:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorEntityTransformerExtensionPoint". -// src/module.d.ts:4:5 - (ae-undocumented) Missing documentation for "setTransformer". -// src/module.d.ts:5:5 - (ae-undocumented) Missing documentation for "setDocumentTransformer". ``` diff --git a/plugins/search-backend-module-techdocs/src/alpha.ts b/plugins/search-backend-module-techdocs/src/alpha.ts index ecd56a9af1..e5554e85bd 100644 --- a/plugins/search-backend-module-techdocs/src/alpha.ts +++ b/plugins/search-backend-module-techdocs/src/alpha.ts @@ -14,17 +14,8 @@ * limitations under the License. */ -import { - default as feature, - TechDocsCollatorEntityTransformerExtensionPoint as ExtensionPoint, - techdocsCollatorEntityTransformerExtensionPoint as extensionPoint, -} from './module'; +import { default as feature } from './module'; /** @alpha */ const _feature = feature; export default _feature; - -/** @alpha */ -export type TechDocsCollatorEntityTransformerExtensionPoint = ExtensionPoint; -/** @alpha */ -export const techdocsCollatorEntityTransformerExtensionPoint = extensionPoint; diff --git a/plugins/search-backend-node/report-alpha.api.md b/plugins/search-backend-node/report-alpha.api.md index 5c5503db13..e1d5bd024d 100644 --- a/plugins/search-backend-node/report-alpha.api.md +++ b/plugins/search-backend-node/report-alpha.api.md @@ -52,11 +52,5 @@ export const searchIndexServiceRef: ServiceRef< 'singleton' >; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:39:5 - (ae-undocumented) Missing documentation for "addCollator". -// src/alpha.d.ts:40:5 - (ae-undocumented) Missing documentation for "addDecorator". -// src/alpha.d.ts:47:5 - (ae-undocumented) Missing documentation for "setSearchEngine". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend-node/report.api.md b/plugins/search-backend-node/report.api.md index 2086e3a351..4e769d0eae 100644 --- a/plugins/search-backend-node/report.api.md +++ b/plugins/search-backend-node/report.api.md @@ -210,24 +210,4 @@ export type TestPipelineResult = { error: unknown; documents: IndexableDocument[]; }; - -// Warnings were encountered during analysis: -// -// src/collators/NewlineDelimitedJsonCollatorFactory.d.ts:51:5 - (ae-undocumented) Missing documentation for "type". -// src/collators/NewlineDelimitedJsonCollatorFactory.d.ts:52:5 - (ae-undocumented) Missing documentation for "visibilityPermission". -// src/collators/NewlineDelimitedJsonCollatorFactory.d.ts:64:5 - (ae-undocumented) Missing documentation for "getCollator". -// src/engines/LunrSearchEngine.d.ts:25:5 - (ae-undocumented) Missing documentation for "lunrIndices". -// src/engines/LunrSearchEngine.d.ts:26:5 - (ae-undocumented) Missing documentation for "docStore". -// src/engines/LunrSearchEngine.d.ts:27:5 - (ae-undocumented) Missing documentation for "logger". -// src/engines/LunrSearchEngine.d.ts:28:5 - (ae-undocumented) Missing documentation for "highlightPreTag". -// src/engines/LunrSearchEngine.d.ts:29:5 - (ae-undocumented) Missing documentation for "highlightPostTag". -// src/engines/LunrSearchEngine.d.ts:33:5 - (ae-undocumented) Missing documentation for "translator". -// src/engines/LunrSearchEngine.d.ts:34:5 - (ae-undocumented) Missing documentation for "setTranslator". -// src/engines/LunrSearchEngine.d.ts:35:5 - (ae-undocumented) Missing documentation for "getIndexer". -// src/engines/LunrSearchEngine.d.ts:36:5 - (ae-undocumented) Missing documentation for "query". -// src/engines/LunrSearchEngineIndexer.d.ts:13:5 - (ae-undocumented) Missing documentation for "initialize". -// src/engines/LunrSearchEngineIndexer.d.ts:14:5 - (ae-undocumented) Missing documentation for "finalize". -// src/engines/LunrSearchEngineIndexer.d.ts:15:5 - (ae-undocumented) Missing documentation for "index". -// src/engines/LunrSearchEngineIndexer.d.ts:16:5 - (ae-undocumented) Missing documentation for "buildIndex". -// src/engines/LunrSearchEngineIndexer.d.ts:17:5 - (ae-undocumented) Missing documentation for "getDocumentStore". ``` diff --git a/plugins/search-backend/report-alpha.api.md b/plugins/search-backend/report-alpha.api.md index 9cae91f291..ec826f4ad2 100644 --- a/plugins/search-backend/report-alpha.api.md +++ b/plugins/search-backend/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-backend/report.api.md b/plugins/search-backend/report.api.md index e1cf271dc9..a866fca174 100644 --- a/plugins/search-backend/report.api.md +++ b/plugins/search-backend/report.api.md @@ -33,9 +33,4 @@ export type RouterOptions = { auth?: AuthService; httpAuth?: HttpAuthService; }; - -// Warnings were encountered during analysis: -// -// src/service/router.d.ts:11:1 - (ae-undocumented) Missing documentation for "RouterOptions". -// src/service/router.d.ts:25:1 - (ae-undocumented) Missing documentation for "createRouter". ``` diff --git a/plugins/search-common/report.api.md b/plugins/search-common/report.api.md index 8cda7b0168..497defc46d 100644 --- a/plugins/search-common/report.api.md +++ b/plugins/search-common/report.api.md @@ -116,24 +116,4 @@ export type SearchResult = Result; // @public (undocumented) export type SearchResultSet = ResultSet; - -// Warnings were encountered during analysis: -// -// src/types.d.ts:8:1 - (ae-undocumented) Missing documentation for "SearchQuery". -// src/types.d.ts:9:5 - (ae-undocumented) Missing documentation for "term". -// src/types.d.ts:10:5 - (ae-undocumented) Missing documentation for "types". -// src/types.d.ts:11:5 - (ae-undocumented) Missing documentation for "filters". -// src/types.d.ts:12:5 - (ae-undocumented) Missing documentation for "pageLimit". -// src/types.d.ts:13:5 - (ae-undocumented) Missing documentation for "pageCursor". -// src/types.d.ts:30:5 - (ae-undocumented) Missing documentation for "fields". -// src/types.d.ts:41:1 - (ae-undocumented) Missing documentation for "Result". -// src/types.d.ts:64:1 - (ae-undocumented) Missing documentation for "ResultSet". -// src/types.d.ts:65:5 - (ae-undocumented) Missing documentation for "results". -// src/types.d.ts:66:5 - (ae-undocumented) Missing documentation for "nextPageCursor". -// src/types.d.ts:67:5 - (ae-undocumented) Missing documentation for "previousPageCursor". -// src/types.d.ts:68:5 - (ae-undocumented) Missing documentation for "numberOfResults". -// src/types.d.ts:73:1 - (ae-undocumented) Missing documentation for "SearchResult". -// src/types.d.ts:77:1 - (ae-undocumented) Missing documentation for "SearchResultSet". -// src/types.d.ts:81:1 - (ae-undocumented) Missing documentation for "IndexableResult". -// src/types.d.ts:85:1 - (ae-undocumented) Missing documentation for "IndexableResultSet". ``` diff --git a/plugins/search-react/report-alpha.api.md b/plugins/search-react/report-alpha.api.md index 2397995355..e49b0bbeee 100644 --- a/plugins/search-react/report-alpha.api.md +++ b/plugins/search-react/report-alpha.api.md @@ -71,12 +71,5 @@ export interface SearchResultListItemBlueprintParams { predicate?: SearchResultItemExtensionPredicate; } -// Warnings were encountered during analysis: -// -// src/alpha/blueprints/SearchResultListItemBlueprint.d.ts:3:1 - (ae-undocumented) Missing documentation for "SearchResultListItemBlueprintParams". -// src/alpha/blueprints/types.d.ts:5:1 - (ae-undocumented) Missing documentation for "BaseSearchResultListItemProps". -// src/alpha/blueprints/types.d.ts:10:1 - (ae-undocumented) Missing documentation for "SearchResultItemExtensionComponent". -// src/alpha/blueprints/types.d.ts:12:1 - (ae-undocumented) Missing documentation for "SearchResultItemExtensionPredicate". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search-react/report.api.md b/plugins/search-react/report.api.md index e0698da6e2..3efed073d8 100644 --- a/plugins/search-react/report.api.md +++ b/plugins/search-react/report.api.md @@ -483,25 +483,4 @@ export const useSearchContextCheck: () => boolean; export const useSearchResultListItemExtensions: ( children: ReactNode, ) => (result: SearchResult_2, key?: number) => React_2.JSX.Element; - -// Warnings were encountered during analysis: -// -// src/api.d.ts:5:22 - (ae-undocumented) Missing documentation for "searchApiRef". -// src/api.d.ts:9:1 - (ae-undocumented) Missing documentation for "SearchApi". -// src/api.d.ts:10:5 - (ae-undocumented) Missing documentation for "query". -// src/api.d.ts:18:5 - (ae-undocumented) Missing documentation for "mockedResults". -// src/api.d.ts:20:5 - (ae-undocumented) Missing documentation for "query". -// src/components/DefaultResultListItem/DefaultResultListItem.d.ts:26:15 - (ae-undocumented) Missing documentation for "HigherOrderDefaultResultListItem". -// src/components/HighlightedSearchResultText/HighlightedSearchResultText.d.ts:3:1 - (ae-undocumented) Missing documentation for "HighlightedSearchResultTextClassKey". -// src/components/HighlightedSearchResultText/HighlightedSearchResultText.d.ts:17:22 - (ae-undocumented) Missing documentation for "HighlightedSearchResultText". -// src/components/SearchFilter/SearchFilter.Autocomplete.d.ts:6:1 - (ae-undocumented) Missing documentation for "SearchAutocompleteFilterProps". -// src/components/SearchFilter/SearchFilter.Autocomplete.d.ts:14:22 - (ae-undocumented) Missing documentation for "AutocompleteFilter". -// src/components/SearchFilter/SearchFilter.d.ts:6:1 - (ae-undocumented) Missing documentation for "SearchFilterComponentProps". -// src/components/SearchFilter/SearchFilter.d.ts:27:1 - (ae-undocumented) Missing documentation for "SearchFilterWrapperProps". -// src/components/SearchFilter/SearchFilter.d.ts:34:22 - (ae-undocumented) Missing documentation for "CheckboxFilter". -// src/components/SearchFilter/SearchFilter.d.ts:38:22 - (ae-undocumented) Missing documentation for "SelectFilter". -// src/components/SearchFilter/SearchFilter.d.ts:42:15 - (ae-undocumented) Missing documentation for "SearchFilter". -// src/components/SearchResultPager/SearchResultPager.d.ts:5:22 - (ae-undocumented) Missing documentation for "SearchResultPager". -// src/context/SearchContext.d.ts:9:1 - (ae-undocumented) Missing documentation for "SearchContextValue". -// src/context/SearchContext.d.ts:23:1 - (ae-undocumented) Missing documentation for "SearchContextState". ``` diff --git a/plugins/search/report-alpha.api.md b/plugins/search/report-alpha.api.md index 1d9bd7a6f6..9b8f21fa43 100644 --- a/plugins/search/report-alpha.api.md +++ b/plugins/search/report-alpha.api.md @@ -194,12 +194,5 @@ export const searchPage: ExtensionDefinition<{ }; }>; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:22 - (ae-undocumented) Missing documentation for "searchApi". -// src/alpha.d.ts:15:22 - (ae-undocumented) Missing documentation for "searchPage". -// src/alpha.d.ts:47:22 - (ae-undocumented) Missing documentation for "searchNavItem". -// src/alpha.d.ts:65:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/search/report.api.md b/plugins/search/report.api.md index 7bb1dca05e..a47c11b194 100644 --- a/plugins/search/report.api.md +++ b/plugins/search/report.api.md @@ -140,19 +140,4 @@ export type SidebarSearchProps = { // @public export function useSearchModal(initialState?: boolean): SearchModalValue; - -// Warnings were encountered during analysis: -// -// src/components/SearchModal/SearchModal.d.ts:6:1 - (ae-undocumented) Missing documentation for "SearchModalChildrenProps". -// src/components/SearchModal/SearchModal.d.ts:19:1 - (ae-undocumented) Missing documentation for "SearchModalProps". -// src/components/SearchModal/SearchModal.d.ts:50:22 - (ae-undocumented) Missing documentation for "SearchModal". -// src/components/SearchPage/SearchPage.d.ts:6:22 - (ae-undocumented) Missing documentation for "SearchPage". -// src/components/SearchType/SearchType.Accordion.d.ts:5:1 - (ae-undocumented) Missing documentation for "SearchTypeAccordionProps". -// src/components/SearchType/SearchType.Tabs.d.ts:5:1 - (ae-undocumented) Missing documentation for "SearchTypeTabsProps". -// src/components/SearchType/SearchType.d.ts:18:15 - (ae-undocumented) Missing documentation for "SearchType". -// src/components/SidebarSearch/SidebarSearch.d.ts:14:22 - (ae-undocumented) Missing documentation for "SidebarSearch". -// src/plugin.d.ts:7:22 - (ae-undocumented) Missing documentation for "searchPlugin". -// src/plugin.d.ts:13:22 - (ae-undocumented) Missing documentation for "SearchPage". -// src/plugin.d.ts:17:22 - (ae-undocumented) Missing documentation for "SidebarSearchModal". -// src/plugin.d.ts:21:22 - (ae-undocumented) Missing documentation for "HomePageSearchBar". ``` diff --git a/plugins/signals-backend/report.api.md b/plugins/signals-backend/report.api.md index df68dcd62b..10f74ba37e 100644 --- a/plugins/signals-backend/report.api.md +++ b/plugins/signals-backend/report.api.md @@ -41,18 +41,5 @@ export interface RouterOptions { const signalsPlugin: BackendFeature; export default signalsPlugin; -// Warnings were encountered during analysis: -// -// src/deprecated.d.ts:10:1 - (ae-undocumented) Missing documentation for "RouterOptions". -// src/deprecated.d.ts:11:5 - (ae-undocumented) Missing documentation for "logger". -// src/deprecated.d.ts:12:5 - (ae-undocumented) Missing documentation for "events". -// src/deprecated.d.ts:13:5 - (ae-undocumented) Missing documentation for "identity". -// src/deprecated.d.ts:14:5 - (ae-undocumented) Missing documentation for "discovery". -// src/deprecated.d.ts:15:5 - (ae-undocumented) Missing documentation for "config". -// src/deprecated.d.ts:16:5 - (ae-undocumented) Missing documentation for "lifecycle". -// src/deprecated.d.ts:17:5 - (ae-undocumented) Missing documentation for "auth". -// src/deprecated.d.ts:18:5 - (ae-undocumented) Missing documentation for "userInfo". -// src/deprecated.d.ts:24:1 - (ae-undocumented) Missing documentation for "createRouter". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/signals-node/report.api.md b/plugins/signals-node/report.api.md index 97f06a8ede..a368dd2ece 100644 --- a/plugins/signals-node/report.api.md +++ b/plugins/signals-node/report.api.md @@ -58,17 +58,5 @@ export const signalsServiceRef: ServiceRef< 'singleton' >; -// Warnings were encountered during analysis: -// -// src/DefaultSignalsService.d.ts:5:1 - (ae-undocumented) Missing documentation for "DefaultSignalsService". -// src/DefaultSignalsService.d.ts:7:5 - (ae-undocumented) Missing documentation for "create". -// src/DefaultSignalsService.d.ts:19:22 - (ae-undocumented) Missing documentation for "DefaultSignalService". -// src/SignalsService.d.ts:4:1 - (ae-undocumented) Missing documentation for "SignalsService". -// src/SignalsService.d.ts:15:1 - (ae-undocumented) Missing documentation for "SignalService". -// src/lib.d.ts:3:22 - (ae-undocumented) Missing documentation for "signalsServiceRef". -// src/lib.d.ts:8:22 - (ae-undocumented) Missing documentation for "signalService". -// src/types.d.ts:6:1 - (ae-undocumented) Missing documentation for "SignalsServiceOptions". -// src/types.d.ts:10:1 - (ae-undocumented) Missing documentation for "SignalPayload". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/signals-react/report.api.md b/plugins/signals-react/report.api.md index f17f53366a..87d856288b 100644 --- a/plugins/signals-react/report.api.md +++ b/plugins/signals-react/report.api.md @@ -32,14 +32,5 @@ export const useSignal: ( isSignalsAvailable: boolean; }; -// Warnings were encountered during analysis: -// -// src/api/SignalApi.d.ts:3:22 - (ae-undocumented) Missing documentation for "signalApiRef". -// src/api/SignalApi.d.ts:5:1 - (ae-undocumented) Missing documentation for "SignalSubscriber". -// src/api/SignalApi.d.ts:6:5 - (ae-undocumented) Missing documentation for "unsubscribe". -// src/api/SignalApi.d.ts:9:1 - (ae-undocumented) Missing documentation for "SignalApi". -// src/api/SignalApi.d.ts:10:5 - (ae-undocumented) Missing documentation for "subscribe". -// src/hooks/useSignal.d.ts:3:22 - (ae-undocumented) Missing documentation for "useSignal". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/signals/report.api.md b/plugins/signals/report.api.md index 049f50b2f2..ca7695aeec 100644 --- a/plugins/signals/report.api.md +++ b/plugins/signals/report.api.md @@ -36,15 +36,5 @@ export const SignalsDisplay: () => null; // @public (undocumented) export const signalsPlugin: BackstagePlugin<{}, {}>; -// Warnings were encountered during analysis: -// -// src/api/SignalClient.d.ts:5:1 - (ae-undocumented) Missing documentation for "SignalClient". -// src/api/SignalClient.d.ts:10:5 - (ae-undocumented) Missing documentation for "DEFAULT_CONNECT_TIMEOUT_MS". -// src/api/SignalClient.d.ts:11:5 - (ae-undocumented) Missing documentation for "DEFAULT_RECONNECT_TIMEOUT_MS". -// src/api/SignalClient.d.ts:16:5 - (ae-undocumented) Missing documentation for "create". -// src/api/SignalClient.d.ts:23:5 - (ae-undocumented) Missing documentation for "subscribe". -// src/plugin.d.ts:2:22 - (ae-undocumented) Missing documentation for "signalsPlugin". -// src/plugin.d.ts:4:22 - (ae-undocumented) Missing documentation for "SignalsDisplay". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/techdocs-backend/report-alpha.api.md b/plugins/techdocs-backend/report-alpha.api.md index d97dc13982..20512c41b9 100644 --- a/plugins/techdocs-backend/report-alpha.api.md +++ b/plugins/techdocs-backend/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/techdocs-backend/report.api.md b/plugins/techdocs-backend/report.api.md index 569df8ee7c..b03a220c4d 100644 --- a/plugins/techdocs-backend/report.api.md +++ b/plugins/techdocs-backend/report.api.md @@ -117,17 +117,4 @@ const techdocsPlugin: BackendFeature; export default techdocsPlugin; export * from '@backstage/plugin-techdocs-node'; - -// Warnings were encountered during analysis: -// -// src/index.d.ts:17:1 - (ae-undocumented) Missing documentation for "DocsBuildStrategy". -// src/index.d.ts:22:1 - (ae-undocumented) Missing documentation for "ShouldBuildParameters". -// src/index.d.ts:29:1 - (ae-undocumented) Missing documentation for "TechDocsDocument". -// src/search/DefaultTechDocsCollator.d.ts:32:5 - (ae-undocumented) Missing documentation for "type". -// src/search/DefaultTechDocsCollator.d.ts:33:5 - (ae-undocumented) Missing documentation for "visibilityPermission". -// src/search/DefaultTechDocsCollator.d.ts:35:5 - (ae-undocumented) Missing documentation for "fromConfig". -// src/search/DefaultTechDocsCollator.d.ts:36:5 - (ae-undocumented) Missing documentation for "execute". -// src/search/DefaultTechDocsCollator.d.ts:37:5 - (ae-undocumented) Missing documentation for "applyArgsToFormat". -// src/search/index.d.ts:12:1 - (ae-undocumented) Missing documentation for "TechDocsCollatorFactoryOptions". -// src/search/index.d.ts:17:22 - (ae-undocumented) Missing documentation for "DefaultTechDocsCollatorFactory". ``` diff --git a/plugins/techdocs-common/report.api.md b/plugins/techdocs-common/report.api.md index 1b0ee6797a..c7e1829a28 100644 --- a/plugins/techdocs-common/report.api.md +++ b/plugins/techdocs-common/report.api.md @@ -8,9 +8,4 @@ export const TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref'; // @public (undocumented) export const TECHDOCS_EXTERNAL_ANNOTATION = 'backstage.io/techdocs-entity'; - -// Warnings were encountered during analysis: -// -// src/constants.d.ts:2:22 - (ae-undocumented) Missing documentation for "TECHDOCS_ANNOTATION". -// src/constants.d.ts:4:22 - (ae-undocumented) Missing documentation for "TECHDOCS_EXTERNAL_ANNOTATION". ``` diff --git a/plugins/techdocs-node/report.api.md b/plugins/techdocs-node/report.api.md index 1bd93d1b57..c6f626dca8 100644 --- a/plugins/techdocs-node/report.api.md +++ b/plugins/techdocs-node/report.api.md @@ -378,18 +378,4 @@ export class UrlPreparer implements PreparerBase { prepare(entity: Entity, options?: PreparerOptions): Promise; shouldCleanPreparedDirectory(): boolean; } - -// Warnings were encountered during analysis: -// -// src/extensions.d.ts:11:5 - (ae-undocumented) Missing documentation for "setBuildStrategy". -// src/extensions.d.ts:12:5 - (ae-undocumented) Missing documentation for "setBuildLogTransport". -// src/extensions.d.ts:26:5 - (ae-undocumented) Missing documentation for "setTechdocsGenerator". -// src/extensions.d.ts:40:5 - (ae-undocumented) Missing documentation for "registerPreparer". -// src/extensions.d.ts:54:5 - (ae-undocumented) Missing documentation for "registerPublisher". -// src/extensions.d.ts:55:5 - (ae-undocumented) Missing documentation for "registerPublisherSettings". -// src/stages/generate/index.d.ts:10:22 - (ae-undocumented) Missing documentation for "getMkDocsYml". -// src/stages/publish/publish.d.ts:10:5 - (ae-undocumented) Missing documentation for "register". -// src/stages/publish/publish.d.ts:11:5 - (ae-undocumented) Missing documentation for "get". -// src/stages/publish/types.d.ts:21:5 - (ae-undocumented) Missing documentation for "googleGcs". -// src/techdocsTypes.d.ts:39:5 - (ae-undocumented) Missing documentation for "shouldBuild". ``` diff --git a/plugins/techdocs-react/report.api.md b/plugins/techdocs-react/report.api.md index 73f122068e..c158bbd81e 100644 --- a/plugins/techdocs-react/report.api.md +++ b/plugins/techdocs-react/report.api.md @@ -192,17 +192,4 @@ export const useTechDocsAddons: () => { // @public export const useTechDocsReaderPage: () => TechDocsReaderPageValue; - -// Warnings were encountered during analysis: -// -// src/api.d.ts:9:5 - (ae-undocumented) Missing documentation for "getCookie". -// src/api.d.ts:12:5 - (ae-undocumented) Missing documentation for "getApiOrigin". -// src/api.d.ts:13:5 - (ae-undocumented) Missing documentation for "getTechDocsMetadata". -// src/api.d.ts:14:5 - (ae-undocumented) Missing documentation for "getEntityMetadata". -// src/api.d.ts:34:5 - (ae-undocumented) Missing documentation for "getApiOrigin". -// src/api.d.ts:35:5 - (ae-undocumented) Missing documentation for "getStorageUrl". -// src/api.d.ts:36:5 - (ae-undocumented) Missing documentation for "getBuilder". -// src/api.d.ts:37:5 - (ae-undocumented) Missing documentation for "getEntityDocs". -// src/api.d.ts:38:5 - (ae-undocumented) Missing documentation for "syncEntityDocs". -// src/api.d.ts:39:5 - (ae-undocumented) Missing documentation for "getBaseUrl". ``` diff --git a/plugins/techdocs/report-alpha.api.md b/plugins/techdocs/report-alpha.api.md index faaf6d6a83..63e078dd43 100644 --- a/plugins/techdocs/report-alpha.api.md +++ b/plugins/techdocs/report-alpha.api.md @@ -316,10 +316,5 @@ export const techDocsSearchResultListItemExtension: ExtensionDefinition<{ params: SearchResultListItemBlueprintParams; }>; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:3:22 - (ae-undocumented) Missing documentation for "techDocsSearchResultListItemExtension". -// src/alpha.d.ts:35:15 - (ae-undocumented) Missing documentation for "_default". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/techdocs/report.api.md b/plugins/techdocs/report.api.md index 3ecf2cf7d2..c58a946287 100644 --- a/plugins/techdocs/report.api.md +++ b/plugins/techdocs/report.api.md @@ -506,36 +506,4 @@ export class TechDocsStorageClient implements TechDocsStorageApi_2 { logHandler?: (line: string) => void, ): Promise; } - -// Warnings were encountered during analysis: -// -// src/api.d.ts:31:5 - (ae-undocumented) Missing documentation for "getApiOrigin". -// src/api.d.ts:32:5 - (ae-undocumented) Missing documentation for "getStorageUrl". -// src/api.d.ts:33:5 - (ae-undocumented) Missing documentation for "getBuilder". -// src/api.d.ts:34:5 - (ae-undocumented) Missing documentation for "getEntityDocs". -// src/api.d.ts:35:5 - (ae-undocumented) Missing documentation for "syncEntityDocs". -// src/api.d.ts:36:5 - (ae-undocumented) Missing documentation for "getBaseUrl". -// src/api.d.ts:45:5 - (ae-undocumented) Missing documentation for "getApiOrigin". -// src/api.d.ts:46:5 - (ae-undocumented) Missing documentation for "getTechDocsMetadata". -// src/api.d.ts:47:5 - (ae-undocumented) Missing documentation for "getEntityMetadata". -// src/client.d.ts:11:5 - (ae-undocumented) Missing documentation for "configApi". -// src/client.d.ts:12:5 - (ae-undocumented) Missing documentation for "discoveryApi". -// src/client.d.ts:19:5 - (ae-undocumented) Missing documentation for "getCookie". -// src/client.d.ts:22:5 - (ae-undocumented) Missing documentation for "getApiOrigin". -// src/client.d.ts:49:5 - (ae-undocumented) Missing documentation for "configApi". -// src/client.d.ts:50:5 - (ae-undocumented) Missing documentation for "discoveryApi". -// src/client.d.ts:59:5 - (ae-undocumented) Missing documentation for "getApiOrigin". -// src/client.d.ts:60:5 - (ae-undocumented) Missing documentation for "getStorageUrl". -// src/client.d.ts:61:5 - (ae-undocumented) Missing documentation for "getBuilder". -// src/client.d.ts:80:5 - (ae-undocumented) Missing documentation for "getBaseUrl". -// src/home/components/TechDocsCustomHome.d.ts:16:5 - (ae-undocumented) Missing documentation for "title". -// src/home/components/TechDocsCustomHome.d.ts:17:5 - (ae-undocumented) Missing documentation for "description". -// src/home/components/TechDocsCustomHome.d.ts:18:5 - (ae-undocumented) Missing documentation for "panelType". -// src/home/components/TechDocsCustomHome.d.ts:19:5 - (ae-undocumented) Missing documentation for "panelCSS". -// src/home/components/TechDocsCustomHome.d.ts:20:5 - (ae-undocumented) Missing documentation for "filterPredicate". -// src/home/components/TechDocsCustomHome.d.ts:28:5 - (ae-undocumented) Missing documentation for "label". -// src/home/components/TechDocsCustomHome.d.ts:29:5 - (ae-undocumented) Missing documentation for "panels". -// src/index.d.ts:21:1 - (ae-undocumented) Missing documentation for "DeprecatedTechDocsMetadata". -// src/index.d.ts:27:1 - (ae-undocumented) Missing documentation for "DeprecatedTechDocsEntityMetadata". -// src/reader/components/TechDocsReaderPage/TechDocsReaderPage.d.ts:27:1 - (ae-undocumented) Missing documentation for "TechDocsReaderPageProps". ``` diff --git a/plugins/user-settings-backend/report-alpha.api.md b/plugins/user-settings-backend/report-alpha.api.md index 02c93f9aee..8ed6505934 100644 --- a/plugins/user-settings-backend/report-alpha.api.md +++ b/plugins/user-settings-backend/report-alpha.api.md @@ -9,9 +9,5 @@ import { BackendFeature } from '@backstage/backend-plugin-api'; const _feature: BackendFeature; export default _feature; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:2:15 - (ae-undocumented) Missing documentation for "_feature". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/user-settings-common/report.api.md b/plugins/user-settings-common/report.api.md index a984f71e47..b69f4a4190 100644 --- a/plugins/user-settings-common/report.api.md +++ b/plugins/user-settings-common/report.api.md @@ -9,9 +9,5 @@ export type UserSettingsSignal = { key: string; }; -// Warnings were encountered during analysis: -// -// src/types.d.ts:2:1 - (ae-undocumented) Missing documentation for "UserSettingsSignal". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/user-settings/report-alpha.api.md b/plugins/user-settings/report-alpha.api.md index d9dad32623..63db1defe0 100644 --- a/plugins/user-settings/report-alpha.api.md +++ b/plugins/user-settings/report-alpha.api.md @@ -127,11 +127,5 @@ export const userSettingsTranslationRef: TranslationRef< } >; -// Warnings were encountered during analysis: -// -// src/alpha.d.ts:4:22 - (ae-undocumented) Missing documentation for "settingsNavItem". -// src/alpha.d.ts:24:15 - (ae-undocumented) Missing documentation for "_default". -// src/translation.d.ts:2:22 - (ae-undocumented) Missing documentation for "userSettingsTranslationRef". - // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/user-settings/report.api.md b/plugins/user-settings/report.api.md index 6169668adc..cee35724bb 100644 --- a/plugins/user-settings/report.api.md +++ b/plugins/user-settings/report.api.md @@ -179,36 +179,4 @@ export const useUserProfile: () => displayName: string; loading: false; }; - -// Warnings were encountered during analysis: -// -// src/apis/StorageApi/UserSettingsStorage.d.ts:21:5 - (ae-undocumented) Missing documentation for "create". -// src/apis/StorageApi/UserSettingsStorage.d.ts:29:5 - (ae-undocumented) Missing documentation for "forBucket". -// src/apis/StorageApi/UserSettingsStorage.d.ts:30:5 - (ae-undocumented) Missing documentation for "remove". -// src/apis/StorageApi/UserSettingsStorage.d.ts:31:5 - (ae-undocumented) Missing documentation for "set". -// src/apis/StorageApi/UserSettingsStorage.d.ts:32:5 - (ae-undocumented) Missing documentation for "observe$". -// src/apis/StorageApi/UserSettingsStorage.d.ts:33:5 - (ae-undocumented) Missing documentation for "snapshot". -// src/components/AuthProviders/DefaultProviderSettings.d.ts:3:22 - (ae-undocumented) Missing documentation for "DefaultProviderSettings". -// src/components/AuthProviders/ProviderSettingsItem.d.ts:4:22 - (ae-undocumented) Missing documentation for "ProviderSettingsItem". -// src/components/AuthProviders/UserSettingsAuthProviders.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsAuthProviders". -// src/components/FeatureFlags/UserSettingsFeatureFlags.d.ts:5:22 - (ae-undocumented) Missing documentation for "UserSettingsFeatureFlags". -// src/components/General/UserSettingsAppearanceCard.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsAppearanceCard". -// src/components/General/UserSettingsGeneral.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsGeneral". -// src/components/General/UserSettingsIdentityCard.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsIdentityCard". -// src/components/General/UserSettingsLanguageToggle.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsLanguageToggle". -// src/components/General/UserSettingsMenu.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsMenu". -// src/components/General/UserSettingsPinToggle.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsPinToggle". -// src/components/General/UserSettingsProfileCard.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsProfileCard". -// src/components/General/UserSettingsSignInAvatar.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsSignInAvatar". -// src/components/General/UserSettingsThemeToggle.d.ts:3:22 - (ae-undocumented) Missing documentation for "UserSettingsThemeToggle". -// src/components/Settings.d.ts:4:22 - (ae-undocumented) Missing documentation for "Settings". -// src/components/SettingsLayout/SettingsLayout.d.ts:4:1 - (ae-undocumented) Missing documentation for "SettingsLayoutRouteProps". -// src/components/SettingsLayout/SettingsLayout.d.ts:15:1 - (ae-undocumented) Missing documentation for "SettingsLayoutProps". -// src/components/SettingsLayout/SettingsLayout.d.ts:23:22 - (ae-undocumented) Missing documentation for "SettingsLayout". -// src/components/SettingsPage/SettingsPage.d.ts:3:22 - (ae-undocumented) Missing documentation for "SettingsPage". -// src/components/UserSettingsTab/UserSettingsTab.d.ts:3:22 - (ae-undocumented) Missing documentation for "USER_SETTINGS_TAB_KEY". -// src/components/UserSettingsTab/UserSettingsTab.d.ts:5:1 - (ae-undocumented) Missing documentation for "UserSettingsTabProps". -// src/components/useUserProfileInfo.d.ts:3:22 - (ae-undocumented) Missing documentation for "useUserProfile". -// src/plugin.d.ts:4:22 - (ae-undocumented) Missing documentation for "userSettingsPlugin". -// src/plugin.d.ts:8:22 - (ae-undocumented) Missing documentation for "UserSettingsPage". ``` From ea0b92757824480371b64607b945f6fd408c0273 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:02:05 +0000 Subject: [PATCH 155/268] fix(deps): update dependency express-prom-bundle to v7.0.2 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 109915af0b..1620d0a1c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27404,8 +27404,8 @@ __metadata: linkType: hard "express-prom-bundle@npm:^7.0.0": - version: 7.0.0 - resolution: "express-prom-bundle@npm:7.0.0" + version: 7.0.2 + resolution: "express-prom-bundle@npm:7.0.2" dependencies: "@types/express": ^4.17.21 express: ^4.18.2 @@ -27413,7 +27413,7 @@ __metadata: url-value-parser: ^2.0.0 peerDependencies: prom-client: ">=15.0.0" - checksum: 5490573610c17b5022ddaebd61ca9eb3f1bc7e48d2b37f51dc358ffdfcb8c75ce5817a93ae2cc112ac7cc00ed7792fecff810ac6d6328f8ac623d6039e82d0c9 + checksum: c9c26f1cd494e5733d56b719d59e1091b61fb08a2664d4474ad6540829f12d6f7a73d46b37a4806e4610460861829e23b4c586f48cdd857111800fafc9818cc6 languageName: node linkType: hard From ee6c19d8662888a61f6ffb1e96126545a4ed5433 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:49:34 +0000 Subject: [PATCH 156/268] fix(deps): update dependency google-auth-library to v9.14.2 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1620d0a1c0..f44d4d2f38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28922,8 +28922,8 @@ __metadata: linkType: hard "google-auth-library@npm:^9.0.0, google-auth-library@npm:^9.3.0, google-auth-library@npm:^9.6.3": - version: 9.14.1 - resolution: "google-auth-library@npm:9.14.1" + version: 9.14.2 + resolution: "google-auth-library@npm:9.14.2" dependencies: base64-js: ^1.3.0 ecdsa-sig-formatter: ^1.0.11 @@ -28931,7 +28931,7 @@ __metadata: gcp-metadata: ^6.1.0 gtoken: ^7.0.0 jws: ^4.0.0 - checksum: 98c7ffb6ef8d811a54d728a94c31aa60c777f035306f0ded70654ce0aa1f4dcf393bb505b262aa48438f5ead8941248f3759f24f0e22b4465b8537b1d90415ac + checksum: 64b3a6c1b1b14f1c891dbcfb850bc4db63dc8fae17e70197636244d00c83b539ac3da8688aae0bd1f09c884fc538d203945ae751edbabf666b41066385d86e30 languageName: node linkType: hard From 06256dabd8c2d51f4fcd5b83ed9d7737ccc8a010 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:33:07 +0000 Subject: [PATCH 157/268] build(deps): bump webpack from 5.88.2 to 5.95.0 in /microsite Bumps [webpack](https://github.com/webpack/webpack) from 5.88.2 to 5.95.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.88.2...v5.95.0) --- updated-dependencies: - dependency-name: webpack dependency-type: indirect ... Signed-off-by: dependabot[bot] --- microsite/yarn.lock | 341 ++++++++++++++++++++++++++------------------ 1 file changed, 199 insertions(+), 142 deletions(-) diff --git a/microsite/yarn.lock b/microsite/yarn.lock index 36bc51b130..2369c7d77d 100644 --- a/microsite/yarn.lock +++ b/microsite/yarn.lock @@ -2354,7 +2354,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9": +"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.20, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -3060,26 +3060,6 @@ __metadata: languageName: node linkType: hard -"@types/eslint-scope@npm:^3.7.3": - version: 3.7.4 - resolution: "@types/eslint-scope@npm:3.7.4" - dependencies: - "@types/eslint": "*" - "@types/estree": "*" - checksum: ea6a9363e92f301cd3888194469f9ec9d0021fe0a397a97a6dd689e7545c75de0bd2153dfb13d3ab532853a278b6572c6f678ce846980669e41029d205653460 - languageName: node - linkType: hard - -"@types/eslint@npm:*": - version: 8.4.10 - resolution: "@types/eslint@npm:8.4.10" - dependencies: - "@types/estree": "*" - "@types/json-schema": "*" - checksum: 21e009ed9ed9bc8920fdafc6e11ff321c4538b4cc18a56fdd59dc5184ea7bbf363c71638c9bdb59fc1254dddcdd567485136ed68b0ee4750948d4e32cb79c689 - languageName: node - linkType: hard - "@types/estree-jsx@npm:^1.0.0": version: 1.0.0 resolution: "@types/estree-jsx@npm:1.0.0" @@ -3096,6 +3076,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:^1.0.5": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 8825d6e729e16445d9a1dd2fb1db2edc5ed400799064cd4d028150701031af012ba30d6d03fe9df40f4d7a437d0de6d2b256020152b7b09bde9f2e420afdffd9 + languageName: node + linkType: hard + "@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.18": version: 4.17.31 resolution: "@types/express-serve-static-core@npm:4.17.31" @@ -3190,7 +3177,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": version: 7.0.11 resolution: "@types/json-schema@npm:7.0.11" checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d @@ -3430,154 +3417,154 @@ __metadata: languageName: node linkType: hard -"@webassemblyjs/ast@npm:1.11.5, @webassemblyjs/ast@npm:^1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/ast@npm:1.11.5" +"@webassemblyjs/ast@npm:1.12.1, @webassemblyjs/ast@npm:^1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/ast@npm:1.12.1" dependencies: - "@webassemblyjs/helper-numbers": 1.11.5 - "@webassemblyjs/helper-wasm-bytecode": 1.11.5 - checksum: 7df16d8d4364d40e2506776330f8114fddc6494e6e18e8d5ec386312a0881a564cef136b0a74cc4a6ba284e2ff6bad890ddc029a0ba6cf45cc15186e638db118 + "@webassemblyjs/helper-numbers": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + checksum: 31bcc64147236bd7b1b6d29d1f419c1f5845c785e1e42dc9e3f8ca2e05a029e9393a271b84f3a5bff2a32d35f51ff59e2181a6e5f953fe88576acd6750506202 languageName: node linkType: hard -"@webassemblyjs/floating-point-hex-parser@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.5" - checksum: a6f35e3035a1ec4e446fa43da01539f3ed7e0f4b53d152f36ff34be1b63b08d86c4b09b6af375c95472a75f0c37b3b98b07199d157e767b8b3274e7a3962890c +"@webassemblyjs/floating-point-hex-parser@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.6" + checksum: 29b08758841fd8b299c7152eda36b9eb4921e9c584eb4594437b5cd90ed6b920523606eae7316175f89c20628da14326801090167cc7fbffc77af448ac84b7e2 languageName: node linkType: hard -"@webassemblyjs/helper-api-error@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-api-error@npm:1.11.5" - checksum: 717a6ffb3283bd24a7b74710c9bd3d71ec331a26c15446441af19fae9f087e36acb8dcf25b900b6897a1d1eff838e463fe678d66281e7eccee9a3ac0e3447372 +"@webassemblyjs/helper-api-error@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-api-error@npm:1.11.6" + checksum: e8563df85161096343008f9161adb138a6e8f3c2cc338d6a36011aa55eabb32f2fd138ffe63bc278d009ada001cc41d263dadd1c0be01be6c2ed99076103689f languageName: node linkType: hard -"@webassemblyjs/helper-buffer@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-buffer@npm:1.11.5" - checksum: 2c0925b1c3c9b115c183b88d9cf1a12e87fa4fc83ef985aa2a65d72cda543eba6b73b378d231b4feb810b17d3aa6cd297bd603199854346f8a50e3458d7ebbc0 +"@webassemblyjs/helper-buffer@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/helper-buffer@npm:1.12.1" + checksum: c3ffb723024130308db608e86e2bdccd4868bbb62dffb0a9a1530606496f79c87f8565bd8e02805ce64912b71f1a70ee5fb00307258b0c082c3abf961d097eca languageName: node linkType: hard -"@webassemblyjs/helper-numbers@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-numbers@npm:1.11.5" +"@webassemblyjs/helper-numbers@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-numbers@npm:1.11.6" dependencies: - "@webassemblyjs/floating-point-hex-parser": 1.11.5 - "@webassemblyjs/helper-api-error": 1.11.5 + "@webassemblyjs/floating-point-hex-parser": 1.11.6 + "@webassemblyjs/helper-api-error": 1.11.6 "@xtuc/long": 4.2.2 - checksum: 49c8bbf561d4df38009e38e6357c396f4454773fd31a03579a8e050a2b28053f5c47f675f00a37f79a65082c938c2159fa603049688ac01b1bafdb472c21110c + checksum: f4b562fa219f84368528339e0f8d273ad44e047a07641ffcaaec6f93e5b76fd86490a009aa91a294584e1436d74b0a01fa9fde45e333a4c657b58168b04da424 languageName: node linkType: hard -"@webassemblyjs/helper-wasm-bytecode@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.5" - checksum: 4e868de92587e131a7f22bc4eb44eee60c178d4c2c3eeabcb973b4eac73ec477f25d5f838394797265dbe4b600e781c6e150c762a45f249b94bf0711e73409a7 +"@webassemblyjs/helper-wasm-bytecode@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.6" + checksum: 3535ef4f1fba38de3475e383b3980f4bbf3de72bbb631c2b6584c7df45be4eccd62c6ff48b5edd3f1bcff275cfd605a37679ec199fc91fd0a7705d7f1e3972dc languageName: node linkType: hard -"@webassemblyjs/helper-wasm-section@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-wasm-section@npm:1.11.5" +"@webassemblyjs/helper-wasm-section@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/helper-wasm-section@npm:1.12.1" dependencies: - "@webassemblyjs/ast": 1.11.5 - "@webassemblyjs/helper-buffer": 1.11.5 - "@webassemblyjs/helper-wasm-bytecode": 1.11.5 - "@webassemblyjs/wasm-gen": 1.11.5 - checksum: 1752d7e0dbbf236a5cdc2257e1626a3562bfb0a7d2e967dc5e798c73088f18f20a991491565e2ffee61615f08035b4760e7aa080380bb60b86b393b6eb7486ae + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-buffer": 1.12.1 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/wasm-gen": 1.12.1 + checksum: c19810cdd2c90ff574139b6d8c0dda254d42d168a9e5b3d353d1bc085f1d7164ccd1b3c05592a45a939c47f7e403dc8d03572bb686642f06a3d02932f6f0bc8f languageName: node linkType: hard -"@webassemblyjs/ieee754@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/ieee754@npm:1.11.5" +"@webassemblyjs/ieee754@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/ieee754@npm:1.11.6" dependencies: "@xtuc/ieee754": ^1.2.0 - checksum: 68a855a3e3dd488fff4d2d100e491cb6ac07f728c9432f3216b8e1bb0a374b397b0a5f58fd3b71195e525d49c0c827db15c18897e1c220c629e759b19978e64c + checksum: 13574b8e41f6ca39b700e292d7edf102577db5650fe8add7066a320aa4b7a7c09a5056feccac7a74eb68c10dea9546d4461412af351f13f6b24b5f32379b49de languageName: node linkType: hard -"@webassemblyjs/leb128@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/leb128@npm:1.11.5" +"@webassemblyjs/leb128@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/leb128@npm:1.11.6" dependencies: "@xtuc/long": 4.2.2 - checksum: 555314708b6615c203c31a9dd810141c6de728e0043c2169ca69905ccf4d8603102994cb74ac5d057ac229bfc2be40f69cad2edd134ef2b909ef694eefe7bba6 + checksum: 7ea942dc9777d4b18a5ebfa3a937b30ae9e1d2ce1fee637583ed7f376334dd1d4274f813d2e250056cca803e0952def4b954913f1a3c9068bcd4ab4ee5143bf0 languageName: node linkType: hard -"@webassemblyjs/utf8@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/utf8@npm:1.11.5" - checksum: d8f67a5650d9bf26810da76e72d0547211a44f30f35657953f547e08185facb39ff326920bddec96d35b5cc65e4e66b1f23c6461847e2f93fad2a60b0bb20211 +"@webassemblyjs/utf8@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/utf8@npm:1.11.6" + checksum: 807fe5b5ce10c390cfdd93e0fb92abda8aebabb5199980681e7c3743ee3306a75729bcd1e56a3903980e96c885ee53ef901fcbaac8efdfa480f9c0dae1d08713 languageName: node linkType: hard -"@webassemblyjs/wasm-edit@npm:^1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wasm-edit@npm:1.11.5" +"@webassemblyjs/wasm-edit@npm:^1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wasm-edit@npm:1.12.1" dependencies: - "@webassemblyjs/ast": 1.11.5 - "@webassemblyjs/helper-buffer": 1.11.5 - "@webassemblyjs/helper-wasm-bytecode": 1.11.5 - "@webassemblyjs/helper-wasm-section": 1.11.5 - "@webassemblyjs/wasm-gen": 1.11.5 - "@webassemblyjs/wasm-opt": 1.11.5 - "@webassemblyjs/wasm-parser": 1.11.5 - "@webassemblyjs/wast-printer": 1.11.5 - checksum: 790142a1e282848201c7b68860aabc0141ee44a98a62c3f0af05f8de3cc69b439c3af54ae9a06acbbfbf7fd192b30ee97fb31eda3e08973cae373534ad2135c7 + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-buffer": 1.12.1 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/helper-wasm-section": 1.12.1 + "@webassemblyjs/wasm-gen": 1.12.1 + "@webassemblyjs/wasm-opt": 1.12.1 + "@webassemblyjs/wasm-parser": 1.12.1 + "@webassemblyjs/wast-printer": 1.12.1 + checksum: ae23642303f030af888d30c4ef37b08dfec7eab6851a9575a616e65d1219f880d9223913a39056dd654e49049d76e97555b285d1f7e56935047abf578cce0692 languageName: node linkType: hard -"@webassemblyjs/wasm-gen@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wasm-gen@npm:1.11.5" +"@webassemblyjs/wasm-gen@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wasm-gen@npm:1.12.1" dependencies: - "@webassemblyjs/ast": 1.11.5 - "@webassemblyjs/helper-wasm-bytecode": 1.11.5 - "@webassemblyjs/ieee754": 1.11.5 - "@webassemblyjs/leb128": 1.11.5 - "@webassemblyjs/utf8": 1.11.5 - checksum: 0122df4e5ce52d873f19f34b3ebe8237072e9e6a69667cbec42a2d98ba49f85ea2ed3d935195e6a7ad4f64b9dd7da42883f057fe1103d2062bc90f3428b063fe + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/ieee754": 1.11.6 + "@webassemblyjs/leb128": 1.11.6 + "@webassemblyjs/utf8": 1.11.6 + checksum: 5787626bb7f0b033044471ddd00ce0c9fe1ee4584e8b73e232051e3a4c99ba1a102700d75337151c8b6055bae77eefa4548960c610a5e4a504e356bd872138ff languageName: node linkType: hard -"@webassemblyjs/wasm-opt@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wasm-opt@npm:1.11.5" +"@webassemblyjs/wasm-opt@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wasm-opt@npm:1.12.1" dependencies: - "@webassemblyjs/ast": 1.11.5 - "@webassemblyjs/helper-buffer": 1.11.5 - "@webassemblyjs/wasm-gen": 1.11.5 - "@webassemblyjs/wasm-parser": 1.11.5 - checksum: f9416b0dece071e308616fb30e560f0c3c53b5bb23cc4409781b8c47d31e935b27e9a248c65aee9dd9136271e37a4c5cb0971b27e5adf623020fbb298423fe55 + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-buffer": 1.12.1 + "@webassemblyjs/wasm-gen": 1.12.1 + "@webassemblyjs/wasm-parser": 1.12.1 + checksum: 0e8fa8a0645304a1e18ff40d3db5a2e9233ebaa169b19fcc651d6fc9fe2cac0ce092ddee927318015ae735d9cd9c5d97c0cafb6a51dcd2932ac73587b62df991 languageName: node linkType: hard -"@webassemblyjs/wasm-parser@npm:1.11.5, @webassemblyjs/wasm-parser@npm:^1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wasm-parser@npm:1.11.5" +"@webassemblyjs/wasm-parser@npm:1.12.1, @webassemblyjs/wasm-parser@npm:^1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wasm-parser@npm:1.12.1" dependencies: - "@webassemblyjs/ast": 1.11.5 - "@webassemblyjs/helper-api-error": 1.11.5 - "@webassemblyjs/helper-wasm-bytecode": 1.11.5 - "@webassemblyjs/ieee754": 1.11.5 - "@webassemblyjs/leb128": 1.11.5 - "@webassemblyjs/utf8": 1.11.5 - checksum: 094b3df07532cd2a1db91710622cbaf3d7467a361f9f73dc564999385a472fcc08497d8ccf9294bd7c8813d5e2056c06a81e032abb60520168899605fde9b12c + "@webassemblyjs/ast": 1.12.1 + "@webassemblyjs/helper-api-error": 1.11.6 + "@webassemblyjs/helper-wasm-bytecode": 1.11.6 + "@webassemblyjs/ieee754": 1.11.6 + "@webassemblyjs/leb128": 1.11.6 + "@webassemblyjs/utf8": 1.11.6 + checksum: 176015de3551ac068cd4505d837414f258d9ade7442bd71efb1232fa26c9f6d7d4e11a5c816caeed389943f409af7ebff6899289a992d7a70343cb47009d21a8 languageName: node linkType: hard -"@webassemblyjs/wast-printer@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wast-printer@npm:1.11.5" +"@webassemblyjs/wast-printer@npm:1.12.1": + version: 1.12.1 + resolution: "@webassemblyjs/wast-printer@npm:1.12.1" dependencies: - "@webassemblyjs/ast": 1.11.5 + "@webassemblyjs/ast": 1.12.1 "@xtuc/long": 4.2.2 - checksum: c2995224c56b403be7fce7afbb3ad6b2ceadce07a47b28bce745eabb0435fa363c0180bca907d28703ece02422d0de219e689253b55de288c79b8f92416c1d71 + checksum: 2974b5dda8d769145ba0efd886ea94a601e61fb37114c14f9a9a7606afc23456799af652ac3052f284909bd42edc3665a76bc9b50f95f0794c053a8a1757b713 languageName: node linkType: hard @@ -3612,12 +3599,12 @@ __metadata: languageName: node linkType: hard -"acorn-import-assertions@npm:^1.9.0": - version: 1.9.0 - resolution: "acorn-import-assertions@npm:1.9.0" +"acorn-import-attributes@npm:^1.9.5": + version: 1.9.5 + resolution: "acorn-import-attributes@npm:1.9.5" peerDependencies: acorn: ^8 - checksum: 944fb2659d0845c467066bdcda2e20c05abe3aaf11972116df457ce2627628a81764d800dd55031ba19de513ee0d43bb771bc679cc0eda66dc8b4fade143bc0c + checksum: 1c0c49b6a244503964ae46ae850baccf306e84caf99bc2010ed6103c69a423987b07b520a6c619f075d215388bd4923eccac995886a54309eda049ab78a4be95 languageName: node linkType: hard @@ -4182,7 +4169,7 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.0.0, browserslist@npm:^4.14.5, browserslist@npm:^4.18.1, browserslist@npm:^4.23.0, browserslist@npm:^4.23.1, browserslist@npm:^4.23.3": +"browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.23.0, browserslist@npm:^4.23.1, browserslist@npm:^4.23.3": version: 4.23.3 resolution: "browserslist@npm:4.23.3" dependencies: @@ -4196,6 +4183,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.21.10": + version: 4.24.0 + resolution: "browserslist@npm:4.24.0" + dependencies: + caniuse-lite: ^1.0.30001663 + electron-to-chromium: ^1.5.28 + node-releases: ^2.0.18 + update-browserslist-db: ^1.1.0 + bin: + browserslist: cli.js + checksum: de200d3eb8d6ed819dad99719099a28fb6ebeb88016a5ac42fbdc11607e910c236a84ca1b0bbf232477d4b88ab64e8ab6aa67557cdd40a73ca9c2834f92ccce0 + languageName: node + linkType: hard + "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -4328,6 +4329,13 @@ __metadata: languageName: node linkType: hard +"caniuse-lite@npm:^1.0.30001663": + version: 1.0.30001668 + resolution: "caniuse-lite@npm:1.0.30001668" + checksum: ce6996901b5883454a8ddb3040f82342277b6a6275876dfefcdecb11f7e472e29877f34cae47c2b674f08f2e71971dd4a2acb9bc01adfe8421b7148a7e9e8297 + languageName: node + linkType: hard + "ccount@npm:^2.0.0": version: 2.0.1 resolution: "ccount@npm:2.0.1" @@ -5445,6 +5453,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.5.28": + version: 1.5.36 + resolution: "electron-to-chromium@npm:1.5.36" + checksum: 1f83daebdf88dd4817565660fa68a827bdca2866032d4902bfd79c6f16d97acbd731b63c09029dd5aa1af4aadbe567834cf3c89b52a37602d375352185d68cf4 + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.5.4": version: 1.5.13 resolution: "electron-to-chromium@npm:1.5.13" @@ -5510,13 +5525,13 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^5.15.0": - version: 5.15.0 - resolution: "enhanced-resolve@npm:5.15.0" +"enhanced-resolve@npm:^5.17.1": + version: 5.17.1 + resolution: "enhanced-resolve@npm:5.17.1" dependencies: graceful-fs: ^4.2.4 tapable: ^2.2.0 - checksum: fbd8cdc9263be71cc737aa8a7d6c57b43d6aa38f6cc75dde6fcd3598a130cc465f979d2f4d01bb3bf475acb43817749c79f8eef9be048683602ca91ab52e4f11 + checksum: 4bc38cf1cea96456f97503db7280394177d1bc46f8f87c267297d04f795ac5efa81e48115a2f5b6273c781027b5b6bfc5f62b54df629e4d25fa7001a86624f59 languageName: node linkType: hard @@ -6366,6 +6381,13 @@ __metadata: languageName: node linkType: hard +"graceful-fs@npm:^4.2.11": + version: 4.2.11 + resolution: "graceful-fs@npm:4.2.11" + checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 + languageName: node + linkType: hard + "gray-matter@npm:^4.0.3": version: 4.0.3 resolution: "gray-matter@npm:4.0.3" @@ -11428,7 +11450,29 @@ __metadata: languageName: node linkType: hard -"terser-webpack-plugin@npm:^5.3.7, terser-webpack-plugin@npm:^5.3.9": +"terser-webpack-plugin@npm:^5.3.10": + version: 5.3.10 + resolution: "terser-webpack-plugin@npm:5.3.10" + dependencies: + "@jridgewell/trace-mapping": ^0.3.20 + jest-worker: ^27.4.5 + schema-utils: ^3.1.1 + serialize-javascript: ^6.0.1 + terser: ^5.26.0 + peerDependencies: + webpack: ^5.1.0 + peerDependenciesMeta: + "@swc/core": + optional: true + esbuild: + optional: true + uglify-js: + optional: true + checksum: bd6e7596cf815f3353e2a53e79cbdec959a1b0276f5e5d4e63e9d7c3c5bb5306df567729da287d1c7b39d79093e56863c569c42c6c24cc34c76aa313bd2cbcea + languageName: node + linkType: hard + +"terser-webpack-plugin@npm:^5.3.9": version: 5.3.9 resolution: "terser-webpack-plugin@npm:5.3.9" dependencies: @@ -11464,6 +11508,20 @@ __metadata: languageName: node linkType: hard +"terser@npm:^5.26.0": + version: 5.34.1 + resolution: "terser@npm:5.34.1" + dependencies: + "@jridgewell/source-map": ^0.3.3 + acorn: ^8.8.2 + commander: ^2.20.0 + source-map-support: ~0.5.20 + bin: + terser: bin/terser + checksum: 19a6710e17ff3f20d3b0661090640a572ce5ff6f2e95c731bb5a9eb1dcc1fe563cd0f1e4a22cde89b2717667336252bc2adb8894bdfbec6d1996b3e70b44f365 + languageName: node + linkType: hard + "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -11901,13 +11959,13 @@ __metadata: languageName: node linkType: hard -"watchpack@npm:^2.4.0": - version: 2.4.0 - resolution: "watchpack@npm:2.4.0" +"watchpack@npm:^2.4.1": + version: 2.4.2 + resolution: "watchpack@npm:2.4.2" dependencies: glob-to-regexp: ^0.4.1 graceful-fs: ^4.1.2 - checksum: 23d4bc58634dbe13b86093e01c6a68d8096028b664ab7139d58f0c37d962d549a940e98f2f201cecdabd6f9c340338dc73ef8bf094a2249ef582f35183d1a131 + checksum: 92d9d52ce3d16fd83ed6994d1dd66a4d146998882f4c362d37adfea9ab77748a5b4d1e0c65fa104797928b2d40f635efa8f9b925a6265428a69f1e1852ca3441 languageName: node linkType: hard @@ -12034,39 +12092,38 @@ __metadata: linkType: hard "webpack@npm:^5.88.1": - version: 5.88.2 - resolution: "webpack@npm:5.88.2" + version: 5.95.0 + resolution: "webpack@npm:5.95.0" dependencies: - "@types/eslint-scope": ^3.7.3 - "@types/estree": ^1.0.0 - "@webassemblyjs/ast": ^1.11.5 - "@webassemblyjs/wasm-edit": ^1.11.5 - "@webassemblyjs/wasm-parser": ^1.11.5 + "@types/estree": ^1.0.5 + "@webassemblyjs/ast": ^1.12.1 + "@webassemblyjs/wasm-edit": ^1.12.1 + "@webassemblyjs/wasm-parser": ^1.12.1 acorn: ^8.7.1 - acorn-import-assertions: ^1.9.0 - browserslist: ^4.14.5 + acorn-import-attributes: ^1.9.5 + browserslist: ^4.21.10 chrome-trace-event: ^1.0.2 - enhanced-resolve: ^5.15.0 + enhanced-resolve: ^5.17.1 es-module-lexer: ^1.2.1 eslint-scope: 5.1.1 events: ^3.2.0 glob-to-regexp: ^0.4.1 - graceful-fs: ^4.2.9 + graceful-fs: ^4.2.11 json-parse-even-better-errors: ^2.3.1 loader-runner: ^4.2.0 mime-types: ^2.1.27 neo-async: ^2.6.2 schema-utils: ^3.2.0 tapable: ^2.1.1 - terser-webpack-plugin: ^5.3.7 - watchpack: ^2.4.0 + terser-webpack-plugin: ^5.3.10 + watchpack: ^2.4.1 webpack-sources: ^3.2.3 peerDependenciesMeta: webpack-cli: optional: true bin: webpack: bin/webpack.js - checksum: 79476a782da31a21f6dd38fbbd06b68da93baf6a62f0d08ca99222367f3b8668f5a1f2086b7bb78e23172e31fa6df6fa7ab09b25e827866c4fc4dc2b30443ce2 + checksum: 0c3dfe288de4d62f8f3dc25478a618894883cab739121330763b7847e43304630ea2815ae2351a5f8ff6ab7c9642caf530d503d89bda261fe2cd220e524dd5d1 languageName: node linkType: hard From 0c1bc6ca5a79438396032f304d2cbe171f517f9e Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Mon, 14 Oct 2024 15:19:05 -0400 Subject: [PATCH 158/268] Revert browser-actions/setup-chrome bump Revert #27087 to unblock CI Signed-off-by: Corey Daley --- .github/workflows/verify_e2e-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify_e2e-windows.yml b/.github/workflows/verify_e2e-windows.yml index 0a25da3c5e..b6bfef51e5 100644 --- a/.github/workflows/verify_e2e-windows.yml +++ b/.github/workflows/verify_e2e-windows.yml @@ -75,7 +75,7 @@ jobs: npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"} - name: setup chrome - uses: browser-actions/setup-chrome@1208fbfeb50c2d4be7a87c2fa47d4cd7db1270e3 # latest + uses: browser-actions/setup-chrome@803ef6dfb4fdf22089c9563225d95e4a515820a0 # latest - name: yarn install uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15 From 631d153916781807b6d3063a2359c36b36a951b9 Mon Sep 17 00:00:00 2001 From: vabf59 Date: Mon, 14 Oct 2024 16:07:32 -0500 Subject: [PATCH 159/268] fix: hide support button in catalog, scaffolder, & techdocs if not configured Signed-off-by: vabf59 --- .../CatalogPage/DefaultCatalogPage.tsx | 5 ++++- .../next/TemplateListPage/TemplateListPage.tsx | 16 ++++++++++++---- .../src/home/components/DefaultTechDocsHome.tsx | 10 +++++++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx index a46a552b8d..bbfa375b67 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx @@ -58,6 +58,7 @@ export function BaseCatalogPage(props: BaseCatalogPageProps) { const { allowed } = usePermission({ permission: catalogEntityCreatePermission, }); + const supportConfig = useApi(configApiRef).getOptionalConfig('app.support'); return ( @@ -69,7 +70,9 @@ export function BaseCatalogPage(props: BaseCatalogPageProps) { to={createComponentLink && createComponentLink()} /> )} - {t('indexPage.supportButtonContent')} + {supportConfig && ( + {t('indexPage.supportButtonContent')} + )} diff --git a/plugins/scaffolder/src/next/TemplateListPage/TemplateListPage.tsx b/plugins/scaffolder/src/next/TemplateListPage/TemplateListPage.tsx index 4042506d1e..2707f1e91d 100644 --- a/plugins/scaffolder/src/next/TemplateListPage/TemplateListPage.tsx +++ b/plugins/scaffolder/src/next/TemplateListPage/TemplateListPage.tsx @@ -17,7 +17,12 @@ import React, { useCallback } from 'react'; import { useNavigate } from 'react-router-dom'; import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common'; -import { useApp, useRouteRef } from '@backstage/core-plugin-api'; +import { + configApiRef, + useApi, + useApp, + useRouteRef, +} from '@backstage/core-plugin-api'; import { Content, @@ -110,6 +115,7 @@ export const TemplateListPage = (props: TemplateListPageProps) => { const templateRoute = useRouteRef(selectedTemplateRouteRef); const app = useApp(); const { t } = useTranslationRef(scaffolderTranslationRef); + const supportConfig = useApi(configApiRef).getOptionalConfig('app.support'); const groups = givenGroups.length ? createGroupsWithOther(givenGroups, t) @@ -184,9 +190,11 @@ export const TemplateListPage = (props: TemplateListPageProps) => { )} to={registerComponentLink && registerComponentLink()} /> - - {t('templateListPage.contentHeader.supportButtonTitle')} - + {supportConfig && ( + + {t('templateListPage.contentHeader.supportButtonTitle')} + + )} diff --git a/plugins/techdocs/src/home/components/DefaultTechDocsHome.tsx b/plugins/techdocs/src/home/components/DefaultTechDocsHome.tsx index 2fbd5bb50a..7aae9b242e 100644 --- a/plugins/techdocs/src/home/components/DefaultTechDocsHome.tsx +++ b/plugins/techdocs/src/home/components/DefaultTechDocsHome.tsx @@ -31,6 +31,7 @@ import { TechDocsPageWrapper } from './TechDocsPageWrapper'; import { TechDocsPicker } from './TechDocsPicker'; import { EntityListDocsTable } from './Tables'; import { TechDocsIndexPageProps } from './TechDocsIndexPage'; +import { configApiRef, useApi } from '@backstage/core-plugin-api'; /** * Props for {@link DefaultTechDocsHome} @@ -47,13 +48,16 @@ export type DefaultTechDocsHomeProps = TechDocsIndexPageProps; */ export const DefaultTechDocsHome = (props: TechDocsIndexPageProps) => { const { initialFilter = 'owned', columns, actions, ownerPickerMode } = props; + const supportConfig = useApi(configApiRef).getOptionalConfig('app.support'); return ( - - Discover documentation in your ecosystem. - + {supportConfig && ( + + Discover documentation in your ecosystem. + + )} From dc409c58d5287f526a6b3bea33110c1a09da8766 Mon Sep 17 00:00:00 2001 From: vabf59 Date: Mon, 14 Oct 2024 16:15:45 -0500 Subject: [PATCH 160/268] chore: add changeset Signed-off-by: vabf59 --- .changeset/perfect-goats-mate.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/perfect-goats-mate.md diff --git a/.changeset/perfect-goats-mate.md b/.changeset/perfect-goats-mate.md new file mode 100644 index 0000000000..c53075a5bb --- /dev/null +++ b/.changeset/perfect-goats-mate.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-scaffolder': minor +'@backstage/plugin-techdocs': minor +'@backstage/plugin-catalog': minor +--- + +The SupportButton component will now be hidden if no support config is specified in app-config From e01727c8c2a35564e887761a0be3bebc93b4b458 Mon Sep 17 00:00:00 2001 From: Peter Macdonald Date: Tue, 15 Oct 2024 08:48:51 +0200 Subject: [PATCH 161/268] Add clarification notice to the permissions tutorial docs, related to 24942 Signed-off-by: Peter Macdonald --- docs/permissions/plugin-authors/01-setup.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/permissions/plugin-authors/01-setup.md b/docs/permissions/plugin-authors/01-setup.md index 79740a7659..6ece0b0b69 100644 --- a/docs/permissions/plugin-authors/01-setup.md +++ b/docs/permissions/plugin-authors/01-setup.md @@ -14,7 +14,9 @@ The rest of this page is focused on adding the `todo-list` and `todo-list-backen ## Setup for the Tutorial -We will use a "Todo list" feature, composed of the `todo-list` and `todo-list-backend` plugins, as well as their dependency, `todo-list-common`. +**Note**: We will be updating files created as part of the [Getting Started](../getting-started.md) documentation, this tutorial assumes you have already viewed and gone through those steps! + +We are going to make a "Todo list" feature, composed of the `todo-list` and `todo-list-backend` plugins, as well as their dependency, `todo-list-common`. The source code is available here: From 958287ebf60e264db7a0cfb69d14b8c9f1ccd57b Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 15 Oct 2024 08:57:34 +0200 Subject: [PATCH 162/268] chore: updating API report Signed-off-by: blam --- .changeset/pink-sheep-dress.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.changeset/pink-sheep-dress.md b/.changeset/pink-sheep-dress.md index 949604cde2..a4182efde2 100644 --- a/.changeset/pink-sheep-dress.md +++ b/.changeset/pink-sheep-dress.md @@ -2,4 +2,7 @@ '@backstage/repo-tools': patch --- -Fix issues with warnings not being reported due to bad filename path when reading report +Fix issues with warnings in API reports not being checked or reported. + +Due to the recent version bump of API Extractor you may now see a lot of `ae-undocumented` warnings, +these can be ignored using the `-o` option, for example, `backstage-repo-tools api-reports -o ae-undocumented,ae-wrong-input-file-type`. From 4b60e0c2b8b70b7a2664ba5309aa87472d3c4a85 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 15 Oct 2024 09:11:09 +0200 Subject: [PATCH 163/268] chore: more changesets Signed-off-by: blam --- .changeset/bright-mails-compare.md | 9 +++++++++ .changeset/brown-hotels-move.md | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 .changeset/bright-mails-compare.md create mode 100644 .changeset/brown-hotels-move.md diff --git a/.changeset/bright-mails-compare.md b/.changeset/bright-mails-compare.md new file mode 100644 index 0000000000..61d049576c --- /dev/null +++ b/.changeset/bright-mails-compare.md @@ -0,0 +1,9 @@ +--- +'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch +'@backstage/plugin-catalog-backend-module-msgraph': patch +'@backstage/plugin-search-backend-module-catalog': patch +'@backstage/plugin-search-backend-module-elasticsearch': patch +'@backstage/plugin-search-backend-module-techdocs': patch +--- + +Remove extension points from `/alpha` export, they're available from the main package already diff --git a/.changeset/brown-hotels-move.md b/.changeset/brown-hotels-move.md new file mode 100644 index 0000000000..511ea9ee10 --- /dev/null +++ b/.changeset/brown-hotels-move.md @@ -0,0 +1,7 @@ +--- +'@backstage/backend-defaults': patch +'@backstage/plugin-catalog-backend-module-puppetdb': patch +'@backstage/plugin-scaffolder-react': patch +--- + +Small tweaks to API reports to make them valid From e9b23253609d1cea82efa552ef6482fab9a6f62d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 07:28:33 +0000 Subject: [PATCH 164/268] fix(deps): update dependency isbinaryfile to v5.0.3 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f44d4d2f38..e3e3bb67c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31064,9 +31064,9 @@ __metadata: linkType: hard "isbinaryfile@npm:^5.0.0": - version: 5.0.2 - resolution: "isbinaryfile@npm:5.0.2" - checksum: 5e3e9d31b016eefb7e93bd0ab7d088489882eeb9018bf71303f2ce5d9ad02dbb127663d065ce2519913c3c9135a99002e989d6b1786a0fcc0b3c3d2defb1f7d0 + version: 5.0.3 + resolution: "isbinaryfile@npm:5.0.3" + checksum: 950820d813a664a5c17dcb52e9a10454da4f51918369388be428de47a33f51de38637df2cff91a95f212551170c8045c2156c99bab23a042ab3ef1a775bee1b9 languageName: node linkType: hard From 8f0898bc616ab1a5acefc1dbab97448f65817e80 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 07:29:20 +0000 Subject: [PATCH 165/268] chore(deps): update dependency esbuild to ^0.24.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .changeset/renovate-d7e90e4.md | 6 + packages/cli/package.json | 2 +- plugins/scaffolder-backend/package.json | 2 +- yarn.lock | 204 ++++++++++++------------ 4 files changed, 110 insertions(+), 104 deletions(-) create mode 100644 .changeset/renovate-d7e90e4.md diff --git a/.changeset/renovate-d7e90e4.md b/.changeset/renovate-d7e90e4.md new file mode 100644 index 0000000000..58c24b2ddf --- /dev/null +++ b/.changeset/renovate-d7e90e4.md @@ -0,0 +1,6 @@ +--- +'@backstage/cli': patch +'@backstage/plugin-scaffolder-backend': patch +--- + +Updated dependency `esbuild` to `^0.24.0`. diff --git a/packages/cli/package.json b/packages/cli/package.json index 15ac0e5eb3..8d5ffda905 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -90,7 +90,7 @@ "cross-spawn": "^7.0.3", "css-loader": "^6.5.1", "ctrlc-windows": "^2.1.0", - "esbuild": "^0.23.0", + "esbuild": "^0.24.0", "esbuild-loader": "^4.0.0", "eslint": "^8.6.0", "eslint-config-prettier": "^9.0.0", diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index bca90991ee..ed06d22361 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -124,7 +124,7 @@ "@types/nunjucks": "^3.1.4", "@types/supertest": "^2.0.8", "@types/zen-observable": "^0.8.0", - "esbuild": "^0.23.0", + "esbuild": "^0.24.0", "strip-ansi": "^7.1.0", "supertest": "^7.0.0", "wait-for-expect": "^3.0.2" diff --git a/yarn.lock b/yarn.lock index f44d4d2f38..3f016bcd06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3996,7 +3996,7 @@ __metadata: css-loader: ^6.5.1 ctrlc-windows: ^2.1.0 del: ^7.0.0 - esbuild: ^0.23.0 + esbuild: ^0.24.0 esbuild-loader: ^4.0.0 eslint: ^8.6.0 eslint-config-prettier: ^9.0.0 @@ -7576,7 +7576,7 @@ __metadata: "@types/supertest": ^2.0.8 "@types/zen-observable": ^0.8.0 concat-stream: ^2.0.0 - esbuild: ^0.23.0 + esbuild: ^0.24.0 express: ^4.17.1 express-promise-router: ^4.1.0 fs-extra: ^11.2.0 @@ -9371,9 +9371,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/aix-ppc64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/aix-ppc64@npm:0.23.1" +"@esbuild/aix-ppc64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/aix-ppc64@npm:0.24.0" conditions: os=aix & cpu=ppc64 languageName: node linkType: hard @@ -9385,9 +9385,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/android-arm64@npm:0.23.1" +"@esbuild/android-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-arm64@npm:0.24.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard @@ -9399,9 +9399,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/android-arm@npm:0.23.1" +"@esbuild/android-arm@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-arm@npm:0.24.0" conditions: os=android & cpu=arm languageName: node linkType: hard @@ -9413,9 +9413,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/android-x64@npm:0.23.1" +"@esbuild/android-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/android-x64@npm:0.24.0" conditions: os=android & cpu=x64 languageName: node linkType: hard @@ -9427,9 +9427,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/darwin-arm64@npm:0.23.1" +"@esbuild/darwin-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/darwin-arm64@npm:0.24.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard @@ -9441,9 +9441,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/darwin-x64@npm:0.23.1" +"@esbuild/darwin-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/darwin-x64@npm:0.24.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard @@ -9455,9 +9455,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/freebsd-arm64@npm:0.23.1" +"@esbuild/freebsd-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/freebsd-arm64@npm:0.24.0" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard @@ -9469,9 +9469,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/freebsd-x64@npm:0.23.1" +"@esbuild/freebsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/freebsd-x64@npm:0.24.0" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard @@ -9483,9 +9483,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-arm64@npm:0.23.1" +"@esbuild/linux-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-arm64@npm:0.24.0" conditions: os=linux & cpu=arm64 languageName: node linkType: hard @@ -9497,9 +9497,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-arm@npm:0.23.1" +"@esbuild/linux-arm@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-arm@npm:0.24.0" conditions: os=linux & cpu=arm languageName: node linkType: hard @@ -9511,9 +9511,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-ia32@npm:0.23.1" +"@esbuild/linux-ia32@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-ia32@npm:0.24.0" conditions: os=linux & cpu=ia32 languageName: node linkType: hard @@ -9525,9 +9525,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-loong64@npm:0.23.1" +"@esbuild/linux-loong64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-loong64@npm:0.24.0" conditions: os=linux & cpu=loong64 languageName: node linkType: hard @@ -9539,9 +9539,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-mips64el@npm:0.23.1" +"@esbuild/linux-mips64el@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-mips64el@npm:0.24.0" conditions: os=linux & cpu=mips64el languageName: node linkType: hard @@ -9553,9 +9553,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-ppc64@npm:0.23.1" +"@esbuild/linux-ppc64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-ppc64@npm:0.24.0" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard @@ -9567,9 +9567,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-riscv64@npm:0.23.1" +"@esbuild/linux-riscv64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-riscv64@npm:0.24.0" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard @@ -9581,9 +9581,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-s390x@npm:0.23.1" +"@esbuild/linux-s390x@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-s390x@npm:0.24.0" conditions: os=linux & cpu=s390x languageName: node linkType: hard @@ -9595,9 +9595,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/linux-x64@npm:0.23.1" +"@esbuild/linux-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/linux-x64@npm:0.24.0" conditions: os=linux & cpu=x64 languageName: node linkType: hard @@ -9609,16 +9609,16 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/netbsd-x64@npm:0.23.1" +"@esbuild/netbsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/netbsd-x64@npm:0.24.0" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/openbsd-arm64@npm:0.23.1" +"@esbuild/openbsd-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/openbsd-arm64@npm:0.24.0" conditions: os=openbsd & cpu=arm64 languageName: node linkType: hard @@ -9630,9 +9630,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/openbsd-x64@npm:0.23.1" +"@esbuild/openbsd-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/openbsd-x64@npm:0.24.0" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard @@ -9644,9 +9644,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/sunos-x64@npm:0.23.1" +"@esbuild/sunos-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/sunos-x64@npm:0.24.0" conditions: os=sunos & cpu=x64 languageName: node linkType: hard @@ -9658,9 +9658,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/win32-arm64@npm:0.23.1" +"@esbuild/win32-arm64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-arm64@npm:0.24.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard @@ -9672,9 +9672,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/win32-ia32@npm:0.23.1" +"@esbuild/win32-ia32@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-ia32@npm:0.24.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard @@ -9686,9 +9686,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.23.1": - version: 0.23.1 - resolution: "@esbuild/win32-x64@npm:0.23.1" +"@esbuild/win32-x64@npm:0.24.0": + version: 0.24.0 + resolution: "@esbuild/win32-x64@npm:0.24.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -26360,34 +26360,34 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.23.0": - version: 0.23.1 - resolution: "esbuild@npm:0.23.1" +"esbuild@npm:^0.24.0": + version: 0.24.0 + resolution: "esbuild@npm:0.24.0" dependencies: - "@esbuild/aix-ppc64": 0.23.1 - "@esbuild/android-arm": 0.23.1 - "@esbuild/android-arm64": 0.23.1 - "@esbuild/android-x64": 0.23.1 - "@esbuild/darwin-arm64": 0.23.1 - "@esbuild/darwin-x64": 0.23.1 - "@esbuild/freebsd-arm64": 0.23.1 - "@esbuild/freebsd-x64": 0.23.1 - "@esbuild/linux-arm": 0.23.1 - "@esbuild/linux-arm64": 0.23.1 - "@esbuild/linux-ia32": 0.23.1 - "@esbuild/linux-loong64": 0.23.1 - "@esbuild/linux-mips64el": 0.23.1 - "@esbuild/linux-ppc64": 0.23.1 - "@esbuild/linux-riscv64": 0.23.1 - "@esbuild/linux-s390x": 0.23.1 - "@esbuild/linux-x64": 0.23.1 - "@esbuild/netbsd-x64": 0.23.1 - "@esbuild/openbsd-arm64": 0.23.1 - "@esbuild/openbsd-x64": 0.23.1 - "@esbuild/sunos-x64": 0.23.1 - "@esbuild/win32-arm64": 0.23.1 - "@esbuild/win32-ia32": 0.23.1 - "@esbuild/win32-x64": 0.23.1 + "@esbuild/aix-ppc64": 0.24.0 + "@esbuild/android-arm": 0.24.0 + "@esbuild/android-arm64": 0.24.0 + "@esbuild/android-x64": 0.24.0 + "@esbuild/darwin-arm64": 0.24.0 + "@esbuild/darwin-x64": 0.24.0 + "@esbuild/freebsd-arm64": 0.24.0 + "@esbuild/freebsd-x64": 0.24.0 + "@esbuild/linux-arm": 0.24.0 + "@esbuild/linux-arm64": 0.24.0 + "@esbuild/linux-ia32": 0.24.0 + "@esbuild/linux-loong64": 0.24.0 + "@esbuild/linux-mips64el": 0.24.0 + "@esbuild/linux-ppc64": 0.24.0 + "@esbuild/linux-riscv64": 0.24.0 + "@esbuild/linux-s390x": 0.24.0 + "@esbuild/linux-x64": 0.24.0 + "@esbuild/netbsd-x64": 0.24.0 + "@esbuild/openbsd-arm64": 0.24.0 + "@esbuild/openbsd-x64": 0.24.0 + "@esbuild/sunos-x64": 0.24.0 + "@esbuild/win32-arm64": 0.24.0 + "@esbuild/win32-ia32": 0.24.0 + "@esbuild/win32-x64": 0.24.0 dependenciesMeta: "@esbuild/aix-ppc64": optional: true @@ -26439,7 +26439,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: 0413c3b9257327fb598427688b7186ea335bf1693746fe5713cc93c95854d6388b8ed4ad643fddf5b5ace093f7dcd9038dd58e087bf2da1f04dfb4c5571660af + checksum: dd386d92a05c7eb03078480522cdd8b40c434777b5f08487c27971d30933ecaae3f08bd221958dd8f9c66214915cdc85f844283ca9bdbf8ee703d889ae526edd languageName: node linkType: hard From 0a69ca128efcda16e58066b0bba9fb32ecb77b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 15 Oct 2024 09:42:13 +0200 Subject: [PATCH 166/268] try to improve log tests stability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../scanner/plugin-scanner-watcher.test.ts | 148 +++++++++--------- 1 file changed, 71 insertions(+), 77 deletions(-) diff --git a/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner-watcher.test.ts b/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner-watcher.test.ts index 2d017d805b..aead788829 100644 --- a/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner-watcher.test.ts +++ b/packages/backend-dynamic-feature-service/src/scanner/plugin-scanner-watcher.test.ts @@ -125,7 +125,7 @@ describe('plugin-scanner', () => { }); expect(logger.logs).toEqual({ - infos: [ + infos: expect.arrayContaining([ { message: `rootDirectory changed (addDir - ${path.resolve( backstageRootDirectory, @@ -138,7 +138,7 @@ describe('plugin-scanner', () => { 'first-dir/test-backend-plugin/package.json', )}): scanning plugins again`, }, - ], + ]), }); logger.logs = {}; @@ -156,14 +156,14 @@ describe('plugin-scanner', () => { }); expect(logger.logs).toEqual({ - infos: [ + infos: expect.arrayContaining([ { message: `rootDirectory changed in Config from '${path.resolve( backstageRootDirectory, 'first-dir', )}' to '${path.resolve(backstageRootDirectory, 'second-dir')}'`, }, - ], + ]), }); logger.logs = {}; @@ -212,7 +212,7 @@ describe('plugin-scanner', () => { }); expect(logger.logs).toEqual({ - infos: [ + infos: expect.arrayContaining([ { message: `rootDirectory changed (addDir - ${path.resolve( backstageRootDirectory, @@ -225,7 +225,7 @@ describe('plugin-scanner', () => { 'second-dir/second-test-backend-plugin/package.json', )}): scanning plugins again`, }, - ], + ]), }); logger.logs = {}; @@ -291,41 +291,37 @@ describe('plugin-scanner', () => { expect(info).toHaveBeenCalledTimes(0); debug.mockClear(); - const onWindows = path.sep === '\\'; // Order of events is not fixed on Windows. // Windows sometimes even adds a 'change' event when a file is unlinked. // So let's not try to tes the detail of received events on Windows - if (!onWindows) { - // eslint-disable-next-line - expect(logger.logs).toEqual({ - debugs: [ - { - message: `rootDirectory changed (addDir - ${path.resolve( - backstageRootDirectory, - 'second-dir/second-test-backend-plugin/sub-directory', - )}): no need to scan plugins again`, - }, - { - message: `rootDirectory changed (add - ${path.resolve( - backstageRootDirectory, - 'second-dir/second-test-backend-plugin/not-package.json', - )}): no need to scan plugins again`, - }, - { - message: `rootDirectory changed (unlink - ${path.resolve( - backstageRootDirectory, - 'second-dir/second-test-backend-plugin/not-package.json', - )}): no need to scan plugins again`, - }, - { - message: `rootDirectory changed (unlinkDir - ${path.resolve( - backstageRootDirectory, - 'second-dir/second-test-backend-plugin/sub-directory', - )}): no need to scan plugins again`, - }, - ], - }); - } + expect(logger.logs).toEqual({ + debugs: expect.arrayContaining([ + { + message: `rootDirectory changed (addDir - ${path.resolve( + backstageRootDirectory, + 'second-dir/second-test-backend-plugin/sub-directory', + )}): no need to scan plugins again`, + }, + { + message: `rootDirectory changed (add - ${path.resolve( + backstageRootDirectory, + 'second-dir/second-test-backend-plugin/not-package.json', + )}): no need to scan plugins again`, + }, + { + message: `rootDirectory changed (unlink - ${path.resolve( + backstageRootDirectory, + 'second-dir/second-test-backend-plugin/not-package.json', + )}): no need to scan plugins again`, + }, + { + message: `rootDirectory changed (unlinkDir - ${path.resolve( + backstageRootDirectory, + 'second-dir/second-test-backend-plugin/sub-directory', + )}): no need to scan plugins again`, + }, + ]), + }); logger.logs = {}; // Now check that removal of some plugin home directory triggers a new scan of plugins @@ -346,39 +342,40 @@ describe('plugin-scanner', () => { expect(scannedPlugins).toEqual([]); }); - if (!onWindows) { - // eslint-disable-next-line - expect(logger.logs.infos).toEqual([ + expect(logger.logs.infos).toEqual( + expect.arrayContaining([ { message: `rootDirectory changed (unlink - ${path.resolve( backstageRootDirectory, 'second-dir/second-test-backend-plugin/package.json', )}): scanning plugins again`, }, - ]); - } - expect(logger.logs.errors).toEqual([ - { - message: `failed to load dynamic plugin manifest from '${path.resolve( - backstageRootDirectory, - 'second-dir/second-test-backend-plugin', - )}'`, - meta: { - code: 'ENOENT', - errno: path.sep === '\\' ? -4058 : -2, - message: `ENOENT: no such file or directory, open '${path.resolve( + ]), + ); + expect(logger.logs.errors).toEqual( + expect.arrayContaining([ + { + message: `failed to load dynamic plugin manifest from '${path.resolve( backstageRootDirectory, - 'second-dir/second-test-backend-plugin/package.json', + 'second-dir/second-test-backend-plugin', )}'`, - name: 'Error', - path: `${path.resolve( - backstageRootDirectory, - 'second-dir/second-test-backend-plugin/package.json', - )}`, - syscall: 'open', + meta: { + code: 'ENOENT', + errno: path.sep === '\\' ? -4058 : -2, + message: `ENOENT: no such file or directory, open '${path.resolve( + backstageRootDirectory, + 'second-dir/second-test-backend-plugin/package.json', + )}'`, + name: 'Error', + path: `${path.resolve( + backstageRootDirectory, + 'second-dir/second-test-backend-plugin/package.json', + )}`, + syscall: 'open', + }, }, - }, - ]); + ]), + ); logger.logs = {}; await rm( @@ -394,19 +391,16 @@ describe('plugin-scanner', () => { }); rootDirectorySubscriber.mockClear(); - if (!onWindows) { - // eslint-disable-next-line - expect(logger.logs).toEqual({ - infos: [ - { - message: `rootDirectory changed (unlinkDir - ${path.resolve( - backstageRootDirectory, - 'second-dir/second-test-backend-plugin', - )}): scanning plugins again`, - }, - ], - }); - } + expect(logger.logs).toEqual({ + infos: expect.arrayContaining([ + { + message: `rootDirectory changed (unlinkDir - ${path.resolve( + backstageRootDirectory, + 'second-dir/second-test-backend-plugin', + )}): scanning plugins again`, + }, + ]), + }); logger.logs = {}; getOptional.mockReturnValue({ @@ -415,7 +409,7 @@ describe('plugin-scanner', () => { await onConfigChange!(); expect(logger.logs).toEqual({ - errors: [ + errors: expect.arrayContaining([ { message: 'failed to apply new config for dynamic plugins', meta: { @@ -432,7 +426,7 @@ Please add '${path.resolve( name: 'Error', }, }, - ], + ]), }); }, 120000); }); From 66e5f619aa6bc40944dd85b795b93de870d302b3 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 15 Oct 2024 09:55:54 +0200 Subject: [PATCH 167/268] chore: exit pre Signed-off-by: blam --- .changeset/pre.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index e1c8fb99d1..7444e718da 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,5 +1,5 @@ { - "mode": "pre", + "mode": "exit", "tag": "next", "initialVersions": { "example-app": "0.2.101", From c6b69c8076813995b289a47451f6ce522d8a944c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 15 Oct 2024 09:58:11 +0200 Subject: [PATCH 168/268] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- microsite/yarn.lock | 87 +++++---------------------------------------- 1 file changed, 8 insertions(+), 79 deletions(-) diff --git a/microsite/yarn.lock b/microsite/yarn.lock index 2369c7d77d..89104a1be6 100644 --- a/microsite/yarn.lock +++ b/microsite/yarn.lock @@ -2354,7 +2354,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.20, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9": +"@jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.20, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.25 resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: @@ -3069,14 +3069,7 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:^1.0.0": - version: 1.0.1 - resolution: "@types/estree@npm:1.0.1" - checksum: e9aa175eacb797216fafce4d41e8202c7a75555bc55232dee0f9903d7171f8f19f0ae7d5191bb1a88cb90e65468be508c0df850a9fb81b4433b293a5a749899d - languageName: node - linkType: hard - -"@types/estree@npm:^1.0.5": +"@types/estree@npm:*, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.5": version: 1.0.6 resolution: "@types/estree@npm:1.0.6" checksum: 8825d6e729e16445d9a1dd2fb1db2edc5ed400799064cd4d028150701031af012ba30d6d03fe9df40f4d7a437d0de6d2b256020152b7b09bde9f2e420afdffd9 @@ -4169,21 +4162,7 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.23.0, browserslist@npm:^4.23.1, browserslist@npm:^4.23.3": - version: 4.23.3 - resolution: "browserslist@npm:4.23.3" - dependencies: - caniuse-lite: ^1.0.30001646 - electron-to-chromium: ^1.5.4 - node-releases: ^2.0.18 - update-browserslist-db: ^1.1.0 - bin: - browserslist: cli.js - checksum: 7906064f9970aeb941310b2fcb8b4ace4a1b50aa657c986677c6f1553a8cabcc94ee9c5922f715baffbedaa0e6cf0831b6fed7b059dde6873a4bfadcbe069c7e - languageName: node - linkType: hard - -"browserslist@npm:^4.21.10": +"browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.21.10, browserslist@npm:^4.23.0, browserslist@npm:^4.23.1, browserslist@npm:^4.23.3": version: 4.24.0 resolution: "browserslist@npm:4.24.0" dependencies: @@ -4322,14 +4301,7 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001646": - version: 1.0.30001653 - resolution: "caniuse-lite@npm:1.0.30001653" - checksum: 289cf06c26a46f3e6460ccd5feffa788ab0ab35d306898c48120c65cfb11959bfa560e9f739393769b4fd01150c69b0747ad3ad5ec3abf3dfafd66df3c59254e - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001663": +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001646, caniuse-lite@npm:^1.0.30001663": version: 1.0.30001668 resolution: "caniuse-lite@npm:1.0.30001668" checksum: ce6996901b5883454a8ddb3040f82342277b6a6275876dfefcdecb11f7e472e29877f34cae47c2b674f08f2e71971dd4a2acb9bc01adfe8421b7148a7e9e8297 @@ -5460,13 +5432,6 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.5.4": - version: 1.5.13 - resolution: "electron-to-chromium@npm:1.5.13" - checksum: f18ac84dd3bf9a200654a6a9292b9ec4bced0cf9bd26cec9941b775f4470c581c9d043e70b37a124d9752dcc0f47fc96613d52b2defd8e59632852730cb418b9 - languageName: node - linkType: hard - "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -6374,14 +6339,14 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:4.2.10, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:4.2.10": version: 4.2.10 resolution: "graceful-fs@npm:4.2.10" checksum: 3f109d70ae123951905d85032ebeae3c2a5a7a997430df00ea30df0e3a6c60cf6689b109654d6fdacd28810a053348c4d14642da1d075049e6be1ba5216218da languageName: node linkType: hard -"graceful-fs@npm:^4.2.11": +"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 @@ -11450,7 +11415,7 @@ __metadata: languageName: node linkType: hard -"terser-webpack-plugin@npm:^5.3.10": +"terser-webpack-plugin@npm:^5.3.10, terser-webpack-plugin@npm:^5.3.9": version: 5.3.10 resolution: "terser-webpack-plugin@npm:5.3.10" dependencies: @@ -11472,43 +11437,7 @@ __metadata: languageName: node linkType: hard -"terser-webpack-plugin@npm:^5.3.9": - version: 5.3.9 - resolution: "terser-webpack-plugin@npm:5.3.9" - dependencies: - "@jridgewell/trace-mapping": ^0.3.17 - jest-worker: ^27.4.5 - schema-utils: ^3.1.1 - serialize-javascript: ^6.0.1 - terser: ^5.16.8 - peerDependencies: - webpack: ^5.1.0 - peerDependenciesMeta: - "@swc/core": - optional: true - esbuild: - optional: true - uglify-js: - optional: true - checksum: 41705713d6f9cb83287936b21e27c658891c78c4392159f5148b5623f0e8c48559869779619b058382a4c9758e7820ea034695e57dc7c474b4962b79f553bc5f - languageName: node - linkType: hard - -"terser@npm:^5.10.0, terser@npm:^5.15.1, terser@npm:^5.16.8": - version: 5.21.0 - resolution: "terser@npm:5.21.0" - dependencies: - "@jridgewell/source-map": ^0.3.3 - acorn: ^8.8.2 - commander: ^2.20.0 - source-map-support: ~0.5.20 - bin: - terser: bin/terser - checksum: 130f1567af1ffa4ddb067651bb284a01b45b5c83e82b3a072a5ff94b0b00ac35090f89c8714631a4a45972f65187bc149fc7144380611f437e1e3d9e174b136b - languageName: node - linkType: hard - -"terser@npm:^5.26.0": +"terser@npm:^5.10.0, terser@npm:^5.15.1, terser@npm:^5.26.0": version: 5.34.1 resolution: "terser@npm:5.34.1" dependencies: From a05dabf919235789f6435b56533c6d605c3efc9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:15:41 +0000 Subject: [PATCH 169/268] chore(deps): update dependency @rspack/core to v1.0.11 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 88 +++++++++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/yarn.lock b/yarn.lock index f44d4d2f38..a606dee622 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15151,82 +15151,82 @@ __metadata: languageName: node linkType: hard -"@rspack/binding-darwin-arm64@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-darwin-arm64@npm:1.0.10" +"@rspack/binding-darwin-arm64@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-darwin-arm64@npm:1.0.11" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rspack/binding-darwin-x64@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-darwin-x64@npm:1.0.10" +"@rspack/binding-darwin-x64@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-darwin-x64@npm:1.0.11" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rspack/binding-linux-arm64-gnu@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-linux-arm64-gnu@npm:1.0.10" +"@rspack/binding-linux-arm64-gnu@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-linux-arm64-gnu@npm:1.0.11" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rspack/binding-linux-arm64-musl@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-linux-arm64-musl@npm:1.0.10" +"@rspack/binding-linux-arm64-musl@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-linux-arm64-musl@npm:1.0.11" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rspack/binding-linux-x64-gnu@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-linux-x64-gnu@npm:1.0.10" +"@rspack/binding-linux-x64-gnu@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-linux-x64-gnu@npm:1.0.11" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rspack/binding-linux-x64-musl@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-linux-x64-musl@npm:1.0.10" +"@rspack/binding-linux-x64-musl@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-linux-x64-musl@npm:1.0.11" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rspack/binding-win32-arm64-msvc@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-win32-arm64-msvc@npm:1.0.10" +"@rspack/binding-win32-arm64-msvc@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-win32-arm64-msvc@npm:1.0.11" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rspack/binding-win32-ia32-msvc@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-win32-ia32-msvc@npm:1.0.10" +"@rspack/binding-win32-ia32-msvc@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-win32-ia32-msvc@npm:1.0.11" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rspack/binding-win32-x64-msvc@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding-win32-x64-msvc@npm:1.0.10" +"@rspack/binding-win32-x64-msvc@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding-win32-x64-msvc@npm:1.0.11" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@rspack/binding@npm:1.0.10": - version: 1.0.10 - resolution: "@rspack/binding@npm:1.0.10" +"@rspack/binding@npm:1.0.11": + version: 1.0.11 + resolution: "@rspack/binding@npm:1.0.11" dependencies: - "@rspack/binding-darwin-arm64": 1.0.10 - "@rspack/binding-darwin-x64": 1.0.10 - "@rspack/binding-linux-arm64-gnu": 1.0.10 - "@rspack/binding-linux-arm64-musl": 1.0.10 - "@rspack/binding-linux-x64-gnu": 1.0.10 - "@rspack/binding-linux-x64-musl": 1.0.10 - "@rspack/binding-win32-arm64-msvc": 1.0.10 - "@rspack/binding-win32-ia32-msvc": 1.0.10 - "@rspack/binding-win32-x64-msvc": 1.0.10 + "@rspack/binding-darwin-arm64": 1.0.11 + "@rspack/binding-darwin-x64": 1.0.11 + "@rspack/binding-linux-arm64-gnu": 1.0.11 + "@rspack/binding-linux-arm64-musl": 1.0.11 + "@rspack/binding-linux-x64-gnu": 1.0.11 + "@rspack/binding-linux-x64-musl": 1.0.11 + "@rspack/binding-win32-arm64-msvc": 1.0.11 + "@rspack/binding-win32-ia32-msvc": 1.0.11 + "@rspack/binding-win32-x64-msvc": 1.0.11 dependenciesMeta: "@rspack/binding-darwin-arm64": optional: true @@ -15246,16 +15246,16 @@ __metadata: optional: true "@rspack/binding-win32-x64-msvc": optional: true - checksum: a7add6fe37706dfc7dd937da36590b0d6b6b1c5d2acd97b8c2e773769ef128012e6d797b1b30a2ea0f12a284ef3cd131e4b0158eb33ce50717c04ac2cd220e70 + checksum: 2c9fb2585b402eb6d5471b5bbb6131aac279dc6ff89e83424c764092218eb4b9bcfcf384f8ee8e7fb25276fe3f8aa7264c2c6afc2bc3be2544b91a6715cb76c2 languageName: node linkType: hard "@rspack/core@npm:^1.0.10": - version: 1.0.10 - resolution: "@rspack/core@npm:1.0.10" + version: 1.0.11 + resolution: "@rspack/core@npm:1.0.11" dependencies: "@module-federation/runtime-tools": 0.5.1 - "@rspack/binding": 1.0.10 + "@rspack/binding": 1.0.11 "@rspack/lite-tapable": 1.0.1 caniuse-lite: ^1.0.30001616 peerDependencies: @@ -15263,7 +15263,7 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 7e65516c613a1694e3a4585ddaaae4c3e4ac48eb104598fb41c56a22d198152b1384c87f56b36e2589d90353b1e5fd8575a28352ff235bbaa6746972d37f04b8 + checksum: 3675eb1b422367b4dc2edfa650c6fbf27ce27d925251fff1d3d3c0d7c6a5a25376bcd23fae6b1c3095221e2b524267c00832d63bc594fb82747eb94b92454677 languageName: node linkType: hard From 2c84d021367d7500693ed1755a4a84c4dea600c9 Mon Sep 17 00:00:00 2001 From: Peter Macdonald Date: Tue, 15 Oct 2024 10:32:41 +0200 Subject: [PATCH 170/268] add docs SIG to codeowners Signed-off-by: Peter Macdonald --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a0c83a42bd..a98eb37c95 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,6 +9,7 @@ yarn.lock @backstage/maintainers @backst */yarn.lock @backstage/maintainers @backstage-service /.changeset/*.md /beps/0001-notifications-system @backstage/maintainers @backstage/notifications-maintainers +/docs/*.md @parsifal-m @awanlin @aramissennyeydd /docs/assets/search @backstage/search-maintainers /docs/features/search @backstage/search-maintainers /docs/features/techdocs @backstage/techdocs-maintainers From 355e530470904434c96579794d0b4fd124cfdd3b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:40:56 +0000 Subject: [PATCH 171/268] chore(deps): update dependency @useoptic/optic to v1.0.4 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 68 +++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/yarn.lock b/yarn.lock index f44d4d2f38..1948762368 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19729,24 +19729,24 @@ __metadata: languageName: node linkType: hard -"@useoptic/json-pointer-helpers@npm:1.0.3": - version: 1.0.3 - resolution: "@useoptic/json-pointer-helpers@npm:1.0.3" +"@useoptic/json-pointer-helpers@npm:1.0.4": + version: 1.0.4 + resolution: "@useoptic/json-pointer-helpers@npm:1.0.4" dependencies: jsonpointer: ^5.0.1 minimatch: 9.0.3 - checksum: 14099c92d0ac405ccd8a95af3288e03962ec826f3bd93c2c54345b56db30c9da34d9415f3dc63dca302c4f61a744d6c3f6055a3e5b50570db91ed136334816a8 + checksum: 7a10083bc0111cc2fb4734f666be8fea87447c61725c09ceb08876dcbf642056c60f36e48070961150d9d9b4a1c533e9b7cd007ed574956a23377b8afcf077e5 languageName: node linkType: hard -"@useoptic/openapi-io@npm:1.0.3": - version: 1.0.3 - resolution: "@useoptic/openapi-io@npm:1.0.3" +"@useoptic/openapi-io@npm:1.0.4": + version: 1.0.4 + resolution: "@useoptic/openapi-io@npm:1.0.4" dependencies: "@apidevtools/json-schema-ref-parser": 9.0.9 "@jsdevtools/ono": ^7.1.3 - "@useoptic/json-pointer-helpers": 1.0.3 - "@useoptic/openapi-utilities": 1.0.3 + "@useoptic/json-pointer-helpers": 1.0.4 + "@useoptic/openapi-utilities": 1.0.4 ajv: 8.17.1 ajv-errors: ~3.0.0 ajv-formats: ~2.1.0 @@ -19764,15 +19764,15 @@ __metadata: upath: ^2.0.1 yaml: ^2.3.2 yaml-ast-parser: ^0.0.43 - checksum: 9087e7b15ded2379506b2bd64ae2898aea51c3f126d98a399d704dae8442d7f2246c407b740a1b1249b731eb28b6a7c5ee6533126441be74287a9d804e96e33b + checksum: 418ce7ebc332334a97d3f684753e608b591a72ff555f5766ac2e6ceb141865447ec8cdbff46e3e51e7afab0070aa28c7e9547ef48bc3cf568dced80834765d1b languageName: node linkType: hard -"@useoptic/openapi-utilities@npm:1.0.3": - version: 1.0.3 - resolution: "@useoptic/openapi-utilities@npm:1.0.3" +"@useoptic/openapi-utilities@npm:1.0.4": + version: 1.0.4 + resolution: "@useoptic/openapi-utilities@npm:1.0.4" dependencies: - "@useoptic/json-pointer-helpers": 1.0.3 + "@useoptic/json-pointer-helpers": 1.0.4 ajv: ^8.6.0 ajv-errors: ~3.0.0 ajv-formats: ~2.1.0 @@ -19789,7 +19789,7 @@ __metadata: ts-invariant: ^0.9.3 url-join: ^4.0.1 yaml-ast-parser: ^0.0.43 - checksum: c6142a55f29e0c4b813b621a70d9f1c937dcdc67ac04da5bd4bb729a58fd0e796ff52db4d55953466a815de306023861cb602c4a1fe60699afa2626368dca6bb + checksum: 2a900d51378f10dbd1f21c8ee0da4988656c4ecfa1bf7a61692001118afe28633805be69024b979001b0f5afc2e40599c0f2c95359cec69bdb968d05907dc490 languageName: node linkType: hard @@ -19819,8 +19819,8 @@ __metadata: linkType: hard "@useoptic/optic@npm:^1.0.0": - version: 1.0.3 - resolution: "@useoptic/optic@npm:1.0.3" + version: 1.0.4 + resolution: "@useoptic/optic@npm:1.0.4" dependencies: "@babel/runtime": ^7.20.6 "@httptoolkit/httpolyglot": ^2.0.1 @@ -19830,10 +19830,10 @@ __metadata: "@sentry/node": ^7.74.0 "@sinclair/typebox": 0.31.28 "@stoplight/spectral-core": ^1.8.1 - "@useoptic/openapi-io": 1.0.3 - "@useoptic/openapi-utilities": 1.0.3 - "@useoptic/rulesets-base": 1.0.3 - "@useoptic/standard-rulesets": 1.0.3 + "@useoptic/openapi-io": 1.0.4 + "@useoptic/openapi-utilities": 1.0.4 + "@useoptic/rulesets-base": 1.0.4 + "@useoptic/standard-rulesets": 1.0.4 ajv: 8.17.1 ajv-formats: ~2.1.0 async-exit-hook: ^2.0.1 @@ -19890,34 +19890,34 @@ __metadata: yaml: ^2.3.4 bin: optic: build/index.js - checksum: 834c0b97eb23e60f440fa5bc1cb31ed3787e8f738b533757c4fecfdbd723c5dcb063f8d7a0ef481dbc36a9b96a05555cd6d80b4a61d9c0449fa7e714ee7f0380 + checksum: a202e87bed38fb4304d7a2f93c3228660b4b039ce1d6f0ac4b2e9fc271cbcb4d5a8592033f30a399cb7aeaad1db161c2c592a378cd9c58e852bd875c06ac2556 languageName: node linkType: hard -"@useoptic/rulesets-base@npm:1.0.3": - version: 1.0.3 - resolution: "@useoptic/rulesets-base@npm:1.0.3" +"@useoptic/rulesets-base@npm:1.0.4": + version: 1.0.4 + resolution: "@useoptic/rulesets-base@npm:1.0.4" dependencies: "@stoplight/spectral-core": ^1.8.1 "@stoplight/spectral-rulesets": ^1.14.1 - "@useoptic/json-pointer-helpers": 1.0.3 - "@useoptic/openapi-utilities": 1.0.3 + "@useoptic/json-pointer-helpers": 1.0.4 + "@useoptic/openapi-utilities": 1.0.4 ajv: ^8.6.0 lodash.pick: ^4.4.0 node-fetch: ^2.6.7 semver: ^7.5.4 bin: rulesets-base: build/index.js - checksum: 6a78f8def8c150a04efd357e63770acd0ba64f3ca7dfe22e7aaa570fb6c94c04b86bb2cf4a52bf1368d186989327bcfcfc5c5b42b70b72aae2c96182f6a90fb9 + checksum: 06a4b885bf429b7804e003eeb2c4de9bb1153dc14e747a6031d535351e933665c554000790071a12d00734b7a58df07717b5c2c6412354fd43ccbca3339a5c81 languageName: node linkType: hard -"@useoptic/standard-rulesets@npm:1.0.3": - version: 1.0.3 - resolution: "@useoptic/standard-rulesets@npm:1.0.3" +"@useoptic/standard-rulesets@npm:1.0.4": + version: 1.0.4 + resolution: "@useoptic/standard-rulesets@npm:1.0.4" dependencies: - "@useoptic/openapi-utilities": 1.0.3 - "@useoptic/rulesets-base": 1.0.3 + "@useoptic/openapi-utilities": 1.0.4 + "@useoptic/rulesets-base": 1.0.4 ajv: ^8.6.0 ajv-draft-04: ^1.0.0 ajv-formats: ~2.1.0 @@ -19928,7 +19928,7 @@ __metadata: whatwg-mimetype: ^3.0.0 bin: standard-rulesets: build/index.js - checksum: 534cff73712d2a62d3e41c4a71afd09628b347ae48d7a8a9bc378539caa1730b7fbf577169018adf8ba57c30b37b6afdca641cb3c84b719b8f193a5749b15014 + checksum: 9948d3930ed6e83fa06d385cb4639928a21e7aaaa81c9dc793563324dd03ab7c3c98175841855b290f5e6c56b7232dee6837b830ff2c5096cacadbd67d6e22a0 languageName: node linkType: hard From 9adfe4675958cdc91d9337204213e2537c27363c Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Tue, 24 Sep 2024 22:35:36 -0500 Subject: [PATCH 172/268] GitLab MR: introduce skip commit action. Signed-off-by: Matt Benson --- .changeset/few-hairs-compare.md | 5 + .../package.json | 1 + .../report.api.md | 2 +- .../src/actions/gitlabMergeRequest.test.ts | 295 +++++++++++++++++- .../src/actions/gitlabMergeRequest.ts | 142 ++++++--- plugins/scaffolder-backend/report.api.md | 2 +- yarn.lock | 1 + 7 files changed, 408 insertions(+), 40 deletions(-) create mode 100644 .changeset/few-hairs-compare.md diff --git a/.changeset/few-hairs-compare.md b/.changeset/few-hairs-compare.md new file mode 100644 index 0000000000..d717e07351 --- /dev/null +++ b/.changeset/few-hairs-compare.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-gitlab': minor +--- + +GitLab MR: introduce 'skip' commit action. diff --git a/plugins/scaffolder-backend-module-gitlab/package.json b/plugins/scaffolder-backend-module-gitlab/package.json index eba3426349..69d92ac5d9 100644 --- a/plugins/scaffolder-backend-module-gitlab/package.json +++ b/plugins/scaffolder-backend-module-gitlab/package.json @@ -55,6 +55,7 @@ "@gitbeaker/node": "^35.8.0", "@gitbeaker/rest": "^39.25.0", "luxon": "^3.0.0", + "winston": "^3.2.1", "yaml": "^2.0.0", "zod": "^3.22.4" }, diff --git a/plugins/scaffolder-backend-module-gitlab/report.api.md b/plugins/scaffolder-backend-module-gitlab/report.api.md index f00055a876..4ed062d21a 100644 --- a/plugins/scaffolder-backend-module-gitlab/report.api.md +++ b/plugins/scaffolder-backend-module-gitlab/report.api.md @@ -193,7 +193,7 @@ export const createPublishGitlabMergeRequestAction: (options: { sourcePath?: string | undefined; targetPath?: string | undefined; token?: string | undefined; - commitAction?: 'auto' | 'update' | 'delete' | 'create' | undefined; + commitAction?: 'auto' | 'update' | 'delete' | 'create' | 'skip' | undefined; projectid?: string | undefined; removeSourceBranch?: boolean | undefined; assignee?: string | undefined; diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.test.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.test.ts index 46e60584c9..cffa5fd666 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.test.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.test.ts @@ -30,6 +30,22 @@ const mockGitlabClient = { }, Branches: { create: jest.fn(), + show: jest.fn(async (_repoID: string | number, name: string) => { + if (['main', 'existing-branch'].includes(name)) { + return { + name, + merged: name === 'main', + protected: name === 'main', + default: name === 'main', + developers_can_push: name !== 'main', + developers_can_merge: name !== 'main', + can_push: name !== 'main', + web_url: `https://foo.bar.baz/owner/repo/-/tree/${name}`, + commit: { message: 'last change' }, + }; + } + throw new Error(`Unknown branch ${name}`); + }), }, Commits: { create: jest.fn(), @@ -83,6 +99,28 @@ const mockGitlabClient = { }, ), }, + RepositoryFiles: { + show: jest.fn( + async (repoID: string | number, filePath: string, ref: string) => { + if (repoID !== 'owner/repo') throw new Error('repo does not exist'); + if (filePath !== 'source/auto.txt') + throw new Error('filePath does not exist'); + return { + file_name: 'auto.txt', + file_path: 'source/auto.txt', + size: 11, + encoding: 'base64', + content: 'Zm9vLWJhci1iYXo=', + content_sha256: + '269dce1a5bb90188b2d9cf542a7c30e410c7d8251e34a97bfea56062df51ae23', + ref, + blob_id: 'a1e8f8d745cc87e3a9248358d9352bb7f9a0aeba', + commit_id: 'd5a3ff139356ce33e37e73add446f16869741b50', + last_commit_id: '570e7b2abdd848b95f2f578043fc23bd6f6fd24d', + }; + }, + ), + }, }; jest.mock('@gitbeaker/node', () => ({ @@ -149,6 +187,7 @@ describe('createGitLabMergeRequest', () => { 'new-mr', 'test', ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -184,6 +223,7 @@ describe('createGitLabMergeRequest', () => { 'new-mr', 'main', ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -191,7 +231,6 @@ describe('createGitLabMergeRequest', () => { 'Create my new MR', { description: 'This MR is really good', removeSourceBranch: false }, ); - expect(ctx.output).toHaveBeenCalledWith('targetBranchName', 'main'); }); }); @@ -216,6 +255,12 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -244,6 +289,12 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -278,6 +329,12 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -311,6 +368,12 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -344,6 +407,12 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -376,6 +445,12 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -404,6 +479,11 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -425,6 +505,16 @@ describe('createGitLabMergeRequest', () => { }, ]), ); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'This MR is really good', + removeSourceBranch: false, + }, + ); }); }); @@ -446,6 +536,11 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -467,6 +562,16 @@ describe('createGitLabMergeRequest', () => { }, ]), ); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'This MR is really good', + removeSourceBranch: false, + }, + ); }); }); @@ -490,6 +595,11 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -504,6 +614,16 @@ describe('createGitLabMergeRequest', () => { }, ], ); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'MR description', + removeSourceBranch: false, + }, + ); }); it('commitAction is update when update is passed in options', async () => { @@ -525,6 +645,11 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -539,6 +664,16 @@ describe('createGitLabMergeRequest', () => { }, ], ); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'MR description', + removeSourceBranch: false, + }, + ); }); it('commitAction is auto when auto is passed in options', async () => { @@ -558,6 +693,11 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -579,6 +719,16 @@ describe('createGitLabMergeRequest', () => { }, ]), ); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'MR description', + removeSourceBranch: false, + }, + ); }); it('commitAction is auto when auto is passed in options with targetPath', async () => { @@ -600,6 +750,11 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -621,6 +776,16 @@ describe('createGitLabMergeRequest', () => { }, ]), ); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'MR description', + removeSourceBranch: false, + }, + ); }); it('commitAction is delete when delete is passed in options', async () => { @@ -642,6 +807,11 @@ describe('createGitLabMergeRequest', () => { const ctx = createMockActionContext({ input, workspacePath }); await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -656,6 +826,119 @@ describe('createGitLabMergeRequest', () => { }, ], ); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'other MR description', + removeSourceBranch: false, + }, + ); + }); + it('commitAction skip skips commit', async () => { + const input = { + repoUrl: 'gitlab.com?repo=repo&owner=owner', + title: 'Create my new MR', + branchName: 'new-mr', + description: 'MR description', + commitAction: 'skip', + }; + const ctx = createMockActionContext({ input, workspacePath }); + await instance.handler(ctx); + + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'MR description', + removeSourceBranch: false, + }, + ); + }); + it('commitAction skip reuses existing branch', async () => { + const input = { + repoUrl: 'gitlab.com?repo=repo&owner=owner', + title: 'Create my new MR', + branchName: 'existing-branch', + description: 'MR description', + commitAction: 'skip', + }; + const ctx = createMockActionContext({ input, workspacePath }); + await instance.handler(ctx); + + expect(mockGitlabClient.Branches.show).toHaveBeenCalledWith( + 'owner/repo', + 'existing-branch', + ); + expect(mockGitlabClient.Branches.create).not.toHaveBeenCalled(); + expect(mockGitlabClient.Commits.create).not.toHaveBeenCalled(); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'existing-branch', + 'main', + 'Create my new MR', + { + description: 'MR description', + removeSourceBranch: false, + }, + ); + }); + it('commitAction auto skips unmodified files', async () => { + const input = { + repoUrl: 'gitlab.com?repo=repo&owner=owner', + title: 'Create my new MR', + branchName: 'new-mr', + description: 'MR description', + commitAction: 'auto', + }; + mockDir.setContent({ + [workspacePath]: { + source: { 'foo.txt': 'Hello there!', 'auto.txt': 'foo-bar-baz' }, + }, + }); + + const ctx = createMockActionContext({ input, workspacePath }); + await instance.handler(ctx); + + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); + expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'Create my new MR', + expect.arrayContaining([ + { + action: 'create', + filePath: 'source/foo.txt', + content: 'SGVsbG8gdGhlcmUh', + encoding: 'base64', + execute_filemode: false, + }, + ]), + ); + expect(mockGitlabClient.MergeRequests.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + 'Create my new MR', + { + description: 'MR description', + removeSourceBranch: false, + }, + ); }); }); @@ -681,6 +964,11 @@ describe('createGitLabMergeRequest', () => { await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', @@ -719,6 +1007,11 @@ describe('createGitLabMergeRequest', () => { await instance.handler(ctx); + expect(mockGitlabClient.Branches.create).toHaveBeenCalledWith( + 'owner/repo', + 'new-mr', + 'main', + ); expect(mockGitlabClient.Commits.create).toHaveBeenCalledWith( 'owner/repo', 'new-mr', diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts index 733365c6df..a719176bd7 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts @@ -20,25 +20,57 @@ import { SerializedFile, serializeDirectoryContents, } from '@backstage/plugin-scaffolder-node'; -import { Types } from '@gitbeaker/core'; +import { Gitlab, Types } from '@gitbeaker/core'; import path from 'path'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { InputError } from '@backstage/errors'; import { resolveSafeChildPath } from '@backstage/backend-plugin-api'; import { createGitlabApi } from './helpers'; import { examples } from './gitlabMergeRequest.examples'; +import { createHash } from 'crypto'; +import { Logger } from 'winston'; -function getFileAction( - fileInfo: { file: SerializedFile; targetPath: string | undefined }, +function computeSha256(file: SerializedFile): string { + const hash = createHash('sha256'); + hash.update(file.content); + return hash.digest('hex'); +} + +async function getFileAction( + fileInfo: { file: SerializedFile; targetPath?: string }, + target: { repoID: string; branch: string }, + api: Gitlab, + ctx: { logger: Logger }, remoteFiles: Types.RepositoryTreeSchema[], - defaultCommitAction: 'create' | 'delete' | 'update' | 'auto' | undefined, -): 'create' | 'delete' | 'update' { - if (!defaultCommitAction || defaultCommitAction === 'auto') { + defaultCommitAction: + | 'create' + | 'delete' + | 'update' + | 'skip' + | 'auto' = 'auto', +): Promise<'create' | 'delete' | 'update' | 'skip'> { + if (defaultCommitAction === 'auto') { const filePath = path.join(fileInfo.targetPath ?? '', fileInfo.file.path); - return remoteFiles && - remoteFiles.some(remoteFile => remoteFile.path === filePath) - ? 'update' - : 'create'; + if (remoteFiles) { + if (remoteFiles.some(remoteFile => remoteFile.path === filePath)) { + try { + const targetFile = await api.RepositoryFiles.show( + target.repoID, + filePath, + target.branch, + ); + if (computeSha256(fileInfo.file) === targetFile.content_sha256) { + return 'skip'; + } + } catch (error) { + ctx.logger.warn( + `Unable to retrieve detailed information for remote file ${filePath}`, + ); + } + return 'update'; + } + } + return 'create'; } return defaultCommitAction; } @@ -62,7 +94,7 @@ export const createPublishGitlabMergeRequestAction = (options: { sourcePath?: string; targetPath?: string; token?: string; - commitAction?: 'create' | 'delete' | 'update' | 'auto'; + commitAction?: 'create' | 'delete' | 'update' | 'skip' | 'auto'; /** @deprecated projectID passed as query parameters in the repoUrl */ projectid?: string; removeSourceBranch?: boolean; @@ -78,7 +110,9 @@ export const createPublishGitlabMergeRequestAction = (options: { repoUrl: { type: 'string', title: 'Repository Location', - description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`, + description: `\ +Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where \ +'project_name' is the repository name and 'group_name' is a group or username`, }, /** @deprecated projectID is passed as query parameters in the repoUrl */ projectid: { @@ -109,8 +143,11 @@ export const createPublishGitlabMergeRequestAction = (options: { sourcePath: { type: 'string', title: 'Working Subdirectory', - description: - 'Subdirectory of working directory to copy changes from', + description: `\ +Subdirectory of working directory to copy changes from. \ +For reasons of backward compatibility, any specified 'targetPath' input will \ +be applied in place of an absent/falsy value for this input. \ +Circumvent this behavior using '.'`, }, targetPath: { type: 'string', @@ -126,8 +163,9 @@ export const createPublishGitlabMergeRequestAction = (options: { title: 'Commit action', type: 'string', enum: ['create', 'update', 'delete', 'auto'], - description: - 'The action to be used for git commit. Defaults to auto. "auto" is custom action provide by backstage, (automatic assign create or update action) /!\\ Use more api calls /!\\ *', + description: `\ +The action to be used for git commit. Defaults to the custom 'auto' action provided by backstage, +which uses additional API calls in order to detect whether to 'create', 'update' or 'skip' each source file.`, }, removeSourceBranch: { title: 'Delete source branch', @@ -224,7 +262,7 @@ export const createPublishGitlabMergeRequestAction = (options: { } let remoteFiles: Types.RepositoryTreeSchema[] = []; - if (!ctx.input.commitAction || ctx.input.commitAction === 'auto') { + if ((ctx.input.commitAction ?? 'auto') === 'auto') { try { remoteFiles = await api.Repositories.tree(repoID, { ref: targetBranch, @@ -238,12 +276,26 @@ export const createPublishGitlabMergeRequestAction = (options: { } } - const actions: Types.CommitAction[] = fileContents.map(file => ({ - action: getFileAction( - { file, targetPath }, - remoteFiles, - ctx.input.commitAction, - ), + const actions: Types.CommitAction[] = ( + ( + await Promise.all( + fileContents.map(async file => + getFileAction( + { file, targetPath }, + { repoID, branch: targetBranch! }, + api, + ctx, + remoteFiles, + ctx.input.commitAction, + ).then(action => ({ file, action })), + ), + ) + ).filter(o => o.action !== 'skip') as { + file: SerializedFile; + action: Types.CommitAction['action']; + }[] + ).map(({ file, action }) => ({ + action, filePath: targetPath ? path.posix.join(targetPath, file.path) : file.path, @@ -252,22 +304,38 @@ export const createPublishGitlabMergeRequestAction = (options: { execute_filemode: file.executable, })); - try { - await api.Branches.create(repoID, branchName, String(targetBranch)); - } catch (e) { - throw new InputError( - `The branch creation failed. Please check that your repo does not already contain a branch named '${branchName}'. ${e}`, - ); + let createBranch: boolean; + if (actions.length) { + createBranch = true; + } else { + try { + await api.Branches.show(repoID, branchName); + createBranch = false; + ctx.logger.info( + `Using existing branch ${branchName} without modification.`, + ); + } catch (e) { + createBranch = true; + } } - - try { - await api.Commits.create(repoID, branchName, ctx.input.title, actions); - } catch (e) { - throw new InputError( - `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${e}`, - ); + if (createBranch) { + try { + await api.Branches.create(repoID, branchName, String(targetBranch)); + } catch (e) { + throw new InputError( + `The branch creation failed. Please check that your repo does not already contain a branch named '${branchName}'. ${e}`, + ); + } + } + if (actions.length) { + try { + await api.Commits.create(repoID, branchName, title, actions); + } catch (e) { + throw new InputError( + `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${e}`, + ); + } } - try { const mergeRequestUrl = await api.MergeRequests.create( repoID, diff --git a/plugins/scaffolder-backend/report.api.md b/plugins/scaffolder-backend/report.api.md index d3dddc21e9..5c513d75cd 100644 --- a/plugins/scaffolder-backend/report.api.md +++ b/plugins/scaffolder-backend/report.api.md @@ -334,7 +334,7 @@ export const createPublishGitlabMergeRequestAction: (options: { sourcePath?: string | undefined; targetPath?: string | undefined; token?: string | undefined; - commitAction?: 'auto' | 'update' | 'delete' | 'create' | undefined; + commitAction?: 'auto' | 'update' | 'delete' | 'create' | 'skip' | undefined; projectid?: string | undefined; removeSourceBranch?: boolean | undefined; assignee?: string | undefined; diff --git a/yarn.lock b/yarn.lock index 7361d0ef51..957d4006e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7456,6 +7456,7 @@ __metadata: "@gitbeaker/node": ^35.8.0 "@gitbeaker/rest": ^39.25.0 luxon: ^3.0.0 + winston: ^3.2.1 yaml: ^2.0.0 zod: ^3.22.4 languageName: unknown From 7cdbb244a1959630fee003e7c42e668cd460da5a Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Wed, 25 Sep 2024 09:31:27 -0500 Subject: [PATCH 173/268] improve efficiency when commit is explicitly skipped Signed-off-by: Matt Benson --- .../src/actions/gitlabMergeRequest.ts | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts index a719176bd7..616fdc1fd2 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts @@ -276,33 +276,36 @@ which uses additional API calls in order to detect whether to 'create', 'update' } } - const actions: Types.CommitAction[] = ( - ( - await Promise.all( - fileContents.map(async file => - getFileAction( - { file, targetPath }, - { repoID, branch: targetBranch! }, - api, - ctx, - remoteFiles, - ctx.input.commitAction, - ).then(action => ({ file, action })), - ), - ) - ).filter(o => o.action !== 'skip') as { - file: SerializedFile; - action: Types.CommitAction['action']; - }[] - ).map(({ file, action }) => ({ - action, - filePath: targetPath - ? path.posix.join(targetPath, file.path) - : file.path, - encoding: 'base64', - content: file.content.toString('base64'), - execute_filemode: file.executable, - })); + const actions: Types.CommitAction[] = + ctx.input.commitAction === 'skip' + ? [] + : ( + ( + await Promise.all( + fileContents.map(async file => + getFileAction( + { file, targetPath }, + { repoID, branch: targetBranch! }, + api, + ctx, + remoteFiles, + ctx.input.commitAction, + ).then(action => ({ file, action })), + ), + ) + ).filter(o => o.action !== 'skip') as { + file: SerializedFile; + action: Types.CommitAction['action']; + }[] + ).map(({ file, action }) => ({ + action, + filePath: targetPath + ? path.posix.join(targetPath, file.path) + : file.path, + encoding: 'base64', + content: file.content.toString('base64'), + execute_filemode: file.executable, + })); let createBranch: boolean; if (actions.length) { From 5b6feba582189f02b7d33dafa2d0c708d7234782 Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Tue, 1 Oct 2024 16:01:33 -0500 Subject: [PATCH 174/268] incorporate code review feedback: nesting depth Signed-off-by: Matt Benson --- .../src/actions/gitlabMergeRequest.ts | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts index 616fdc1fd2..58c461c5fa 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts @@ -51,24 +51,23 @@ async function getFileAction( ): Promise<'create' | 'delete' | 'update' | 'skip'> { if (defaultCommitAction === 'auto') { const filePath = path.join(fileInfo.targetPath ?? '', fileInfo.file.path); - if (remoteFiles) { - if (remoteFiles.some(remoteFile => remoteFile.path === filePath)) { - try { - const targetFile = await api.RepositoryFiles.show( - target.repoID, - filePath, - target.branch, - ); - if (computeSha256(fileInfo.file) === targetFile.content_sha256) { - return 'skip'; - } - } catch (error) { - ctx.logger.warn( - `Unable to retrieve detailed information for remote file ${filePath}`, - ); + + if (remoteFiles?.some(remoteFile => remoteFile.path === filePath)) { + try { + const targetFile = await api.RepositoryFiles.show( + target.repoID, + filePath, + target.branch, + ); + if (computeSha256(fileInfo.file) === targetFile.content_sha256) { + return 'skip'; } - return 'update'; + } catch (error) { + ctx.logger.warn( + `Unable to retrieve detailed information for remote file ${filePath}`, + ); } + return 'update'; } return 'create'; } From 368d8db74ac38395d055711ed3f561c86717a6cf Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Tue, 1 Oct 2024 16:21:56 -0500 Subject: [PATCH 175/268] code review: don't mix promise with await Signed-off-by: Matt Benson --- .../src/actions/gitlabMergeRequest.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts index 58c461c5fa..3ef66f5f6f 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts @@ -274,23 +274,23 @@ which uses additional API calls in order to detect whether to 'create', 'update' ); } } - const actions: Types.CommitAction[] = ctx.input.commitAction === 'skip' ? [] : ( ( await Promise.all( - fileContents.map(async file => - getFileAction( + fileContents.map(async file => { + const action = await getFileAction( { file, targetPath }, { repoID, branch: targetBranch! }, api, ctx, remoteFiles, ctx.input.commitAction, - ).then(action => ({ file, action })), - ), + ); + return { file, action }; + }), ) ).filter(o => o.action !== 'skip') as { file: SerializedFile; From fcc073ffd7220e9ef22ba08d53332deba21aba52 Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Tue, 1 Oct 2024 16:25:02 -0500 Subject: [PATCH 176/268] code review: don't pass entire context to file action computation Signed-off-by: Matt Benson --- .../src/actions/gitlabMergeRequest.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts index 3ef66f5f6f..7374aa2648 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts @@ -40,7 +40,7 @@ async function getFileAction( fileInfo: { file: SerializedFile; targetPath?: string }, target: { repoID: string; branch: string }, api: Gitlab, - ctx: { logger: Logger }, + logger: Logger, remoteFiles: Types.RepositoryTreeSchema[], defaultCommitAction: | 'create' @@ -63,7 +63,7 @@ async function getFileAction( return 'skip'; } } catch (error) { - ctx.logger.warn( + logger.warn( `Unable to retrieve detailed information for remote file ${filePath}`, ); } @@ -285,7 +285,7 @@ which uses additional API calls in order to detect whether to 'create', 'update' { file, targetPath }, { repoID, branch: targetBranch! }, api, - ctx, + ctx.logger, remoteFiles, ctx.input.commitAction, ); From be1ec2fd1f076e7989b9594ebcd2d7605fc51717 Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Mon, 7 Oct 2024 09:41:35 -0500 Subject: [PATCH 177/268] Update .changeset/few-hairs-compare.md Co-authored-by: Ben Lambert Signed-off-by: Matt Benson --- .changeset/few-hairs-compare.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/few-hairs-compare.md b/.changeset/few-hairs-compare.md index d717e07351..48cd7b7f25 100644 --- a/.changeset/few-hairs-compare.md +++ b/.changeset/few-hairs-compare.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-scaffolder-backend-module-gitlab': minor +'@backstage/plugin-scaffolder-backend-module-gitlab': patch --- GitLab MR: introduce 'skip' commit action. From 29788ea4e399871d8ecdb13f828aa7babae00bbc Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 15 Oct 2024 11:04:18 +0200 Subject: [PATCH 178/268] chore: move to loggerService instead Signed-off-by: blam --- .../src/actions/gitlabMergeRequest.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts index 7374aa2648..ec9ae7317d 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts @@ -24,11 +24,13 @@ import { Gitlab, Types } from '@gitbeaker/core'; import path from 'path'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { InputError } from '@backstage/errors'; -import { resolveSafeChildPath } from '@backstage/backend-plugin-api'; +import { + LoggerService, + resolveSafeChildPath, +} from '@backstage/backend-plugin-api'; import { createGitlabApi } from './helpers'; import { examples } from './gitlabMergeRequest.examples'; import { createHash } from 'crypto'; -import { Logger } from 'winston'; function computeSha256(file: SerializedFile): string { const hash = createHash('sha256'); @@ -40,7 +42,7 @@ async function getFileAction( fileInfo: { file: SerializedFile; targetPath?: string }, target: { repoID: string; branch: string }, api: Gitlab, - logger: Logger, + logger: LoggerService, remoteFiles: Types.RepositoryTreeSchema[], defaultCommitAction: | 'create' From 52681b23d27c1794b01afe2d18fd14fff33dc9be Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:05:54 +0000 Subject: [PATCH 179/268] chore(deps): update dependency knip to v5.33.3 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7361d0ef51..ad52d7c557 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31815,16 +31815,7 @@ __metadata: languageName: node linkType: hard -"jiti@npm:^1.21.6": - version: 1.21.6 - resolution: "jiti@npm:1.21.6" - bin: - jiti: bin/jiti.js - checksum: 9ea4a70a7bb950794824683ed1c632e2ede26949fbd348e2ba5ec8dc5efa54dc42022d85ae229cadaa60d4b95012e80ea07d625797199b688cc22ab0e8891d32 - languageName: node - linkType: hard - -"jiti@npm:^2.0.0": +"jiti@npm:^2.0.0, jiti@npm:^2.3.3": version: 2.3.3 resolution: "jiti@npm:2.3.3" bin: @@ -32663,15 +32654,15 @@ __metadata: linkType: hard "knip@npm:^5.0.0": - version: 5.30.6 - resolution: "knip@npm:5.30.6" + version: 5.33.3 + resolution: "knip@npm:5.33.3" dependencies: "@nodelib/fs.walk": 1.2.8 "@snyk/github-codeowners": 1.1.0 easy-table: 1.2.0 enhanced-resolve: ^5.17.1 fast-glob: ^3.3.2 - jiti: ^1.21.6 + jiti: ^2.3.3 js-yaml: ^4.1.0 minimist: ^1.2.8 picocolors: ^1.0.0 @@ -32688,7 +32679,7 @@ __metadata: bin: knip: bin/knip.js knip-bun: bin/knip-bun.js - checksum: 9820761248882926789bdf3cf8014a32e695d94bdabc335b4b637bceaeec7922358b67027b46aa5f7f2af10460027d0d33be407d48db76e50c8d1dd8dfca95ce + checksum: 636e26fde892c590a65326d370fc19f1d73575ac014fb84d55d67a71dc05ea0ba2114ae587ba0192232b4ac1094710ee7d9582cf3bbe0773f6c667c0bba9b3e4 languageName: node linkType: hard From edb98bfe05dd9bb394528f8a0dd62632b23a37c9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:44:54 +0000 Subject: [PATCH 180/268] chore(deps): update dependency webpack to v5.95.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- storybook/yarn.lock | 6 +++--- yarn.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/storybook/yarn.lock b/storybook/yarn.lock index 55e44f3a8b..553248324d 100644 --- a/storybook/yarn.lock +++ b/storybook/yarn.lock @@ -11830,8 +11830,8 @@ __metadata: linkType: hard "webpack@npm:^5.73.0": - version: 5.94.0 - resolution: "webpack@npm:5.94.0" + version: 5.95.0 + resolution: "webpack@npm:5.95.0" dependencies: "@types/estree": ^1.0.5 "@webassemblyjs/ast": ^1.12.1 @@ -11861,7 +11861,7 @@ __metadata: optional: true bin: webpack: bin/webpack.js - checksum: 6a3d667be304a69cd6dcb8d676bc29f47642c0d389af514cfcd646eaaa809961bc6989fc4b2621a717dfc461130f29c6e20006d62a32e012dafaa9517813a4e6 + checksum: 0c3dfe288de4d62f8f3dc25478a618894883cab739121330763b7847e43304630ea2815ae2351a5f8ff6ab7c9642caf530d503d89bda261fe2cd220e524dd5d1 languageName: node linkType: hard diff --git a/yarn.lock b/yarn.lock index f3f2c7beaa..5907b90cce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44877,8 +44877,8 @@ __metadata: linkType: hard "webpack@npm:^5, webpack@npm:^5.70.0": - version: 5.94.0 - resolution: "webpack@npm:5.94.0" + version: 5.95.0 + resolution: "webpack@npm:5.95.0" dependencies: "@types/estree": ^1.0.5 "@webassemblyjs/ast": ^1.12.1 @@ -44908,7 +44908,7 @@ __metadata: optional: true bin: webpack: bin/webpack.js - checksum: 6a3d667be304a69cd6dcb8d676bc29f47642c0d389af514cfcd646eaaa809961bc6989fc4b2621a717dfc461130f29c6e20006d62a32e012dafaa9517813a4e6 + checksum: 0c3dfe288de4d62f8f3dc25478a618894883cab739121330763b7847e43304630ea2815ae2351a5f8ff6ab7c9642caf530d503d89bda261fe2cd220e524dd5d1 languageName: node linkType: hard From a9c095d0bee2f810e6dbe05ec540a763f1f1e647 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 15 Oct 2024 10:25:03 +0000 Subject: [PATCH 181/268] Version Packages --- .changeset/angry-cycles-call.md | 5 - .changeset/angry-mayflies-collect.md | 5 - .changeset/angry-windows-decide.md | 5 - .changeset/beige-ghosts-enjoy.md | 5 - .changeset/big-rules-nail.md | 5 - .changeset/breezy-berries-yawn.md | 5 - .changeset/breezy-bulldogs-smell.md | 5 - .changeset/bright-mails-compare.md | 9 - .changeset/brown-frogs-walk.md | 17 - .changeset/brown-hotels-move.md | 7 - .changeset/calm-owls-move.md | 5 - .changeset/chair-fairs-drive.md | 9 - .changeset/chilled-dolphins-join.md | 5 - .changeset/chilled-melons-smash.md | 20 - .changeset/chilly-meals-sniff.md | 5 - .changeset/clever-paws-stare.md | 5 - .changeset/clever-rats-rush.md | 5 - .changeset/cold-nails-rescue.md | 5 - .changeset/crash-loop-baby.md | 6 - .changeset/crash-loop-honey.md | 5 - .changeset/crash-loop-yeah.md | 5 - .changeset/create-app-1727774359.md | 5 - .changeset/create-app-1728387650.md | 5 - .changeset/cuddly-stingrays-smell.md | 18 - .changeset/curly-foxes-brake.md | 5 - .changeset/curly-tomatoes-reply.md | 5 - .changeset/cyan-cooks-sing.md | 5 - .changeset/cyan-peaches-lay.md | 5 - .changeset/cyan-suits-battle.md | 5 - .changeset/cyan-vans-study.md | 5 - .changeset/dependabot-a3fd85a.md | 7 - .changeset/dry-frogs-drum.md | 5 - .changeset/early-drinks-kneel.md | 6 - .changeset/early-sloths-cross.md | 49 - .changeset/eight-clocks-complain.md | 5 - .changeset/eight-steaks-chew.md | 6 - .changeset/eighty-mice-turn.md | 5 - .changeset/eleven-beds-play.md | 5 - .changeset/eleven-pugs-hear.md | 6 - .changeset/fair-chairs-drive.md | 5 - .changeset/famous-bobcats-remain.md | 5 - .changeset/few-hairs-compare.md | 5 - .changeset/fifty-trainers-watch.md | 6 - .changeset/five-gorillas-pay.md | 5 - .changeset/five-turkeys-taste.md | 5 - .changeset/flat-eels-exist.md | 5 - .changeset/flat-seals-type.md | 5 - .changeset/fluffy-dogs-mate.md | 8 - .changeset/fluffy-dolphins-battle.md | 5 - .changeset/fluffy-pears-cry.md | 6 - .changeset/four-moons-watch.md | 5 - .changeset/friendly-coins-approve.md | 5 - .changeset/friendly-cougars-return.md | 5 - .changeset/funny-dancers-drum.md | 5 - .changeset/funny-rocks-train.md | 6 - .changeset/fuzzy-elephants-tease.md | 5 - .changeset/giant-kiwis-retire.md | 5 - .changeset/gold-pots-end.md | 5 - .changeset/good-eels-drive.md | 5 - .changeset/good-trainers-appear.md | 5 - .changeset/gorgeous-months-fix.md | 5 - .changeset/great-eagles-repair.md | 5 - .changeset/green-berries-wave.md | 5 - .changeset/green-bottles-live.md | 6 - .changeset/green-cooks-sort.md | 5 - .changeset/happy-ligers-think.md | 5 - .changeset/healthy-shoes-judge.md | 5 - .changeset/healthy-years-search.md | 7 - .changeset/heavy-ties-tell.md | 5 - .changeset/honest-impalas-rescue.md | 5 - .changeset/hungry-buckets-repair.md | 5 - .changeset/kind-avocados-speak.md | 8 - .changeset/large-hats-reply.md | 5 - .changeset/large-plants-rhyme.md | 30 - .changeset/lemon-badgers-share.md | 5 - .changeset/lemon-pumpkins-lick.md | 11 - .changeset/light-rats-travel.md | 54 - .changeset/long-humans-hunt.md | 5 - .changeset/loud-hotels-tan.md | 5 - .changeset/lovely-bees-walk.md | 5 - .changeset/lovely-jokes-breathe.md | 32 - .changeset/lucky-mugs-drive.md | 5 - .changeset/mighty-forks-exercise.md | 6 - .changeset/mighty-terms-peel.md | 5 - .changeset/nasty-geese-repeat.md | 5 - .changeset/nasty-lamps-greet.md | 5 - .changeset/neat-geckos-end.md | 5 - .changeset/nice-badgers-travel.md | 5 - .changeset/olive-walls-wave.md | 5 - .changeset/pink-sheep-dress.md | 8 - .changeset/polite-days-flash.md | 5 - .changeset/poor-dodos-wait.md | 5 - .changeset/popular-items-retire.md | 5 - .changeset/pre.json | 314 -- .changeset/pretty-buses-repair.md | 5 - .changeset/pretty-pans-exist.md | 5 - .changeset/pretty-plants-hammer.md | 5 - .changeset/purple-toys-heal.md | 5 - .changeset/quiet-dingos-bathe.md | 5 - .changeset/quiet-islands-learn.md | 5 - .changeset/quiet-lions-lie.md | 6 - .changeset/quiet-needles-impress.md | 5 - .changeset/rare-crabs-cheat.md | 5 - .changeset/rare-rabbits-flow.md | 29 - .changeset/real-rockets-divide.md | 5 - .changeset/real-tigers-punch.md | 5 - .changeset/renovate-156753b.md | 7 - .changeset/renovate-6eaf36e.md | 11 - .changeset/renovate-7874fad.md | 5 - .changeset/renovate-85a184e.md | 15 - .changeset/renovate-87a3bd2.md | 5 - .changeset/renovate-966d123.md | 5 - .changeset/renovate-9f7136b.md | 5 - .changeset/renovate-cc4bfa7.md | 5 - .changeset/renovate-d7e90e4.md | 6 - .changeset/renovate-f88b005.md | 7 - .changeset/rich-deers-attend.md | 7 - .changeset/rich-needles-collect.md | 5 - .changeset/rotten-camels-deny.md | 5 - .changeset/rotten-rockets-deny.md | 5 - .changeset/rude-apricots-eat.md | 6 - .changeset/shaggy-weeks-hunt.md | 5 - .changeset/sharp-lamps-fix.md | 5 - .changeset/shy-olives-swim.md | 11 - .changeset/shy-plants-retire.md | 5 - .changeset/silly-geckos-learn.md | 5 - .changeset/silly-ligers-tan.md | 5 - .changeset/silly-readers-build.md | 5 - .changeset/silver-comics-attend.md | 5 - .changeset/slimy-ravens-end.md | 6 - .changeset/slow-gorillas-thank.md | 9 - .changeset/slow-trees-compare.md | 8 - .changeset/slow-walls-report.md | 13 - .changeset/small-donkeys-attack.md | 7 - .changeset/smart-jobs-sit.md | 5 - .changeset/sour-grapes-trade.md | 5 - .changeset/sour-phones-fix.md | 5 - .changeset/stale-ravens-clap.md | 5 - .changeset/stale-roses-serve.md | 5 - .changeset/strange-bees-attack.md | 5 - .changeset/strong-monkeys-melt.md | 5 - .changeset/sweet-chicken-smash.md | 14 - .changeset/ten-apes-turn.md | 5 - .changeset/ten-rings-look.md | 5 - .changeset/thick-tables-give.md | 5 - .changeset/thin-chairs-ring.md | 14 - .changeset/thin-doors-rule.md | 5 - .changeset/thirty-pets-fry.md | 8 - .changeset/thirty-pianos-mix.md | 6 - .changeset/tiny-pugs-kick.md | 5 - .changeset/tough-fireants-itch.md | 6 - .changeset/tough-pillows-sip.md | 5 - .changeset/tricky-shoes-lie.md | 10 - .changeset/twenty-cups-knock.md | 5 - .changeset/two-plums-fail.md | 5 - .changeset/violet-beds-promise.md | 6 - .changeset/weak-bottles-cross.md | 5 - docs/releases/v1.32.0-changelog.md | 2740 +++++++++++++++++ package.json | 2 +- packages/app-defaults/CHANGELOG.md | 14 + packages/app-defaults/package.json | 2 +- packages/app-next-example-plugin/CHANGELOG.md | 8 + packages/app-next-example-plugin/package.json | 2 +- packages/app-next/CHANGELOG.md | 45 + packages/app-next/package.json | 2 +- packages/app/CHANGELOG.md | 41 + packages/app/package.json | 2 +- packages/backend-app-api/CHANGELOG.md | 21 + packages/backend-app-api/package.json | 2 +- packages/backend-defaults/CHANGELOG.md | 40 + packages/backend-defaults/package.json | 2 +- .../CHANGELOG.md | 38 + .../package.json | 2 +- packages/backend-legacy/CHANGELOG.md | 41 + packages/backend-legacy/package.json | 2 +- packages/backend-openapi-utils/CHANGELOG.md | 13 + packages/backend-openapi-utils/package.json | 2 +- packages/backend-plugin-api/CHANGELOG.md | 12 + packages/backend-plugin-api/package.json | 2 +- packages/backend-test-utils/CHANGELOG.md | 17 + packages/backend-test-utils/package.json | 2 +- packages/backend/CHANGELOG.md | 37 + packages/backend/package.json | 2 +- packages/catalog-client/CHANGELOG.md | 9 + packages/catalog-client/package.json | 2 +- packages/cli-node/CHANGELOG.md | 10 + packages/cli-node/package.json | 2 +- packages/cli/CHANGELOG.md | 53 + packages/cli/package.json | 2 +- packages/codemods/CHANGELOG.md | 8 + packages/codemods/package.json | 2 +- packages/core-app-api/CHANGELOG.md | 11 + packages/core-app-api/package.json | 2 +- packages/core-compat-api/CHANGELOG.md | 11 + packages/core-compat-api/package.json | 2 +- packages/core-components/CHANGELOG.md | 17 + packages/core-components/package.json | 2 +- packages/core-plugin-api/CHANGELOG.md | 18 + packages/core-plugin-api/package.json | 2 +- packages/create-app/CHANGELOG.md | 12 + packages/create-app/package.json | 2 +- packages/dev-utils/CHANGELOG.md | 15 + packages/dev-utils/package.json | 2 +- packages/e2e-test/CHANGELOG.md | 9 + packages/e2e-test/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 7 + packages/eslint-plugin/package.json | 2 +- packages/frontend-app-api/CHANGELOG.md | 19 + packages/frontend-app-api/package.json | 2 +- packages/frontend-defaults/CHANGELOG.md | 11 + packages/frontend-defaults/package.json | 2 +- packages/frontend-internal/CHANGELOG.md | 9 + packages/frontend-internal/package.json | 2 +- packages/frontend-plugin-api/CHANGELOG.md | 51 + packages/frontend-plugin-api/package.json | 2 +- packages/frontend-test-utils/CHANGELOG.md | 27 + packages/frontend-test-utils/package.json | 2 +- packages/integration-react/CHANGELOG.md | 15 + packages/integration-react/package.json | 2 +- packages/integration/CHANGELOG.md | 11 + packages/integration/package.json | 2 +- packages/repo-tools/CHANGELOG.md | 25 + packages/repo-tools/package.json | 2 +- packages/scaffolder-internal/CHANGELOG.md | 7 + packages/scaffolder-internal/package.json | 2 +- .../techdocs-cli-embedded-app/CHANGELOG.md | 19 + .../techdocs-cli-embedded-app/package.json | 2 +- packages/techdocs-cli/CHANGELOG.md | 11 + packages/techdocs-cli/package.json | 2 +- packages/test-utils/CHANGELOG.md | 26 + packages/test-utils/package.json | 2 +- packages/theme/CHANGELOG.md | 10 + packages/theme/package.json | 2 +- packages/version-bridge/CHANGELOG.md | 6 + packages/version-bridge/package.json | 2 +- .../CHANGELOG.md | 6 + .../package.json | 2 +- plugins/api-docs/CHANGELOG.md | 17 + plugins/api-docs/package.json | 2 +- plugins/app-backend/CHANGELOG.md | 16 + plugins/app-backend/package.json | 2 +- plugins/app-node/CHANGELOG.md | 8 + plugins/app-node/package.json | 2 +- plugins/app-visualizer/CHANGELOG.md | 10 + plugins/app-visualizer/package.json | 2 +- plugins/app/CHANGELOG.md | 13 + plugins/app/package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 8 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- plugins/auth-backend/CHANGELOG.md | 32 + plugins/auth-backend/package.json | 2 +- plugins/auth-node/CHANGELOG.md | 15 + plugins/auth-node/package.json | 2 +- plugins/auth-react/CHANGELOG.md | 10 + plugins/auth-react/package.json | 2 +- plugins/bitbucket-cloud-common/CHANGELOG.md | 7 + plugins/bitbucket-cloud-common/package.json | 2 +- .../catalog-backend-module-aws/CHANGELOG.md | 17 + .../catalog-backend-module-aws/package.json | 2 +- .../catalog-backend-module-azure/CHANGELOG.md | 12 + .../catalog-backend-module-azure/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 45 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../catalog-backend-module-gcp/CHANGELOG.md | 11 + .../catalog-backend-module-gcp/package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 18 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 18 + .../package.json | 2 +- .../catalog-backend-module-ldap/CHANGELOG.md | 13 + .../catalog-backend-module-ldap/package.json | 2 +- .../catalog-backend-module-logs/CHANGELOG.md | 9 + .../catalog-backend-module-logs/package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- plugins/catalog-backend/CHANGELOG.md | 33 + plugins/catalog-backend/package.json | 2 +- plugins/catalog-graph/CHANGELOG.md | 22 + plugins/catalog-graph/package.json | 2 +- plugins/catalog-import/CHANGELOG.md | 20 + plugins/catalog-import/package.json | 2 +- plugins/catalog-node/CHANGELOG.md | 15 + plugins/catalog-node/package.json | 2 +- plugins/catalog-react/CHANGELOG.md | 29 + plugins/catalog-react/package.json | 2 +- .../catalog-unprocessed-entities/CHANGELOG.md | 11 + .../catalog-unprocessed-entities/package.json | 2 +- plugins/catalog/CHANGELOG.md | 28 + plugins/catalog/package.json | 2 +- plugins/config-schema/CHANGELOG.md | 11 + plugins/config-schema/package.json | 2 +- plugins/devtools-backend/CHANGELOG.md | 16 + plugins/devtools-backend/package.json | 2 +- plugins/devtools/CHANGELOG.md | 14 + plugins/devtools/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../events-backend-module-azure/CHANGELOG.md | 9 + .../events-backend-module-azure/package.json | 2 +- .../CHANGELOG.md | 9 + .../package.json | 2 +- .../events-backend-module-gerrit/CHANGELOG.md | 9 + .../events-backend-module-gerrit/package.json | 2 +- .../events-backend-module-github/CHANGELOG.md | 10 + .../events-backend-module-github/package.json | 2 +- .../events-backend-module-gitlab/CHANGELOG.md | 10 + .../events-backend-module-gitlab/package.json | 2 +- .../events-backend-test-utils/CHANGELOG.md | 7 + .../events-backend-test-utils/package.json | 2 +- plugins/events-backend/CHANGELOG.md | 20 + plugins/events-backend/package.json | 2 +- plugins/events-node/CHANGELOG.md | 12 + plugins/events-node/package.json | 2 +- .../example-todo-list-backend/CHANGELOG.md | 9 + .../example-todo-list-backend/package.json | 2 +- plugins/example-todo-list/CHANGELOG.md | 8 + plugins/example-todo-list/package.json | 2 +- plugins/home-react/CHANGELOG.md | 13 + plugins/home-react/package.json | 2 +- plugins/home/CHANGELOG.md | 26 + plugins/home/package.json | 2 +- plugins/kubernetes-backend/CHANGELOG.md | 21 + plugins/kubernetes-backend/package.json | 2 +- plugins/kubernetes-cluster/CHANGELOG.md | 15 + plugins/kubernetes-cluster/package.json | 2 +- plugins/kubernetes-node/CHANGELOG.md | 11 + plugins/kubernetes-node/package.json | 2 +- plugins/kubernetes-react/CHANGELOG.md | 15 + plugins/kubernetes-react/package.json | 2 +- plugins/kubernetes/CHANGELOG.md | 17 + plugins/kubernetes/package.json | 2 +- .../CHANGELOG.md | 16 + .../package.json | 2 +- plugins/notifications-backend/CHANGELOG.md | 18 + plugins/notifications-backend/package.json | 2 +- plugins/notifications-node/CHANGELOG.md | 12 + plugins/notifications-node/package.json | 2 +- plugins/notifications/CHANGELOG.md | 14 + plugins/notifications/package.json | 2 +- plugins/org-react/CHANGELOG.md | 12 + plugins/org-react/package.json | 2 +- plugins/org/CHANGELOG.md | 14 + plugins/org/package.json | 2 +- .../CHANGELOG.md | 10 + .../package.json | 2 +- plugins/permission-backend/CHANGELOG.md | 14 + plugins/permission-backend/package.json | 2 +- plugins/permission-node/CHANGELOG.md | 12 + plugins/permission-node/package.json | 2 +- plugins/permission-react/CHANGELOG.md | 10 + plugins/permission-react/package.json | 2 +- plugins/proxy-backend/CHANGELOG.md | 11 + plugins/proxy-backend/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 13 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 15 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 31 + .../package.json | 2 +- .../CHANGELOG.md | 19 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- .../CHANGELOG.md | 11 + .../package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- plugins/scaffolder-backend/CHANGELOG.md | 54 + plugins/scaffolder-backend/package.json | 2 +- .../scaffolder-node-test-utils/CHANGELOG.md | 11 + .../scaffolder-node-test-utils/package.json | 2 +- plugins/scaffolder-node/CHANGELOG.md | 19 + plugins/scaffolder-node/package.json | 2 +- plugins/scaffolder-react/CHANGELOG.md | 32 + plugins/scaffolder-react/package.json | 2 +- plugins/scaffolder/CHANGELOG.md | 54 + plugins/scaffolder/package.json | 2 +- .../CHANGELOG.md | 20 + .../package.json | 2 +- .../CHANGELOG.md | 18 + .../package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- plugins/search-backend-module-pg/CHANGELOG.md | 12 + plugins/search-backend-module-pg/package.json | 2 +- .../CHANGELOG.md | 12 + .../package.json | 2 +- .../CHANGELOG.md | 24 + .../package.json | 2 +- plugins/search-backend-node/CHANGELOG.md | 13 + plugins/search-backend-node/package.json | 2 +- plugins/search-backend/CHANGELOG.md | 22 + plugins/search-backend/package.json | 2 +- plugins/search-react/CHANGELOG.md | 14 + plugins/search-react/package.json | 2 +- plugins/search/CHANGELOG.md | 18 + plugins/search/package.json | 2 +- plugins/signals-backend/CHANGELOG.md | 13 + plugins/signals-backend/package.json | 2 +- plugins/signals-node/CHANGELOG.md | 12 + plugins/signals-node/package.json | 2 +- plugins/signals-react/CHANGELOG.md | 9 + plugins/signals-react/package.json | 2 +- plugins/signals/CHANGELOG.md | 12 + plugins/signals/package.json | 2 +- .../techdocs-addons-test-utils/CHANGELOG.md | 16 + .../techdocs-addons-test-utils/package.json | 2 +- plugins/techdocs-backend/CHANGELOG.md | 24 + plugins/techdocs-backend/package.json | 2 +- .../CHANGELOG.md | 14 + .../package.json | 2 +- plugins/techdocs-node/CHANGELOG.md | 17 + plugins/techdocs-node/package.json | 2 +- plugins/techdocs-react/CHANGELOG.md | 12 + plugins/techdocs-react/package.json | 2 +- plugins/techdocs/CHANGELOG.md | 32 + plugins/techdocs/package.json | 2 +- plugins/user-settings-backend/CHANGELOG.md | 15 + plugins/user-settings-backend/package.json | 2 +- plugins/user-settings/CHANGELOG.md | 20 + plugins/user-settings/package.json | 2 +- yarn.lock | 367 +-- 496 files changed, 5648 insertions(+), 1902 deletions(-) delete mode 100644 .changeset/angry-cycles-call.md delete mode 100644 .changeset/angry-mayflies-collect.md delete mode 100644 .changeset/angry-windows-decide.md delete mode 100644 .changeset/beige-ghosts-enjoy.md delete mode 100644 .changeset/big-rules-nail.md delete mode 100644 .changeset/breezy-berries-yawn.md delete mode 100644 .changeset/breezy-bulldogs-smell.md delete mode 100644 .changeset/bright-mails-compare.md delete mode 100644 .changeset/brown-frogs-walk.md delete mode 100644 .changeset/brown-hotels-move.md delete mode 100644 .changeset/calm-owls-move.md delete mode 100644 .changeset/chair-fairs-drive.md delete mode 100644 .changeset/chilled-dolphins-join.md delete mode 100644 .changeset/chilled-melons-smash.md delete mode 100644 .changeset/chilly-meals-sniff.md delete mode 100644 .changeset/clever-paws-stare.md delete mode 100644 .changeset/clever-rats-rush.md delete mode 100644 .changeset/cold-nails-rescue.md delete mode 100644 .changeset/crash-loop-baby.md delete mode 100644 .changeset/crash-loop-honey.md delete mode 100644 .changeset/crash-loop-yeah.md delete mode 100644 .changeset/create-app-1727774359.md delete mode 100644 .changeset/create-app-1728387650.md delete mode 100644 .changeset/cuddly-stingrays-smell.md delete mode 100644 .changeset/curly-foxes-brake.md delete mode 100644 .changeset/curly-tomatoes-reply.md delete mode 100644 .changeset/cyan-cooks-sing.md delete mode 100644 .changeset/cyan-peaches-lay.md delete mode 100644 .changeset/cyan-suits-battle.md delete mode 100644 .changeset/cyan-vans-study.md delete mode 100644 .changeset/dependabot-a3fd85a.md delete mode 100644 .changeset/dry-frogs-drum.md delete mode 100644 .changeset/early-drinks-kneel.md delete mode 100644 .changeset/early-sloths-cross.md delete mode 100644 .changeset/eight-clocks-complain.md delete mode 100644 .changeset/eight-steaks-chew.md delete mode 100644 .changeset/eighty-mice-turn.md delete mode 100644 .changeset/eleven-beds-play.md delete mode 100644 .changeset/eleven-pugs-hear.md delete mode 100644 .changeset/fair-chairs-drive.md delete mode 100644 .changeset/famous-bobcats-remain.md delete mode 100644 .changeset/few-hairs-compare.md delete mode 100644 .changeset/fifty-trainers-watch.md delete mode 100644 .changeset/five-gorillas-pay.md delete mode 100644 .changeset/five-turkeys-taste.md delete mode 100644 .changeset/flat-eels-exist.md delete mode 100644 .changeset/flat-seals-type.md delete mode 100644 .changeset/fluffy-dogs-mate.md delete mode 100644 .changeset/fluffy-dolphins-battle.md delete mode 100644 .changeset/fluffy-pears-cry.md delete mode 100644 .changeset/four-moons-watch.md delete mode 100644 .changeset/friendly-coins-approve.md delete mode 100644 .changeset/friendly-cougars-return.md delete mode 100644 .changeset/funny-dancers-drum.md delete mode 100644 .changeset/funny-rocks-train.md delete mode 100644 .changeset/fuzzy-elephants-tease.md delete mode 100644 .changeset/giant-kiwis-retire.md delete mode 100644 .changeset/gold-pots-end.md delete mode 100644 .changeset/good-eels-drive.md delete mode 100644 .changeset/good-trainers-appear.md delete mode 100644 .changeset/gorgeous-months-fix.md delete mode 100644 .changeset/great-eagles-repair.md delete mode 100644 .changeset/green-berries-wave.md delete mode 100644 .changeset/green-bottles-live.md delete mode 100644 .changeset/green-cooks-sort.md delete mode 100644 .changeset/happy-ligers-think.md delete mode 100644 .changeset/healthy-shoes-judge.md delete mode 100644 .changeset/healthy-years-search.md delete mode 100644 .changeset/heavy-ties-tell.md delete mode 100644 .changeset/honest-impalas-rescue.md delete mode 100644 .changeset/hungry-buckets-repair.md delete mode 100644 .changeset/kind-avocados-speak.md delete mode 100644 .changeset/large-hats-reply.md delete mode 100644 .changeset/large-plants-rhyme.md delete mode 100644 .changeset/lemon-badgers-share.md delete mode 100644 .changeset/lemon-pumpkins-lick.md delete mode 100644 .changeset/light-rats-travel.md delete mode 100644 .changeset/long-humans-hunt.md delete mode 100644 .changeset/loud-hotels-tan.md delete mode 100644 .changeset/lovely-bees-walk.md delete mode 100644 .changeset/lovely-jokes-breathe.md delete mode 100644 .changeset/lucky-mugs-drive.md delete mode 100644 .changeset/mighty-forks-exercise.md delete mode 100644 .changeset/mighty-terms-peel.md delete mode 100644 .changeset/nasty-geese-repeat.md delete mode 100644 .changeset/nasty-lamps-greet.md delete mode 100644 .changeset/neat-geckos-end.md delete mode 100644 .changeset/nice-badgers-travel.md delete mode 100644 .changeset/olive-walls-wave.md delete mode 100644 .changeset/pink-sheep-dress.md delete mode 100644 .changeset/polite-days-flash.md delete mode 100644 .changeset/poor-dodos-wait.md delete mode 100644 .changeset/popular-items-retire.md delete mode 100644 .changeset/pre.json delete mode 100644 .changeset/pretty-buses-repair.md delete mode 100644 .changeset/pretty-pans-exist.md delete mode 100644 .changeset/pretty-plants-hammer.md delete mode 100644 .changeset/purple-toys-heal.md delete mode 100644 .changeset/quiet-dingos-bathe.md delete mode 100644 .changeset/quiet-islands-learn.md delete mode 100644 .changeset/quiet-lions-lie.md delete mode 100644 .changeset/quiet-needles-impress.md delete mode 100644 .changeset/rare-crabs-cheat.md delete mode 100644 .changeset/rare-rabbits-flow.md delete mode 100644 .changeset/real-rockets-divide.md delete mode 100644 .changeset/real-tigers-punch.md delete mode 100644 .changeset/renovate-156753b.md delete mode 100644 .changeset/renovate-6eaf36e.md delete mode 100644 .changeset/renovate-7874fad.md delete mode 100644 .changeset/renovate-85a184e.md delete mode 100644 .changeset/renovate-87a3bd2.md delete mode 100644 .changeset/renovate-966d123.md delete mode 100644 .changeset/renovate-9f7136b.md delete mode 100644 .changeset/renovate-cc4bfa7.md delete mode 100644 .changeset/renovate-d7e90e4.md delete mode 100644 .changeset/renovate-f88b005.md delete mode 100644 .changeset/rich-deers-attend.md delete mode 100644 .changeset/rich-needles-collect.md delete mode 100644 .changeset/rotten-camels-deny.md delete mode 100644 .changeset/rotten-rockets-deny.md delete mode 100644 .changeset/rude-apricots-eat.md delete mode 100644 .changeset/shaggy-weeks-hunt.md delete mode 100644 .changeset/sharp-lamps-fix.md delete mode 100644 .changeset/shy-olives-swim.md delete mode 100644 .changeset/shy-plants-retire.md delete mode 100644 .changeset/silly-geckos-learn.md delete mode 100644 .changeset/silly-ligers-tan.md delete mode 100644 .changeset/silly-readers-build.md delete mode 100644 .changeset/silver-comics-attend.md delete mode 100644 .changeset/slimy-ravens-end.md delete mode 100644 .changeset/slow-gorillas-thank.md delete mode 100644 .changeset/slow-trees-compare.md delete mode 100644 .changeset/slow-walls-report.md delete mode 100644 .changeset/small-donkeys-attack.md delete mode 100644 .changeset/smart-jobs-sit.md delete mode 100644 .changeset/sour-grapes-trade.md delete mode 100644 .changeset/sour-phones-fix.md delete mode 100644 .changeset/stale-ravens-clap.md delete mode 100644 .changeset/stale-roses-serve.md delete mode 100644 .changeset/strange-bees-attack.md delete mode 100644 .changeset/strong-monkeys-melt.md delete mode 100644 .changeset/sweet-chicken-smash.md delete mode 100644 .changeset/ten-apes-turn.md delete mode 100644 .changeset/ten-rings-look.md delete mode 100644 .changeset/thick-tables-give.md delete mode 100644 .changeset/thin-chairs-ring.md delete mode 100644 .changeset/thin-doors-rule.md delete mode 100644 .changeset/thirty-pets-fry.md delete mode 100644 .changeset/thirty-pianos-mix.md delete mode 100644 .changeset/tiny-pugs-kick.md delete mode 100644 .changeset/tough-fireants-itch.md delete mode 100644 .changeset/tough-pillows-sip.md delete mode 100644 .changeset/tricky-shoes-lie.md delete mode 100644 .changeset/twenty-cups-knock.md delete mode 100644 .changeset/two-plums-fail.md delete mode 100644 .changeset/violet-beds-promise.md delete mode 100644 .changeset/weak-bottles-cross.md create mode 100644 docs/releases/v1.32.0-changelog.md diff --git a/.changeset/angry-cycles-call.md b/.changeset/angry-cycles-call.md deleted file mode 100644 index e8db20b701..0000000000 --- a/.changeset/angry-cycles-call.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Preserve directory structure for CommonJS build output, just like ESM. This makes the build output more stable and easier to browse, and allows for more effective tree shaking and lazy imports. diff --git a/.changeset/angry-mayflies-collect.md b/.changeset/angry-mayflies-collect.md deleted file mode 100644 index df49f98b33..0000000000 --- a/.changeset/angry-mayflies-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Correct size of FavoriteToggle and inherit non-starred color from parent diff --git a/.changeset/angry-windows-decide.md b/.changeset/angry-windows-decide.md deleted file mode 100644 index 6a5c225e80..0000000000 --- a/.changeset/angry-windows-decide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Fix extra divider displayed in owner list picker on list tasks page diff --git a/.changeset/beige-ghosts-enjoy.md b/.changeset/beige-ghosts-enjoy.md deleted file mode 100644 index 49ae916939..0000000000 --- a/.changeset/beige-ghosts-enjoy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': minor ---- - -The `repo test` command will no longer default to watch mode if the `--since` flag is provided. diff --git a/.changeset/big-rules-nail.md b/.changeset/big-rules-nail.md deleted file mode 100644 index 959ce2a26e..0000000000 --- a/.changeset/big-rules-nail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-search-backend-module-elasticsearch': patch ---- - -Align the configuration schema with the docs and actual behavior of the code diff --git a/.changeset/breezy-berries-yawn.md b/.changeset/breezy-berries-yawn.md deleted file mode 100644 index 0ef4fa68e7..0000000000 --- a/.changeset/breezy-berries-yawn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch ---- - -Add `overridableComponent` `BackstageTemplateStepperClassKey` to template stepper to enable custom styling diff --git a/.changeset/breezy-bulldogs-smell.md b/.changeset/breezy-bulldogs-smell.md deleted file mode 100644 index 69825142cb..0000000000 --- a/.changeset/breezy-bulldogs-smell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Create a separate route for the Scaffolder template editor and add the ability to refresh the page without closing the directory. Also, when the directory is closed, the user will stay on the editor page and can load a template folder from there. diff --git a/.changeset/bright-mails-compare.md b/.changeset/bright-mails-compare.md deleted file mode 100644 index 61d049576c..0000000000 --- a/.changeset/bright-mails-compare.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch -'@backstage/plugin-catalog-backend-module-msgraph': patch -'@backstage/plugin-search-backend-module-catalog': patch -'@backstage/plugin-search-backend-module-elasticsearch': patch -'@backstage/plugin-search-backend-module-techdocs': patch ---- - -Remove extension points from `/alpha` export, they're available from the main package already diff --git a/.changeset/brown-frogs-walk.md b/.changeset/brown-frogs-walk.md deleted file mode 100644 index 6fae44be73..0000000000 --- a/.changeset/brown-frogs-walk.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Add `fetch:template:file` scaffolder action to download a single file and template the contents. Example usage: - -```yaml -- id: fetch-file - name: Fetch File - action: fetch:template:file - input: - url: https://github.com/backstage/software-templates/blob/main/scaffolder-templates/create-react-app/skeleton/catalog-info.yaml - targetPath: './target/catalog-info.yaml' - values: - component_id: My Component - owner: Test -``` diff --git a/.changeset/brown-hotels-move.md b/.changeset/brown-hotels-move.md deleted file mode 100644 index 511ea9ee10..0000000000 --- a/.changeset/brown-hotels-move.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/backend-defaults': patch -'@backstage/plugin-catalog-backend-module-puppetdb': patch -'@backstage/plugin-scaffolder-react': patch ---- - -Small tweaks to API reports to make them valid diff --git a/.changeset/calm-owls-move.md b/.changeset/calm-owls-move.md deleted file mode 100644 index bd7fb72508..0000000000 --- a/.changeset/calm-owls-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli-node': patch ---- - -Added new `lockfile.getDependencyTreeHash(name)` utility. diff --git a/.changeset/chair-fairs-drive.md b/.changeset/chair-fairs-drive.md deleted file mode 100644 index 91c00c063a..0000000000 --- a/.changeset/chair-fairs-drive.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@backstage/frontend-plugin-api': minor ---- - -Removed deprecated `namespace` option from `createExtension` and `createExtensionBlueprint`, including `.make` and `.makeWithOverides`, it's no longer necessary and will use the `pluginId` instead. - -Removed deprecated `createExtensionOverrides` this should be replaced with `createFrontendModule` instead. - -Removed deprecated `BackstagePlugin` type, use `FrontendPlugin` type instead from this same package. diff --git a/.changeset/chilled-dolphins-join.md b/.changeset/chilled-dolphins-join.md deleted file mode 100644 index 4c3f5a381b..0000000000 --- a/.changeset/chilled-dolphins-join.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog': minor ---- - -Updated default columns for location entities to remove description and tags from the catalog table view. diff --git a/.changeset/chilled-melons-smash.md b/.changeset/chilled-melons-smash.md deleted file mode 100644 index ca8f02ff37..0000000000 --- a/.changeset/chilled-melons-smash.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-github': patch ---- - -Add `github:branch-protection:create` scaffolder action to set branch protection on an existing repository. Example usage: - -```yaml -- id: set-branch-protection - name: Set Branch Protection - action: github:branch-protection:create - input: - repoUrl: 'github.com?repo=backstage&owner=backstage' - branch: master - enforceAdmins: true # default - requiredApprovingReviewCount: 1 # default - requireBranchesToBeUpToDate: true # default - requireCodeOwnerReviews: true - dismissStaleReviews: true - requiredConversationResolution: true -``` diff --git a/.changeset/chilly-meals-sniff.md b/.changeset/chilly-meals-sniff.md deleted file mode 100644 index 6776f93154..0000000000 --- a/.changeset/chilly-meals-sniff.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/frontend-test-utils': patch ---- - -Disable the built-in `SignInPage` in `createExtensionTester` in order to not mess with existing tests diff --git a/.changeset/clever-paws-stare.md b/.changeset/clever-paws-stare.md deleted file mode 100644 index ad56a5306e..0000000000 --- a/.changeset/clever-paws-stare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Added functionality to the prepack script that will append the default export type for entry points to the `exports` object before publishing. This is to help with identifying the declarative integration points for plugins without needing to fetch or run the plugins first. diff --git a/.changeset/clever-rats-rush.md b/.changeset/clever-rats-rush.md deleted file mode 100644 index c34427f8f5..0000000000 --- a/.changeset/clever-rats-rush.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -Sensitive internal fields on `BackstageCredentials` objects are now defined as read-only properties in order to minimize risk of leakage. diff --git a/.changeset/cold-nails-rescue.md b/.changeset/cold-nails-rescue.md deleted file mode 100644 index b7667305ca..0000000000 --- a/.changeset/cold-nails-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': minor ---- - -**BREAKING**: The Jest configuration defined at `@backstage/cli/config/jest` no longer collects configuration defined in the `"jest"` field from all parent `package.json` files. Instead, it will only read and merge configuration from the `package.json` in the monorepo root if it exists, as well as the target package. In addition, configuration defined in the root `package.json` will now only be merged into each package configuration if it is a valid project-level configuration key. diff --git a/.changeset/crash-loop-baby.md b/.changeset/crash-loop-baby.md deleted file mode 100644 index 4f629c7f92..0000000000 --- a/.changeset/crash-loop-baby.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-app-api': patch -'@backstage/backend-defaults': patch ---- - -Plugin lifecycle shutdown hooks are now performed before root lifecycle shutdown hooks. diff --git a/.changeset/crash-loop-honey.md b/.changeset/crash-loop-honey.md deleted file mode 100644 index 60f9f04600..0000000000 --- a/.changeset/crash-loop-honey.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -The database manager now attempts to close any database connections in a root lifecycle shutdown hook. diff --git a/.changeset/crash-loop-yeah.md b/.changeset/crash-loop-yeah.md deleted file mode 100644 index 098bc01bae..0000000000 --- a/.changeset/crash-loop-yeah.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -The task scheduler now attempts to abort any tasks if it detects that Backstage is being shut down. diff --git a/.changeset/create-app-1727774359.md b/.changeset/create-app-1727774359.md deleted file mode 100644 index b50d431d4b..0000000000 --- a/.changeset/create-app-1727774359.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Bumped create-app version. diff --git a/.changeset/create-app-1728387650.md b/.changeset/create-app-1728387650.md deleted file mode 100644 index b50d431d4b..0000000000 --- a/.changeset/create-app-1728387650.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Bumped create-app version. diff --git a/.changeset/cuddly-stingrays-smell.md b/.changeset/cuddly-stingrays-smell.md deleted file mode 100644 index 5a8a8ac236..0000000000 --- a/.changeset/cuddly-stingrays-smell.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-cloudflare-access-provider': patch -'@backstage/plugin-auth-backend-module-vmware-cloud-provider': patch -'@backstage/plugin-auth-backend-module-atlassian-provider': patch -'@backstage/plugin-auth-backend-module-bitbucket-provider': patch -'@backstage/plugin-auth-backend-module-microsoft-provider': patch -'@backstage/plugin-auth-backend-module-onelogin-provider': patch -'@backstage/plugin-auth-backend-module-aws-alb-provider': patch -'@backstage/plugin-auth-backend-module-gcp-iap-provider': patch -'@backstage/plugin-auth-backend-module-github-provider': patch -'@backstage/plugin-auth-backend-module-gitlab-provider': patch -'@backstage/plugin-auth-backend-module-google-provider': patch -'@backstage/plugin-auth-backend-module-oauth2-provider': patch -'@backstage/plugin-auth-backend-module-oidc-provider': patch -'@backstage/plugin-auth-backend-module-okta-provider': patch ---- - -Updated configuration schema to include the new `allowedDomains` option for the `emailLocalPartMatchingUserEntityName` sign-in resolver. diff --git a/.changeset/curly-foxes-brake.md b/.changeset/curly-foxes-brake.md deleted file mode 100644 index 6946f30371..0000000000 --- a/.changeset/curly-foxes-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Apply `defaultValue` props in `MultiEntityPicker` diff --git a/.changeset/curly-tomatoes-reply.md b/.changeset/curly-tomatoes-reply.md deleted file mode 100644 index 386e2b6109..0000000000 --- a/.changeset/curly-tomatoes-reply.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -handle step.if: false diff --git a/.changeset/cyan-cooks-sing.md b/.changeset/cyan-cooks-sing.md deleted file mode 100644 index 70492d0165..0000000000 --- a/.changeset/cyan-cooks-sing.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-gerrit': patch ---- - -Fixed an issue preventing the provider's `schedule` config from being applied." diff --git a/.changeset/cyan-peaches-lay.md b/.changeset/cyan-peaches-lay.md deleted file mode 100644 index a2b393caf8..0000000000 --- a/.changeset/cyan-peaches-lay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Create a separate route for the template form editor so we refresh it without being redirected to scaffolder edit page. diff --git a/.changeset/cyan-suits-battle.md b/.changeset/cyan-suits-battle.md deleted file mode 100644 index ac8b9eb811..0000000000 --- a/.changeset/cyan-suits-battle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -The `scaffolder-module` template has been updated to use a more modern layout and new testing utilities for scaffolder actions. diff --git a/.changeset/cyan-vans-study.md b/.changeset/cyan-vans-study.md deleted file mode 100644 index a69b95fd85..0000000000 --- a/.changeset/cyan-vans-study.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Include step name and step id to checkpoint key diff --git a/.changeset/dependabot-a3fd85a.md b/.changeset/dependabot-a3fd85a.md deleted file mode 100644 index 8ff0c9dfa2..0000000000 --- a/.changeset/dependabot-a3fd85a.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/backend-app-api': patch -'@backstage/backend-defaults': patch -'@backstage/backend-test-utils': patch ---- - -build(deps): bump `cookie` from 0.6.0 to 0.7.0 diff --git a/.changeset/dry-frogs-drum.md b/.changeset/dry-frogs-drum.md deleted file mode 100644 index c929732943..0000000000 --- a/.changeset/dry-frogs-drum.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Change task list created at column to show timestamp diff --git a/.changeset/early-drinks-kneel.md b/.changeset/early-drinks-kneel.md deleted file mode 100644 index c744cd5d7c..0000000000 --- a/.changeset/early-drinks-kneel.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': minor -'@backstage/plugin-scaffolder-node': minor ---- - -Added pagination support for listing of tasks and the ability to filter on several users and task statuses. diff --git a/.changeset/early-sloths-cross.md b/.changeset/early-sloths-cross.md deleted file mode 100644 index 7f4a563918..0000000000 --- a/.changeset/early-sloths-cross.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -'@backstage/plugin-signals-react': patch -'@backstage/plugin-signals': patch -'@backstage/plugin-api-docs-module-protoc-gen-doc': patch -'@backstage/plugin-techdocs-module-addons-contrib': patch -'@backstage/plugin-catalog-unprocessed-entities': patch -'@backstage/plugin-scaffolder-node-test-utils': patch -'@backstage/plugin-techdocs-addons-test-utils': patch -'@backstage/frontend-plugin-api': patch -'@backstage/frontend-test-utils': patch -'@backstage/integration-react': patch -'@backstage/plugin-kubernetes-cluster': patch -'@backstage/frontend-app-api': patch -'@backstage/core-compat-api': patch -'@backstage/core-components': patch -'@backstage/core-plugin-api': patch -'@backstage/plugin-kubernetes-react': patch -'@backstage/plugin-permission-react': patch -'@backstage/plugin-scaffolder-react': patch -'@backstage/version-bridge': patch -'@backstage/plugin-app-visualizer': patch -'@backstage/plugin-catalog-import': patch -'@backstage/plugin-techdocs-react': patch -'@backstage/app-defaults': patch -'@backstage/core-app-api': patch -'@backstage/plugin-catalog-graph': patch -'@backstage/plugin-catalog-react': patch -'@backstage/plugin-config-schema': patch -'@backstage/plugin-notifications': patch -'@backstage/plugin-user-settings': patch -'@backstage/plugin-search-react': patch -'@backstage/test-utils': patch -'@backstage/dev-utils': patch -'@backstage/plugin-auth-react': patch -'@backstage/plugin-home-react': patch -'@backstage/plugin-kubernetes': patch -'@backstage/plugin-scaffolder': patch -'@backstage/plugin-org-react': patch -'@backstage/plugin-api-docs': patch -'@backstage/plugin-devtools': patch -'@backstage/plugin-techdocs': patch -'@backstage/plugin-catalog': patch -'@backstage/theme': patch -'@backstage/plugin-search': patch -'@backstage/plugin-home': patch -'@backstage/plugin-org': patch ---- - -Move `@types/react` to a peer dependency. diff --git a/.changeset/eight-clocks-complain.md b/.changeset/eight-clocks-complain.md deleted file mode 100644 index b7044481ac..0000000000 --- a/.changeset/eight-clocks-complain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/eslint-plugin': patch ---- - -Exclude `@material-ui/data-grid` diff --git a/.changeset/eight-steaks-chew.md b/.changeset/eight-steaks-chew.md deleted file mode 100644 index 4651d3fb8c..0000000000 --- a/.changeset/eight-steaks-chew.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': minor -'@backstage/plugin-scaffolder': minor ---- - -Added support for `FormFieldBlueprint` to create field extensions in the Scaffolder plugin diff --git a/.changeset/eighty-mice-turn.md b/.changeset/eighty-mice-turn.md deleted file mode 100644 index cec3835641..0000000000 --- a/.changeset/eighty-mice-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Add tests for the `TemplateEditorToolbarTemplatesMenu` component. diff --git a/.changeset/eleven-beds-play.md b/.changeset/eleven-beds-play.md deleted file mode 100644 index fd51922cb4..0000000000 --- a/.changeset/eleven-beds-play.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-search-backend': patch ---- - -Fix to schema to allow arbitrary query parameters. diff --git a/.changeset/eleven-pugs-hear.md b/.changeset/eleven-pugs-hear.md deleted file mode 100644 index 5d65057e0b..0000000000 --- a/.changeset/eleven-pugs-hear.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-api-docs': patch -'@backstage/plugin-catalog': patch ---- - -Empty states updated with external link icon for learn more links diff --git a/.changeset/fair-chairs-drive.md b/.changeset/fair-chairs-drive.md deleted file mode 100644 index fae2195821..0000000000 --- a/.changeset/fair-chairs-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/frontend-app-api': minor ---- - -Removed deprecated `createApp` and `CreateAppFeatureLoader` from `@backstage/frontend-app-api`, use the same `createApp` and `CreateAppFeatureLoader` import from `@backstage/frontend-defaults` instead. diff --git a/.changeset/famous-bobcats-remain.md b/.changeset/famous-bobcats-remain.md deleted file mode 100644 index 6943eb7e56..0000000000 --- a/.changeset/famous-bobcats-remain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/eslint-plugin': patch ---- - -Internal refactor to deal with `estree` upgrade diff --git a/.changeset/few-hairs-compare.md b/.changeset/few-hairs-compare.md deleted file mode 100644 index 48cd7b7f25..0000000000 --- a/.changeset/few-hairs-compare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-gitlab': patch ---- - -GitLab MR: introduce 'skip' commit action. diff --git a/.changeset/fifty-trainers-watch.md b/.changeset/fifty-trainers-watch.md deleted file mode 100644 index 5cef1ad2b2..0000000000 --- a/.changeset/fifty-trainers-watch.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-techdocs': patch ---- - -Make `emptyState` input optional on `entity-content:techdocs` extension so that -the default empty state extension works correctly. diff --git a/.changeset/five-gorillas-pay.md b/.changeset/five-gorillas-pay.md deleted file mode 100644 index c5cd18a186..0000000000 --- a/.changeset/five-gorillas-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Create a separate route for the custom fields explorer so we refresh it without being redirected to scaffolder edit page. diff --git a/.changeset/five-turkeys-taste.md b/.changeset/five-turkeys-taste.md deleted file mode 100644 index 7f3361ebbf..0000000000 --- a/.changeset/five-turkeys-taste.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/repo-tools': patch ---- - -Properly log instructions when APIs do not match diff --git a/.changeset/flat-eels-exist.md b/.changeset/flat-eels-exist.md deleted file mode 100644 index fb30b51e82..0000000000 --- a/.changeset/flat-eels-exist.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Remove unknown dependency `diff` diff --git a/.changeset/flat-seals-type.md b/.changeset/flat-seals-type.md deleted file mode 100644 index 9574c74fc9..0000000000 --- a/.changeset/flat-seals-type.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-node': patch ---- - -Added a new `allowedDomains` option for the common `emailLocalPartMatchingUserEntityName` sign-in resolver. diff --git a/.changeset/fluffy-dogs-mate.md b/.changeset/fluffy-dogs-mate.md deleted file mode 100644 index cb7a78d0fb..0000000000 --- a/.changeset/fluffy-dogs-mate.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/backend-dynamic-feature-service': patch ---- - -Enhance and simplify the activation of the dynamic plugins feature: - -- The dynamic plugins service (which implements the `DynamicPluginsProvider`) is restored, since it is required for plugins to depend on it in order to get the details of loaded dynamic plugins (possibly with loading errors to be surfaced in some UI). -- A new all-in-one feature loader (`dynamicPluginsFeatureLoader`) is provided that allows a 1-liner activation of both the dynamic features and additional services or plugins required to have the dynamic plugins work correctly with dynamic plugins config schemas. Previous service factories or feature loaders are deprecated. diff --git a/.changeset/fluffy-dolphins-battle.md b/.changeset/fluffy-dolphins-battle.md deleted file mode 100644 index b247d549e5..0000000000 --- a/.changeset/fluffy-dolphins-battle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Add tests for the new pages header navigation. diff --git a/.changeset/fluffy-pears-cry.md b/.changeset/fluffy-pears-cry.md deleted file mode 100644 index 2da74eb857..0000000000 --- a/.changeset/fluffy-pears-cry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/repo-tools': minor ---- - -Update @microsoft/api-extractor and use their api report resolution. -Change api report format from `api-report.md` to `report.api.md` diff --git a/.changeset/four-moons-watch.md b/.changeset/four-moons-watch.md deleted file mode 100644 index 3d0b25c1d5..0000000000 --- a/.changeset/four-moons-watch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/integration-react': patch ---- - -Revert of change #26430 diff --git a/.changeset/friendly-coins-approve.md b/.changeset/friendly-coins-approve.md deleted file mode 100644 index 71a8240089..0000000000 --- a/.changeset/friendly-coins-approve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-app-backend': patch ---- - -Fixed unexpected behaviour where configuration supplied with `APP_CONFIG_*` environment variables where not filtered by the configuration schema. diff --git a/.changeset/friendly-cougars-return.md b/.changeset/friendly-cougars-return.md deleted file mode 100644 index 8852177e0a..0000000000 --- a/.changeset/friendly-cougars-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Added support for a new experimental `EXPERIMENTAL_TRIM_NEXT_ENTRY` flag which removes any `./next` entry points present in packages when building and publishing. diff --git a/.changeset/funny-dancers-drum.md b/.changeset/funny-dancers-drum.md deleted file mode 100644 index 3f57244a1a..0000000000 --- a/.changeset/funny-dancers-drum.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-search-backend-module-techdocs': minor ---- - -Refactor TechDocs collator, enable clients to override the mkdocs search index transformer, so that per document properties (like tags) can be added to Backstage search index. diff --git a/.changeset/funny-rocks-train.md b/.changeset/funny-rocks-train.md deleted file mode 100644 index f5b2fbba63..0000000000 --- a/.changeset/funny-rocks-train.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/frontend-plugin-api': patch -'@backstage/frontend-test-utils': patch ---- - -Internal refactor of usage of opaque types. diff --git a/.changeset/fuzzy-elephants-tease.md b/.changeset/fuzzy-elephants-tease.md deleted file mode 100644 index 014a1136fd..0000000000 --- a/.changeset/fuzzy-elephants-tease.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Fixed lack of `.yarnrc.yml` in the template. diff --git a/.changeset/giant-kiwis-retire.md b/.changeset/giant-kiwis-retire.md deleted file mode 100644 index 380e05042f..0000000000 --- a/.changeset/giant-kiwis-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/app-defaults': patch ---- - -Added `externalLink` to icon defaults diff --git a/.changeset/gold-pots-end.md b/.changeset/gold-pots-end.md deleted file mode 100644 index e7291fc3ad..0000000000 --- a/.changeset/gold-pots-end.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': minor ---- - -Improved the layout of the manage templates page (`/edit`) by adding icons and descriptions that better describe what each page is for. Updated the header menu to link back to the scaffolder create page. diff --git a/.changeset/good-eels-drive.md b/.changeset/good-eels-drive.md deleted file mode 100644 index c90a1263ec..0000000000 --- a/.changeset/good-eels-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -It is possible to define a custom error element to be shown when sign in fails diff --git a/.changeset/good-trainers-appear.md b/.changeset/good-trainers-appear.md deleted file mode 100644 index 3bce8c86bd..0000000000 --- a/.changeset/good-trainers-appear.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -The check for `react-dom/client` will now properly always run from the target directory. diff --git a/.changeset/gorgeous-months-fix.md b/.changeset/gorgeous-months-fix.md deleted file mode 100644 index f248afad46..0000000000 --- a/.changeset/gorgeous-months-fix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Fix behavior of scaffolder entity pickers (EntityPicker, MultiEntityPicker, MyGroupsPicker) to not auto-fill and disable the field if there is only a single value option and the field is not required. diff --git a/.changeset/great-eagles-repair.md b/.changeset/great-eagles-repair.md deleted file mode 100644 index 886fb5df7a..0000000000 --- a/.changeset/great-eagles-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/frontend-test-utils': patch ---- - -Added an `ApiMock`, analogous to `ServiceMock` from the backend test utils. diff --git a/.changeset/green-berries-wave.md b/.changeset/green-berries-wave.md deleted file mode 100644 index 574d329488..0000000000 --- a/.changeset/green-berries-wave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -feat: experimentally support using rspack instead under `EXPERIMENTAL_RSPACK` env flag diff --git a/.changeset/green-bottles-live.md b/.changeset/green-bottles-live.md deleted file mode 100644 index 6bed257eee..0000000000 --- a/.changeset/green-bottles-live.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-scaffolder': patch ---- - -Add support for pagination in scaffolder tasks list diff --git a/.changeset/green-cooks-sort.md b/.changeset/green-cooks-sort.md deleted file mode 100644 index 51dd86ac2e..0000000000 --- a/.changeset/green-cooks-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog': minor ---- - -Adding negation keyword for entity filtering diff --git a/.changeset/happy-ligers-think.md b/.changeset/happy-ligers-think.md deleted file mode 100644 index 69dd68ae6c..0000000000 --- a/.changeset/happy-ligers-think.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/app-defaults': patch ---- - -Updated the `bitbucket-server-auth` default API to set its environment based on the `auth.environment` config option instead of being hardcoded to `development`. diff --git a/.changeset/healthy-shoes-judge.md b/.changeset/healthy-shoes-judge.md deleted file mode 100644 index eebd89a23d..0000000000 --- a/.changeset/healthy-shoes-judge.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch ---- - -Add `reviewers` input parameter to `publish:bitbucketServer:pull-request` diff --git a/.changeset/healthy-years-search.md b/.changeset/healthy-years-search.md deleted file mode 100644 index a613d11eea..0000000000 --- a/.changeset/healthy-years-search.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/plugin-catalog-react': minor ---- - -Add catalog service mocks under the `/testUtils` subpath export. - -You can now use e.g. `const catalog = catalogApiMock.mock()` in your test and then do assertions on `catalog.getEntities` without awkward type casting. diff --git a/.changeset/heavy-ties-tell.md b/.changeset/heavy-ties-tell.md deleted file mode 100644 index 072b0c7860..0000000000 --- a/.changeset/heavy-ties-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-microsoft-provider': patch ---- - -Add `skipUserProfile` config flag to Microsoft authenticator diff --git a/.changeset/honest-impalas-rescue.md b/.changeset/honest-impalas-rescue.md deleted file mode 100644 index bac076bba6..0000000000 --- a/.changeset/honest-impalas-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Fixed a bug in the `SidebarSubmenu` core component that caused the nested menu to overlap with the sidebar when the user hovers over the pinned sidebar. diff --git a/.changeset/hungry-buckets-repair.md b/.changeset/hungry-buckets-repair.md deleted file mode 100644 index fde682d603..0000000000 --- a/.changeset/hungry-buckets-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Change "Register Existing Component" CTA to outlined as it's not a primary action on the scaffolder pages diff --git a/.changeset/kind-avocados-speak.md b/.changeset/kind-avocados-speak.md deleted file mode 100644 index b57d271907..0000000000 --- a/.changeset/kind-avocados-speak.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/backend-dynamic-feature-service': patch ---- - -Enhance the API of the `DynamicPluginProvider` (available as a service) to: - -- expose the new `getScannedPackage()` method that returns the `ScannedPluginPackage` from which a given plugin has been loaded, -- add an optional `includeFailed` argument in the plugins list retrieval methods, to include the plugins that could be successfully loaded (`false` by default). diff --git a/.changeset/large-hats-reply.md b/.changeset/large-hats-reply.md deleted file mode 100644 index 02fe00d70c..0000000000 --- a/.changeset/large-hats-reply.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': minor ---- - -Text field content of the `EntityPicker` is now more readable as it uses entity title instead of entity reference. diff --git a/.changeset/large-plants-rhyme.md b/.changeset/large-plants-rhyme.md deleted file mode 100644 index 3566826730..0000000000 --- a/.changeset/large-plants-rhyme.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -'@backstage/frontend-plugin-api': patch ---- - -It is now possible to override the blueprint parameters when overriding an extension created from a blueprint: - -```ts -const myExtension = MyBlueprint.make({ - params: { - myParam: 'myDefault', - }, -}); - -const myOverride = myExtension.override({ - params: { - myParam: 'myOverride', - }, -}); -const myFactoryOverride = myExtension.override({ - factory(origFactory) { - return origFactory({ - params: { - myParam: 'myOverride', - }, - }); - }, -}); -``` - -The provided parameters will be merged with the original parameters of the extension. diff --git a/.changeset/lemon-badgers-share.md b/.changeset/lemon-badgers-share.md deleted file mode 100644 index c00b43c403..0000000000 --- a/.changeset/lemon-badgers-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-dynamic-feature-service': patch ---- - -Allow passing an async module loader in the `DynamicPluginsFeatureLoaderOptions`. diff --git a/.changeset/lemon-pumpkins-lick.md b/.changeset/lemon-pumpkins-lick.md deleted file mode 100644 index 361c5769e3..0000000000 --- a/.changeset/lemon-pumpkins-lick.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch -'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch -'@backstage/plugin-scaffolder-backend-module-gitlab': patch -'@backstage/plugin-scaffolder-backend-module-rails': patch -'@backstage/plugin-scaffolder-backend-module-sentry': patch -'@backstage/plugin-scaffolder-backend-module-yeoman': patch -'@backstage/plugin-search-backend-module-stack-overflow-collator': patch ---- - -Updated installation instructions in README to not include `/alpha`. diff --git a/.changeset/light-rats-travel.md b/.changeset/light-rats-travel.md deleted file mode 100644 index de497567ef..0000000000 --- a/.changeset/light-rats-travel.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch -'@backstage/plugin-search-backend-module-stack-overflow-collator': patch -'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch -'@backstage/plugin-scaffolder-backend-module-notifications': patch -'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch -'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch -'@backstage/plugin-auth-backend-module-aws-alb-provider': patch -'@backstage/plugin-search-backend-module-elasticsearch': patch -'@backstage/plugin-auth-backend-module-guest-provider': patch -'@backstage/plugin-catalog-backend-module-unprocessed': patch -'@backstage/plugin-notifications-backend-module-email': patch -'@backstage/plugin-auth-backend-module-oidc-provider': patch -'@backstage/plugin-catalog-backend-module-gitlab-org': patch -'@backstage/backend-dynamic-feature-service': patch -'@backstage/plugin-scaffolder-backend-module-github': patch -'@backstage/plugin-scaffolder-backend-module-gitlab': patch -'@backstage/plugin-scaffolder-backend-module-yeoman': patch -'@backstage/plugin-scaffolder-backend-module-rails': patch -'@backstage/plugin-catalog-backend-module-openapi': patch -'@backstage/plugin-search-backend-module-techdocs': patch -'@backstage/plugin-catalog-backend-module-github': patch -'@backstage/plugin-events-backend-module-aws-sqs': patch -'@backstage/plugin-search-backend-module-catalog': patch -'@backstage/plugin-search-backend-module-explore': patch -'@backstage/plugin-scaffolder-node-test-utils': patch -'@backstage/plugin-search-backend-module-pg': patch -'@backstage/plugin-notifications-backend': patch -'@backstage/plugin-search-backend-node': patch -'@backstage/plugin-kubernetes-backend': patch -'@backstage/plugin-notifications-node': patch -'@backstage/plugin-permission-backend': patch -'@backstage/plugin-scaffolder-backend': patch -'@backstage/backend-defaults': patch -'@backstage/backend-app-api': patch -'@backstage/plugin-devtools-backend': patch -'@backstage/plugin-techdocs-backend': patch -'@backstage/plugin-catalog-backend': patch -'@backstage/plugin-kubernetes-node': patch -'@backstage/plugin-permission-node': patch -'@backstage/plugin-scaffolder-node': patch -'@backstage/plugin-signals-backend': patch -'@backstage/plugin-events-backend': patch -'@backstage/plugin-search-backend': patch -'@backstage/plugin-proxy-backend': patch -'@backstage/plugin-auth-backend': patch -'@backstage/plugin-signals-node': patch -'@backstage/plugin-app-backend': patch -'@backstage/plugin-events-node': patch -'@backstage/plugin-auth-node': patch -'@backstage/cli': patch ---- - -Remove references to in-repo backend-common diff --git a/.changeset/long-humans-hunt.md b/.changeset/long-humans-hunt.md deleted file mode 100644 index e27ebfbd3d..0000000000 --- a/.changeset/long-humans-hunt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': minor ---- - -Added ability to create a new local scaffolder template to ease onboarding when creating new templates. diff --git a/.changeset/loud-hotels-tan.md b/.changeset/loud-hotels-tan.md deleted file mode 100644 index 34890dfe97..0000000000 --- a/.changeset/loud-hotels-tan.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-react': minor ---- - -Added a new prop, `disableTooltip` to the `EntityRefLink` component diff --git a/.changeset/lovely-bees-walk.md b/.changeset/lovely-bees-walk.md deleted file mode 100644 index 223acf1769..0000000000 --- a/.changeset/lovely-bees-walk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-node': patch ---- - -Documentation for the `testUtils` named export diff --git a/.changeset/lovely-jokes-breathe.md b/.changeset/lovely-jokes-breathe.md deleted file mode 100644 index f5782832eb..0000000000 --- a/.changeset/lovely-jokes-breathe.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -'@backstage/plugin-search-backend-module-elasticsearch': minor -'@backstage/plugin-scaffolder-backend': minor -'@backstage/plugin-techdocs-backend': minor -'@backstage/plugin-catalog-backend': minor -'@backstage/plugin-search-backend': minor -'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch -'@backstage/plugin-catalog-backend-module-bitbucket-server': patch -'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch -'@backstage/plugin-events-backend-module-bitbucket-cloud': patch -'@backstage/plugin-catalog-backend-module-msgraph': patch -'@backstage/plugin-search-backend-module-techdocs': patch -'@backstage/plugin-catalog-backend-module-gerrit': patch -'@backstage/plugin-catalog-backend-module-github': patch -'@backstage/plugin-catalog-backend-module-gitlab': patch -'@backstage/plugin-events-backend-module-aws-sqs': patch -'@backstage/plugin-search-backend-module-catalog': patch -'@backstage/plugin-search-backend-module-explore': patch -'@backstage/plugin-catalog-backend-module-azure': patch -'@backstage/plugin-events-backend-module-gerrit': patch -'@backstage/plugin-events-backend-module-azure': patch -'@backstage/plugin-catalog-backend-module-aws': patch -'@backstage/plugin-search-backend-module-pg': patch -'@backstage/plugin-user-settings-backend': patch -'@backstage/plugin-kubernetes-backend': patch -'@backstage/plugin-permission-backend': patch -'@backstage/plugin-events-backend': patch -'@backstage/plugin-proxy-backend': patch -'@backstage/plugin-app-backend': patch ---- - -The export for the new backend system at the `/alpha` export is now also available via the main entry point, which means that you can remove the `/alpha` suffix from the import. diff --git a/.changeset/lucky-mugs-drive.md b/.changeset/lucky-mugs-drive.md deleted file mode 100644 index f3253d834a..0000000000 --- a/.changeset/lucky-mugs-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Remove some dependencies that aren't required anymore diff --git a/.changeset/mighty-forks-exercise.md b/.changeset/mighty-forks-exercise.md deleted file mode 100644 index 2ec5b90fa2..0000000000 --- a/.changeset/mighty-forks-exercise.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Added migration `20241003170511_alter_target_in_locations.js` to change the target column in the `locations` table to TEXT type. -Added a hash for the key column in the `refresh_keys` table. diff --git a/.changeset/mighty-terms-peel.md b/.changeset/mighty-terms-peel.md deleted file mode 100644 index 8804ee4556..0000000000 --- a/.changeset/mighty-terms-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -The backend plugin template for the `new` command has been updated to provide more guidance and use a more modern structure. diff --git a/.changeset/nasty-geese-repeat.md b/.changeset/nasty-geese-repeat.md deleted file mode 100644 index b000231057..0000000000 --- a/.changeset/nasty-geese-repeat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch ---- - -Turn down the logging level on most "all is well" type log messages diff --git a/.changeset/nasty-lamps-greet.md b/.changeset/nasty-lamps-greet.md deleted file mode 100644 index 75d8086db7..0000000000 --- a/.changeset/nasty-lamps-greet.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': minor ---- - -Added ability to link to a specific action on the actions page diff --git a/.changeset/neat-geckos-end.md b/.changeset/neat-geckos-end.md deleted file mode 100644 index 02a281b447..0000000000 --- a/.changeset/neat-geckos-end.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Tweaked the new package feature detection to not be active when building backend packages. diff --git a/.changeset/nice-badgers-travel.md b/.changeset/nice-badgers-travel.md deleted file mode 100644 index 7ec79b56d8..0000000000 --- a/.changeset/nice-badgers-travel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/repo-tools': minor ---- - -Adds a new command `backstage-repo-tools peer-deps` for validating your usage of peer dependencies in your plugins. It currently supports react related peer dependencies. It also has a `--fix` mode for quickly fixing any issues that it finds. diff --git a/.changeset/olive-walls-wave.md b/.changeset/olive-walls-wave.md deleted file mode 100644 index f7dc5434a6..0000000000 --- a/.changeset/olive-walls-wave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-home': minor ---- - -**BREAKING** Implement usage of unused `limit` query parameter in visits API `.list()` function diff --git a/.changeset/pink-sheep-dress.md b/.changeset/pink-sheep-dress.md deleted file mode 100644 index a4182efde2..0000000000 --- a/.changeset/pink-sheep-dress.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/repo-tools': patch ---- - -Fix issues with warnings in API reports not being checked or reported. - -Due to the recent version bump of API Extractor you may now see a lot of `ae-undocumented` warnings, -these can be ignored using the `-o` option, for example, `backstage-repo-tools api-reports -o ae-undocumented,ae-wrong-input-file-type`. diff --git a/.changeset/polite-days-flash.md b/.changeset/polite-days-flash.md deleted file mode 100644 index 6a54d08c5a..0000000000 --- a/.changeset/polite-days-flash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-compat-api': patch ---- - -Internal update to remove deprecated `BackstagePlugin` type and move to `FrontendPlugin` diff --git a/.changeset/poor-dodos-wait.md b/.changeset/poor-dodos-wait.md deleted file mode 100644 index f1d0b4e941..0000000000 --- a/.changeset/poor-dodos-wait.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Add translation to the editor toolbar component. diff --git a/.changeset/popular-items-retire.md b/.changeset/popular-items-retire.md deleted file mode 100644 index 2b737d9710..0000000000 --- a/.changeset/popular-items-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': patch ---- - -The `createMockDirectory` cleanup strategy has been changed, no longer requiring it to be called outside individual tests. diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 7444e718da..0000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,314 +0,0 @@ -{ - "mode": "exit", - "tag": "next", - "initialVersions": { - "example-app": "0.2.101", - "@backstage/app-defaults": "1.5.11", - "example-app-next": "0.0.15", - "app-next-example-plugin": "0.0.15", - "example-backend": "0.0.30", - "@backstage/backend-app-api": "1.0.0", - "@backstage/backend-defaults": "0.5.0", - "@backstage/backend-dev-utils": "0.1.5", - "@backstage/backend-dynamic-feature-service": "0.4.0", - "example-backend-legacy": "0.2.102", - "@backstage/backend-openapi-utils": "0.1.18", - "@backstage/backend-plugin-api": "1.0.0", - "@backstage/backend-test-utils": "1.0.0", - "@backstage/catalog-client": "1.7.0", - "@backstage/catalog-model": "1.7.0", - "@backstage/cli": "0.27.1", - "@backstage/cli-common": "0.1.14", - "@backstage/cli-node": "0.2.8", - "@backstage/codemods": "0.1.50", - "@backstage/config": "1.2.0", - "@backstage/config-loader": "1.9.1", - "@backstage/core-app-api": "1.15.0", - "@backstage/core-compat-api": "0.3.0", - "@backstage/core-components": "0.15.0", - "@backstage/core-plugin-api": "1.9.4", - "@backstage/create-app": "0.5.19", - "@backstage/dev-utils": "1.1.0", - "e2e-test": "0.2.20", - "@backstage/e2e-test-utils": "0.1.1", - "@backstage/errors": "1.2.4", - "@backstage/eslint-plugin": "0.1.9", - "@backstage/frontend-app-api": "0.9.0", - "@backstage/frontend-defaults": "0.1.0", - "@internal/frontend": "0.0.1", - "@backstage/frontend-plugin-api": "0.8.0", - "@backstage/frontend-test-utils": "0.2.0", - "@backstage/integration": "1.15.0", - "@backstage/integration-aws-node": "0.1.12", - "@backstage/integration-react": "1.1.31", - "@internal/opaque": "0.0.1", - "@backstage/release-manifests": "0.0.11", - "@backstage/repo-tools": "0.9.7", - "@techdocs/cli": "1.8.19", - "techdocs-cli-embedded-app": "0.2.100", - "@backstage/test-utils": "1.6.0", - "@backstage/theme": "0.5.7", - "@backstage/types": "1.1.1", - "@backstage/version-bridge": "1.0.9", - "yarn-plugin-backstage": "0.0.2", - "@backstage/plugin-api-docs": "0.11.9", - "@backstage/plugin-api-docs-module-protoc-gen-doc": "0.1.7", - "@backstage/plugin-app": "0.1.0", - "@backstage/plugin-app-backend": "0.3.74", - "@backstage/plugin-app-node": "0.1.25", - "@backstage/plugin-app-visualizer": "0.1.10", - "@backstage/plugin-auth-backend": "0.23.0", - "@backstage/plugin-auth-backend-module-atlassian-provider": "0.3.0", - "@backstage/plugin-auth-backend-module-auth0-provider": "0.1.0", - "@backstage/plugin-auth-backend-module-aws-alb-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-azure-easyauth-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-bitbucket-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-bitbucket-server-provider": "0.1.0", - "@backstage/plugin-auth-backend-module-cloudflare-access-provider": "0.3.0", - "@backstage/plugin-auth-backend-module-gcp-iap-provider": "0.3.0", - "@backstage/plugin-auth-backend-module-github-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-gitlab-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-google-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-guest-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-microsoft-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-oauth2-provider": "0.3.0", - "@backstage/plugin-auth-backend-module-oauth2-proxy-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-oidc-provider": "0.3.0", - "@backstage/plugin-auth-backend-module-okta-provider": "0.1.0", - "@backstage/plugin-auth-backend-module-onelogin-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-pinniped-provider": "0.2.0", - "@backstage/plugin-auth-backend-module-vmware-cloud-provider": "0.3.0", - "@backstage/plugin-auth-node": "0.5.2", - "@backstage/plugin-auth-react": "0.1.6", - "@backstage/plugin-bitbucket-cloud-common": "0.2.23", - "@backstage/plugin-catalog": "1.23.0", - "@backstage/plugin-catalog-backend": "1.26.0", - "@backstage/plugin-catalog-backend-module-aws": "0.4.2", - "@backstage/plugin-catalog-backend-module-azure": "0.2.2", - "@backstage/plugin-catalog-backend-module-backstage-openapi": "0.4.0", - "@backstage/plugin-catalog-backend-module-bitbucket-cloud": "0.3.2", - "@backstage/plugin-catalog-backend-module-bitbucket-server": "0.2.2", - "@backstage/plugin-catalog-backend-module-gcp": "0.3.0", - "@backstage/plugin-catalog-backend-module-gerrit": "0.2.2", - "@backstage/plugin-catalog-backend-module-github": "0.7.3", - "@backstage/plugin-catalog-backend-module-github-org": "0.3.0", - "@backstage/plugin-catalog-backend-module-gitlab": "0.4.2", - "@backstage/plugin-catalog-backend-module-gitlab-org": "0.2.0", - "@backstage/plugin-catalog-backend-module-incremental-ingestion": "0.5.3", - "@backstage/plugin-catalog-backend-module-ldap": "0.9.0", - "@backstage/plugin-catalog-backend-module-logs": "0.1.0", - "@backstage/plugin-catalog-backend-module-msgraph": "0.6.2", - "@backstage/plugin-catalog-backend-module-openapi": "0.2.0", - "@backstage/plugin-catalog-backend-module-puppetdb": "0.2.2", - "@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "0.2.0", - "@backstage/plugin-catalog-backend-module-unprocessed": "0.5.0", - "@backstage/plugin-catalog-common": "1.1.0", - "@backstage/plugin-catalog-graph": "0.4.9", - "@backstage/plugin-catalog-import": "0.12.3", - "@backstage/plugin-catalog-node": "1.13.0", - "@backstage/plugin-catalog-react": "1.13.0", - "@backstage/plugin-catalog-unprocessed-entities": "0.2.8", - "@backstage/plugin-catalog-unprocessed-entities-common": "0.0.4", - "@backstage/plugin-config-schema": "0.1.59", - "@backstage/plugin-devtools": "0.1.18", - "@backstage/plugin-devtools-backend": "0.4.0", - "@backstage/plugin-devtools-common": "0.1.12", - "@backstage/plugin-events-backend": "0.3.12", - "@backstage/plugin-events-backend-module-aws-sqs": "0.4.2", - "@backstage/plugin-events-backend-module-azure": "0.2.11", - "@backstage/plugin-events-backend-module-bitbucket-cloud": "0.2.11", - "@backstage/plugin-events-backend-module-gerrit": "0.2.11", - "@backstage/plugin-events-backend-module-github": "0.2.11", - "@backstage/plugin-events-backend-module-gitlab": "0.2.11", - "@backstage/plugin-events-backend-test-utils": "0.1.35", - "@backstage/plugin-events-node": "0.4.0", - "@internal/plugin-todo-list": "1.0.31", - "@internal/plugin-todo-list-backend": "1.0.31", - "@internal/plugin-todo-list-common": "1.0.21", - "@backstage/plugin-home": "0.7.10", - "@backstage/plugin-home-react": "0.1.17", - "@backstage/plugin-kubernetes": "0.11.14", - "@backstage/plugin-kubernetes-backend": "0.18.6", - "@backstage/plugin-kubernetes-cluster": "0.0.15", - "@backstage/plugin-kubernetes-common": "0.8.3", - "@backstage/plugin-kubernetes-node": "0.1.19", - "@backstage/plugin-kubernetes-react": "0.4.3", - "@backstage/plugin-notifications": "0.3.1", - "@backstage/plugin-notifications-backend": "0.4.0", - "@backstage/plugin-notifications-backend-module-email": "0.3.0", - "@backstage/plugin-notifications-common": "0.0.5", - "@backstage/plugin-notifications-node": "0.2.6", - "@backstage/plugin-org": "0.6.29", - "@backstage/plugin-org-react": "0.1.28", - "@backstage/plugin-permission-backend": "0.5.49", - "@backstage/plugin-permission-backend-module-allow-all-policy": "0.2.0", - "@backstage/plugin-permission-common": "0.8.1", - "@backstage/plugin-permission-node": "0.8.3", - "@backstage/plugin-permission-react": "0.4.26", - "@backstage/plugin-proxy-backend": "0.5.6", - "@backstage/plugin-scaffolder": "1.25.0", - "@backstage/plugin-scaffolder-backend": "1.25.0", - "@backstage/plugin-scaffolder-backend-module-azure": "0.2.0", - "@backstage/plugin-scaffolder-backend-module-bitbucket": "0.3.0", - "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud": "0.2.0", - "@backstage/plugin-scaffolder-backend-module-bitbucket-server": "0.2.0", - "@backstage/plugin-scaffolder-backend-module-confluence-to-markdown": "0.3.0", - "@backstage/plugin-scaffolder-backend-module-cookiecutter": "0.3.0", - "@backstage/plugin-scaffolder-backend-module-gcp": "0.2.0", - "@backstage/plugin-scaffolder-backend-module-gerrit": "0.2.0", - "@backstage/plugin-scaffolder-backend-module-gitea": "0.2.0", - "@backstage/plugin-scaffolder-backend-module-github": "0.5.0", - "@backstage/plugin-scaffolder-backend-module-gitlab": "0.5.0", - "@backstage/plugin-scaffolder-backend-module-notifications": "0.1.0", - "@backstage/plugin-scaffolder-backend-module-rails": "0.5.0", - "@backstage/plugin-scaffolder-backend-module-sentry": "0.2.0", - "@backstage/plugin-scaffolder-backend-module-yeoman": "0.4.0", - "@backstage/plugin-scaffolder-common": "1.5.6", - "@backstage/plugin-scaffolder-node": "0.4.11", - "@backstage/plugin-scaffolder-node-test-utils": "0.1.12", - "@backstage/plugin-scaffolder-react": "1.12.0", - "@backstage/plugin-search": "1.4.16", - "@backstage/plugin-search-backend": "1.5.17", - "@backstage/plugin-search-backend-module-catalog": "0.2.2", - "@backstage/plugin-search-backend-module-elasticsearch": "1.5.6", - "@backstage/plugin-search-backend-module-explore": "0.2.2", - "@backstage/plugin-search-backend-module-pg": "0.5.35", - "@backstage/plugin-search-backend-module-stack-overflow-collator": "0.3.0", - "@backstage/plugin-search-backend-module-techdocs": "0.2.2", - "@backstage/plugin-search-backend-node": "1.3.2", - "@backstage/plugin-search-common": "1.2.14", - "@backstage/plugin-search-react": "1.8.0", - "@backstage/plugin-signals": "0.0.10", - "@backstage/plugin-signals-backend": "0.2.0", - "@backstage/plugin-signals-node": "0.1.11", - "@backstage/plugin-signals-react": "0.0.5", - "@backstage/plugin-techdocs": "1.10.9", - "@backstage/plugin-techdocs-addons-test-utils": "1.0.38", - "@backstage/plugin-techdocs-backend": "1.10.13", - "@backstage/plugin-techdocs-common": "0.1.0", - "@backstage/plugin-techdocs-module-addons-contrib": "1.1.14", - "@backstage/plugin-techdocs-node": "1.12.11", - "@backstage/plugin-techdocs-react": "1.2.8", - "@backstage/plugin-user-settings": "0.8.12", - "@backstage/plugin-user-settings-backend": "0.2.24", - "@backstage/plugin-user-settings-common": "0.0.1", - "@internal/scaffolder": "0.0.1" - }, - "changesets": [ - "angry-cycles-call", - "angry-mayflies-collect", - "angry-windows-decide", - "big-rules-nail", - "breezy-bulldogs-smell", - "brown-frogs-walk", - "calm-owls-move", - "chair-fairs-drive", - "chilled-dolphins-join", - "chilled-melons-smash", - "clever-paws-stare", - "cold-nails-rescue", - "crash-loop-baby", - "crash-loop-honey", - "crash-loop-yeah", - "create-app-1727774359", - "create-app-1728387650", - "cuddly-stingrays-smell", - "curly-foxes-brake", - "curly-tomatoes-reply", - "cyan-cooks-sing", - "cyan-peaches-lay", - "cyan-vans-study", - "dependabot-a3fd85a", - "dry-frogs-drum", - "early-drinks-kneel", - "early-sloths-cross", - "eight-clocks-complain", - "eight-steaks-chew", - "eighty-mice-turn", - "eleven-beds-play", - "eleven-pugs-hear", - "fair-chairs-drive", - "famous-bobcats-remain", - "fifty-trainers-watch", - "five-gorillas-pay", - "five-turkeys-taste", - "flat-eels-exist", - "flat-seals-type", - "fluffy-dolphins-battle", - "fluffy-pears-cry", - "four-moons-watch", - "friendly-coins-approve", - "friendly-cougars-return", - "funny-rocks-train", - "fuzzy-elephants-tease", - "giant-kiwis-retire", - "gold-pots-end", - "great-eagles-repair", - "green-bottles-live", - "green-cooks-sort", - "happy-ligers-think", - "healthy-shoes-judge", - "healthy-years-search", - "heavy-ties-tell", - "honest-impalas-rescue", - "hungry-buckets-repair", - "large-hats-reply", - "large-plants-rhyme", - "light-rats-travel", - "long-humans-hunt", - "loud-hotels-tan", - "lovely-bees-walk", - "nasty-lamps-greet", - "neat-geckos-end", - "nice-badgers-travel", - "olive-walls-wave", - "polite-days-flash", - "poor-dodos-wait", - "pretty-buses-repair", - "pretty-plants-hammer", - "purple-toys-heal", - "quiet-dingos-bathe", - "quiet-needles-impress", - "rare-crabs-cheat", - "rare-rabbits-flow", - "renovate-156753b", - "renovate-7874fad", - "renovate-85a184e", - "renovate-87a3bd2", - "renovate-9f7136b", - "renovate-f88b005", - "rich-deers-attend", - "rich-needles-collect", - "rotten-camels-deny", - "rude-apricots-eat", - "sharp-lamps-fix", - "shy-olives-swim", - "shy-plants-retire", - "silly-geckos-learn", - "silly-readers-build", - "slimy-ravens-end", - "slow-gorillas-thank", - "slow-trees-compare", - "small-donkeys-attack", - "smart-jobs-sit", - "sour-grapes-trade", - "sour-phones-fix", - "stale-ravens-clap", - "stale-roses-serve", - "strange-bees-attack", - "strong-monkeys-melt", - "sweet-chicken-smash", - "ten-apes-turn", - "ten-rings-look", - "thick-tables-give", - "thirty-pets-fry", - "thirty-pianos-mix", - "tiny-pugs-kick", - "tough-fireants-itch", - "tough-pillows-sip", - "tricky-shoes-lie", - "twenty-cups-knock", - "two-plums-fail", - "weak-bottles-cross" - ] -} diff --git a/.changeset/pretty-buses-repair.md b/.changeset/pretty-buses-repair.md deleted file mode 100644 index e5575c36c1..0000000000 --- a/.changeset/pretty-buses-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Standardize template editor pages desktop and mobile layouts. diff --git a/.changeset/pretty-pans-exist.md b/.changeset/pretty-pans-exist.md deleted file mode 100644 index e9ccdda0e0..0000000000 --- a/.changeset/pretty-pans-exist.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-app': patch ---- - -Added missing default `SignInPageExtension` which by default uses guest auth, missing `ApiExtensions` for `scmAuth` diff --git a/.changeset/pretty-plants-hammer.md b/.changeset/pretty-plants-hammer.md deleted file mode 100644 index c070f769c4..0000000000 --- a/.changeset/pretty-plants-hammer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/integration-react': minor ---- - -Added new ScmAuth method `forBitbucketServer` that uses correct OAuth scopes by default. Also updated `forBitbucket` method to allow overriding the default OAuth scopes. diff --git a/.changeset/purple-toys-heal.md b/.changeset/purple-toys-heal.md deleted file mode 100644 index 4a57dca64f..0000000000 --- a/.changeset/purple-toys-heal.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend-module-vmware-cloud-provider': minor ---- - -**BREAKING**: The `profileEmailMatchingUserEntityEmail` sign-in resolver has been removed as it was using an insecure fallback for resolving user identities. See https://backstage.io/docs/auth/identity-resolver#sign-in-without-users-in-the-catalog for how to create a custom sign-in resolver if needed as a replacement. diff --git a/.changeset/quiet-dingos-bathe.md b/.changeset/quiet-dingos-bathe.md deleted file mode 100644 index b0e41de687..0000000000 --- a/.changeset/quiet-dingos-bathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Fixed a bug where the concurrency limiter for URL reading was not honored diff --git a/.changeset/quiet-islands-learn.md b/.changeset/quiet-islands-learn.md deleted file mode 100644 index 7e2ad6bdf1..0000000000 --- a/.changeset/quiet-islands-learn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Add configuration parameters for deferred stitcher diff --git a/.changeset/quiet-lions-lie.md b/.changeset/quiet-lions-lie.md deleted file mode 100644 index 4aa6567005..0000000000 --- a/.changeset/quiet-lions-lie.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-scaffolder': patch ---- - -Scaffolder task routes require read permission to access. The tasks list option in the scaffolder page context menu only shows with permission. diff --git a/.changeset/quiet-needles-impress.md b/.changeset/quiet-needles-impress.md deleted file mode 100644 index a79fe97b91..0000000000 --- a/.changeset/quiet-needles-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-gitlab': minor ---- - -declare correct type (number) for publish:gitlab output.projectId diff --git a/.changeset/rare-crabs-cheat.md b/.changeset/rare-crabs-cheat.md deleted file mode 100644 index 6b4fd37ed7..0000000000 --- a/.changeset/rare-crabs-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs': patch ---- - -Add support for mkdocs material palette conditional hashes. diff --git a/.changeset/rare-rabbits-flow.md b/.changeset/rare-rabbits-flow.md deleted file mode 100644 index 6b64957d59..0000000000 --- a/.changeset/rare-rabbits-flow.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -'@backstage/plugin-catalog-backend-module-bitbucket-cloud': minor ---- - -Fixes the event-based updates at `BitbucketCloudEntityProvider`. - -Previously, this entity provider had optional event support for legacy backends -that could be enabled by passing `catalogApi`, `events`, and `tokenManager`. - -For the new/current backend system, the `catalogModuleBitbucketCloudEntityProvider` -(`catalog.bitbucket-cloud-entity-provider`), event support was enabled by default. - -A recent change removed `tokenManager` as a dependency from the module as well as removed it as input. -While this didn't break the instantiation of the module, it broke the event-based updates, -and led to a runtime misbehavior, accompanied by an info log message. - -This change will replace the use of `tokenManager` with the use of `auth` (`AuthService`). - -Additionally, to simplify, it will make `catalogApi` and `events` required dependencies. -For the current backend system, this change is transparent and doesn't require any action. -For the legacy backend system, this change will require you to pass those dependencies -if you didn't do it already. - -BREAKING CHANGES: - -_(For legacy backend users only.)_ - -Previously optional `catalogApi`, and `events` are required now. -A new required dependency `auth` was added. diff --git a/.changeset/real-rockets-divide.md b/.changeset/real-rockets-divide.md deleted file mode 100644 index 2506a89f22..0000000000 --- a/.changeset/real-rockets-divide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-test-utils': patch ---- - -Minor doc string changes diff --git a/.changeset/real-tigers-punch.md b/.changeset/real-tigers-punch.md deleted file mode 100644 index c5597e50da..0000000000 --- a/.changeset/real-tigers-punch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Updated the Vite implementation behind the `EXPERIMENTAL_VITE` flag to work with more recent versions of Backstage. diff --git a/.changeset/renovate-156753b.md b/.changeset/renovate-156753b.md deleted file mode 100644 index 0ef9afb0e2..0000000000 --- a/.changeset/renovate-156753b.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/plugin-kubernetes-cluster': patch -'@backstage/plugin-kubernetes-react': patch -'@backstage/plugin-kubernetes': patch ---- - -Updated dependency `@kubernetes-models/base` to `^5.0.0`. diff --git a/.changeset/renovate-6eaf36e.md b/.changeset/renovate-6eaf36e.md deleted file mode 100644 index e4533da674..0000000000 --- a/.changeset/renovate-6eaf36e.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@backstage/plugin-home-react': patch -'@backstage/plugin-home': patch -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-scaffolder': patch ---- - -Updated dependency `@rjsf/utils` to `5.21.2`. -Updated dependency `@rjsf/core` to `5.21.2`. -Updated dependency `@rjsf/material-ui` to `5.21.2`. -Updated dependency `@rjsf/validator-ajv8` to `5.21.2`. diff --git a/.changeset/renovate-7874fad.md b/.changeset/renovate-7874fad.md deleted file mode 100644 index b7ccd5fe95..0000000000 --- a/.changeset/renovate-7874fad.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs-node': patch ---- - -Updated dependency `@smithy/node-http-handler` to `^3.0.0`. diff --git a/.changeset/renovate-85a184e.md b/.changeset/renovate-85a184e.md deleted file mode 100644 index 91b575e6db..0000000000 --- a/.changeset/renovate-85a184e.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'@backstage/backend-defaults': patch -'@backstage/cli': patch -'@backstage/integration': patch -'@backstage/plugin-catalog-backend-module-github': patch -'@backstage/plugin-catalog-backend': patch -'@backstage/plugin-catalog-import': patch -'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch -'@backstage/plugin-scaffolder': patch -'@backstage/plugin-techdocs-module-addons-contrib': patch -'@backstage/plugin-techdocs-node': patch -'@backstage/plugin-techdocs': patch ---- - -Updated dependency `git-url-parse` to `^15.0.0`. diff --git a/.changeset/renovate-87a3bd2.md b/.changeset/renovate-87a3bd2.md deleted file mode 100644 index c14def75b7..0000000000 --- a/.changeset/renovate-87a3bd2.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-azure': patch ---- - -Updated dependency `azure-devops-node-api` to `^14.0.0`. diff --git a/.changeset/renovate-966d123.md b/.changeset/renovate-966d123.md deleted file mode 100644 index c3f868cee9..0000000000 --- a/.changeset/renovate-966d123.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/repo-tools': patch ---- - -Updated dependency `@useoptic/optic` to `^1.0.0`. diff --git a/.changeset/renovate-9f7136b.md b/.changeset/renovate-9f7136b.md deleted file mode 100644 index a1efc81de7..0000000000 --- a/.changeset/renovate-9f7136b.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-search-backend-module-explore': patch ---- - -Updated dependency `@backstage-community/plugin-explore-common` to `^0.0.6`. diff --git a/.changeset/renovate-cc4bfa7.md b/.changeset/renovate-cc4bfa7.md deleted file mode 100644 index b3434c8127..0000000000 --- a/.changeset/renovate-cc4bfa7.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/codemods': patch ---- - -Updated dependency `@types/jscodeshift` to `^0.12.0`. diff --git a/.changeset/renovate-d7e90e4.md b/.changeset/renovate-d7e90e4.md deleted file mode 100644 index 58c24b2ddf..0000000000 --- a/.changeset/renovate-d7e90e4.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/cli': patch -'@backstage/plugin-scaffolder-backend': patch ---- - -Updated dependency `esbuild` to `^0.24.0`. diff --git a/.changeset/renovate-f88b005.md b/.changeset/renovate-f88b005.md deleted file mode 100644 index b62080e8da..0000000000 --- a/.changeset/renovate-f88b005.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/plugin-kubernetes-cluster': patch -'@backstage/plugin-kubernetes-react': patch -'@backstage/plugin-kubernetes': patch ---- - -Updated dependency `@kubernetes-models/apimachinery` to `^2.0.0`. diff --git a/.changeset/rich-deers-attend.md b/.changeset/rich-deers-attend.md deleted file mode 100644 index 1b26636009..0000000000 --- a/.changeset/rich-deers-attend.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/backend-app-api': patch ---- - -The backend will no longer exit immediately if any plugin or modules fails to initialize. Instead, the backend will wait for all plugins and modules to either start up successfully or throw, and then shut down the backend if there were any initialization errors. - -This fixes an issue where backend initialization errors in adjacent plugins during database schema migration could cause the database migrations to be stuck in a locked state. diff --git a/.changeset/rich-needles-collect.md b/.changeset/rich-needles-collect.md deleted file mode 100644 index dab36e9543..0000000000 --- a/.changeset/rich-needles-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-react': minor ---- - -Renamed Template Editor to Manage Templates. diff --git a/.changeset/rotten-camels-deny.md b/.changeset/rotten-camels-deny.md deleted file mode 100644 index f5660d953a..0000000000 --- a/.changeset/rotten-camels-deny.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Support `--max-warnings` flag for package linting diff --git a/.changeset/rotten-rockets-deny.md b/.changeset/rotten-rockets-deny.md deleted file mode 100644 index 58dec57c32..0000000000 --- a/.changeset/rotten-rockets-deny.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Running `repo lint` with the `--successCache` flag now respects `.gitinore`, and it ignores projects without a `lint` script. diff --git a/.changeset/rude-apricots-eat.md b/.changeset/rude-apricots-eat.md deleted file mode 100644 index 198d6a0ec7..0000000000 --- a/.changeset/rude-apricots-eat.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-defaults': patch -'@backstage/integration': patch ---- - -Updating error message for getProjectId when fetching Gitlab project from its url to be more accurate diff --git a/.changeset/shaggy-weeks-hunt.md b/.changeset/shaggy-weeks-hunt.md deleted file mode 100644 index 2b007f6944..0000000000 --- a/.changeset/shaggy-weeks-hunt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Tweak `Dockerfile` to fix deprecated syntax. diff --git a/.changeset/sharp-lamps-fix.md b/.changeset/sharp-lamps-fix.md deleted file mode 100644 index 52de6690fe..0000000000 --- a/.changeset/sharp-lamps-fix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Add tests for the `useTemplateDirectory` hook. diff --git a/.changeset/shy-olives-swim.md b/.changeset/shy-olives-swim.md deleted file mode 100644 index 8a9a07fa81..0000000000 --- a/.changeset/shy-olives-swim.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@backstage/backend-dynamic-feature-service': patch -'@backstage/plugin-search-backend-module-techdocs': patch -'@backstage/plugin-search-backend-module-catalog': patch -'@backstage/plugin-search-backend-module-explore': patch -'@backstage/plugin-events-backend-module-github': patch -'@backstage/plugin-events-backend-module-gitlab': patch -'@backstage/plugin-events-node': patch ---- - -Updated backend installation instructions. diff --git a/.changeset/shy-plants-retire.md b/.changeset/shy-plants-retire.md deleted file mode 100644 index 77427452f5..0000000000 --- a/.changeset/shy-plants-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-search': patch ---- - -Updated the default SearchType.Accordion behavior to remain open after result type selection. This is a UX improvement to reduce the number of clicks needed when toggling result type filters. diff --git a/.changeset/silly-geckos-learn.md b/.changeset/silly-geckos-learn.md deleted file mode 100644 index 53d4301b5c..0000000000 --- a/.changeset/silly-geckos-learn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-user-settings': patch ---- - -`useUserProfile` will now use the user's picture stored in the catalog as a fallback if the identity provider doesn't return a picture. diff --git a/.changeset/silly-ligers-tan.md b/.changeset/silly-ligers-tan.md deleted file mode 100644 index 6b9097497d..0000000000 --- a/.changeset/silly-ligers-tan.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Adds the ability to disable catalog processing `catalog.processingInterval: false` in `app-config` diff --git a/.changeset/silly-readers-build.md b/.changeset/silly-readers-build.md deleted file mode 100644 index 4797c2b036..0000000000 --- a/.changeset/silly-readers-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Add an actions filter on the list actions page and drawer. diff --git a/.changeset/silver-comics-attend.md b/.changeset/silver-comics-attend.md deleted file mode 100644 index f13553b53f..0000000000 --- a/.changeset/silver-comics-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -Fix for backend shutdown hanging during local development due to SQLite connection shutdown never resolving. diff --git a/.changeset/slimy-ravens-end.md b/.changeset/slimy-ravens-end.md deleted file mode 100644 index 65e02079b1..0000000000 --- a/.changeset/slimy-ravens-end.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-techdocs': minor -'@backstage/theme': minor ---- - -Adds support for custom background colors in code blocks and inline code within TechDocs. diff --git a/.changeset/slow-gorillas-thank.md b/.changeset/slow-gorillas-thank.md deleted file mode 100644 index 2c52964a47..0000000000 --- a/.changeset/slow-gorillas-thank.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@backstage/plugin-events-backend': patch ---- - -The events backend now has its own built-in event bus for distributing events across multiple backend instances. It exposes a new HTTP API under `/bus/v1/` for publishing and reading events from the bus, as well as its own storage and notification mechanism for events. - -The backing event store for the bus only supports scaled deployment if PostgreSQL is used as the DBMS. If SQLite or MySQL is used, the event bus will fall back to an in-memory store that does not support multiple backend instances. - -The default `EventsService` implementation from `@backstage/plugin-events-node` has also been updated to use the new events bus. diff --git a/.changeset/slow-trees-compare.md b/.changeset/slow-trees-compare.md deleted file mode 100644 index 18e1a82ff9..0000000000 --- a/.changeset/slow-trees-compare.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch -'@backstage/plugin-scaffolder-react': patch -'@backstage/plugin-scaffolder-node': patch -'@backstage/plugin-scaffolder': patch ---- - -Make it possible to manually retry the scaffolder template from the step it failed diff --git a/.changeset/slow-walls-report.md b/.changeset/slow-walls-report.md deleted file mode 100644 index e5ab380006..0000000000 --- a/.changeset/slow-walls-report.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@backstage/backend-defaults': patch ---- - -The default root HTTP service implementation will now pretty-print JSON responses in development. - -If you are overriding the `rootHttpRouterServiceFactory` with a `configure` function that doesn't call `applyDefaults`, you can introduce this functionality by adding the following snippet inside `configure`: - -```ts -if (process.env.NODE_ENV === 'development') { - app.set('json spaces', 2); -} -``` diff --git a/.changeset/small-donkeys-attack.md b/.changeset/small-donkeys-attack.md deleted file mode 100644 index ecfc969452..0000000000 --- a/.changeset/small-donkeys-attack.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Added a new `--successCache` option to the `backstage-cli repo test` and `backstage-cli repo lint` commands. The cache keeps track of successful runs and avoids re-running for individual packages if they haven't changed. This option is intended only to be used in CI. - -In addition a `--successCacheDir ` option has also been added to be able to override the default cache directory. diff --git a/.changeset/smart-jobs-sit.md b/.changeset/smart-jobs-sit.md deleted file mode 100644 index edd21e67b5..0000000000 --- a/.changeset/smart-jobs-sit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/backend-openapi-utils': minor ---- - -Improved support for OpenAPI validation during Jest tests. Now, OpenAPI validation can happen as you are writing your Jest tests - you no longer have to run `repo schema openapi test`. diff --git a/.changeset/sour-grapes-trade.md b/.changeset/sour-grapes-trade.md deleted file mode 100644 index acbb6cdbe7..0000000000 --- a/.changeset/sour-grapes-trade.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -The Jest configuration will now search for a `src/setupTests.*` file with any valid script extension, not only `.ts`. diff --git a/.changeset/sour-phones-fix.md b/.changeset/sour-phones-fix.md deleted file mode 100644 index d2519f2ef5..0000000000 --- a/.changeset/sour-phones-fix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend-module-gitlab': patch ---- - -Updated `gitlab:group:ensureExists` action to instead use oauth client. diff --git a/.changeset/stale-ravens-clap.md b/.changeset/stale-ravens-clap.md deleted file mode 100644 index 3abb16a04d..0000000000 --- a/.changeset/stale-ravens-clap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Update catalog search table in transaction diff --git a/.changeset/stale-roses-serve.md b/.changeset/stale-roses-serve.md deleted file mode 100644 index 29dee56e22..0000000000 --- a/.changeset/stale-roses-serve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-events-node': patch ---- - -The default implementation of the `EventsService` now uses the new event bus for distributing events across multiple backend instances if the events backend plugin is installed. diff --git a/.changeset/strange-bees-attack.md b/.changeset/strange-bees-attack.md deleted file mode 100644 index c4e95097f8..0000000000 --- a/.changeset/strange-bees-attack.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -`Link` component now accepts `externalLinkIcon` prop diff --git a/.changeset/strong-monkeys-melt.md b/.changeset/strong-monkeys-melt.md deleted file mode 100644 index ef33b0cddd..0000000000 --- a/.changeset/strong-monkeys-melt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -The `LEGACY_BACKEND_START` flag is now deprecated. diff --git a/.changeset/sweet-chicken-smash.md b/.changeset/sweet-chicken-smash.md deleted file mode 100644 index 9aa4c60803..0000000000 --- a/.changeset/sweet-chicken-smash.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'@backstage/cli': minor ---- - -**BREAKING**: Removed the following deprecated commands: - -- `create`: Use `backstage-cli new` instead -- `create-plugin`: Use `backstage-cli new` instead -- `plugin:diff`: Use `backstage-cli fix` instead -- `test`: Use `backstage-cli repo test` or `backstage-cli package test` instead -- `versions:check`: Use `yarn dedupe` or `yarn-deduplicate` instead -- `clean`: Use `backstage-cli package clean` instead - -In addition, the experimental `install` and `onboard` commands have been removed since they have not received any updates since their introduction and we're expecting usage to be low. If you where relying on these commands, please let us know by opening an issue towards the main Backstage repository. diff --git a/.changeset/ten-apes-turn.md b/.changeset/ten-apes-turn.md deleted file mode 100644 index 750f48beba..0000000000 --- a/.changeset/ten-apes-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Disabled parsing of input source maps in the SWC transform for Jest. diff --git a/.changeset/ten-rings-look.md b/.changeset/ten-rings-look.md deleted file mode 100644 index d3f6e059bd..0000000000 --- a/.changeset/ten-rings-look.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/catalog-client': patch ---- - -Add missing doc string to API diff --git a/.changeset/thick-tables-give.md b/.changeset/thick-tables-give.md deleted file mode 100644 index e6b4026e51..0000000000 --- a/.changeset/thick-tables-give.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-node': patch ---- - -Use `branch` function instead of `checkout` function when creating branch diff --git a/.changeset/thin-chairs-ring.md b/.changeset/thin-chairs-ring.md deleted file mode 100644 index 104c78a96d..0000000000 --- a/.changeset/thin-chairs-ring.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'@backstage/test-utils': minor -'@backstage/frontend-test-utils': patch ---- - -Added a `mockApis` export, which will replace the `MockX` API implementation classes and their related types. This is analogous with the backend's `mockServices`. - -**DEPRECATED** several old helpers: - -- Deprecated `MockAnalyticsApi`, please use `mockApis.analytics` instead. -- Deprecated `MockConfigApi`, please use `mockApis.config` instead. -- Deprecated `MockPermissionApi`, please use `mockApis.permission` instead. -- Deprecated `MockStorageApi`, please use `mockApis.storage` instead. -- Deprecated `MockTranslationApi`, please use `mockApis.translation` instead. diff --git a/.changeset/thin-doors-rule.md b/.changeset/thin-doors-rule.md deleted file mode 100644 index 20823bb79f..0000000000 --- a/.changeset/thin-doors-rule.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-plugin-api': patch ---- - -Fixing issue with types for `ParamKeys` leading to type mismatches across versions diff --git a/.changeset/thirty-pets-fry.md b/.changeset/thirty-pets-fry.md deleted file mode 100644 index 2a588bb161..0000000000 --- a/.changeset/thirty-pets-fry.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@backstage/frontend-plugin-api': minor -'@backstage/core-plugin-api': minor ---- - -**BREAKING PRODUCERS**: The `IconComponent` no longer accepts `fontSize="default"`. This has effectively been removed from Material-UI since its last two major versions, and has not worked properly for them in a long time. - -This change should not have an effect on neither users of MUI4 nor MUI5/6, since the updated interface should still let you send the respective `SvgIcon` types into interfaces where relevant (e.g. as app icons). diff --git a/.changeset/thirty-pianos-mix.md b/.changeset/thirty-pianos-mix.md deleted file mode 100644 index 147307ac9e..0000000000 --- a/.changeset/thirty-pianos-mix.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-techdocs-module-addons-contrib': patch -'@backstage/plugin-techdocs': patch ---- - -Use more of the available space for the navigation sidebar. diff --git a/.changeset/tiny-pugs-kick.md b/.changeset/tiny-pugs-kick.md deleted file mode 100644 index 2d6f83b325..0000000000 --- a/.changeset/tiny-pugs-kick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Update the Scaffolder template editor to quickly access installed custom fields and actions when editing a template. diff --git a/.changeset/tough-fireants-itch.md b/.changeset/tough-fireants-itch.md deleted file mode 100644 index 3567ac82d0..0000000000 --- a/.changeset/tough-fireants-itch.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-techdocs-backend': patch -'@backstage/plugin-techdocs-node': patch ---- - -Allow to pass StorageOptions to GCS Publisher diff --git a/.changeset/tough-pillows-sip.md b/.changeset/tough-pillows-sip.md deleted file mode 100644 index aea3e2d5a0..0000000000 --- a/.changeset/tough-pillows-sip.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/integration': patch ---- - -Updated functions parseHarnessUrl, getHarnessLatestCommitUrl, getHarnessFileContentsUrl and getHarnessArchiveUrl to fix parsing of urls diff --git a/.changeset/tricky-shoes-lie.md b/.changeset/tricky-shoes-lie.md deleted file mode 100644 index d7a17f0345..0000000000 --- a/.changeset/tricky-shoes-lie.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@backstage/plugin-catalog-graph': patch ---- - -Added InfoCard `action` attribute for CatalogGraphCard - -```tsx -const action =