diff --git a/.changeset/add-frontend-dev-utils.md b/.changeset/add-frontend-dev-utils.md index 9b4299734d..2ba6c3e5b6 100644 --- a/.changeset/add-frontend-dev-utils.md +++ b/.changeset/add-frontend-dev-utils.md @@ -2,4 +2,4 @@ '@backstage/frontend-dev-utils': minor --- -Added `@backstage/frontend-dev-utils`, a new package that provides a minimal helper for wiring up a development app for frontend plugins using the new frontend system. It exports a `createDevApp` function that handles creating and rendering a development app from a `dev/` entry point. +Added `@backstage/frontend-dev-utils`, a new package that provides a minimal helper for wiring up a development app for frontend plugins using the new frontend system. It exports a `createDevApp` function that handles creating and rendering a development app from a `dev/` entry point. The dev app automatically bypasses the sign-in page. diff --git a/packages/frontend-dev-utils/package.json b/packages/frontend-dev-utils/package.json index be76ebdbe9..84e515cee1 100644 --- a/packages/frontend-dev-utils/package.json +++ b/packages/frontend-dev-utils/package.json @@ -37,11 +37,11 @@ }, "dependencies": { "@backstage/frontend-defaults": "workspace:^", - "@backstage/frontend-plugin-api": "workspace:^" + "@backstage/frontend-plugin-api": "workspace:^", + "@backstage/plugin-app": "workspace:^" }, "devDependencies": { "@backstage/cli": "workspace:^", - "@backstage/plugin-app": "workspace:^", "@backstage/test-utils": "workspace:^", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^16.0.0", diff --git a/packages/frontend-dev-utils/src/createDevApp.test.tsx b/packages/frontend-dev-utils/src/createDevApp.test.tsx index fd54ee26f3..7f94c5543e 100644 --- a/packages/frontend-dev-utils/src/createDevApp.test.tsx +++ b/packages/frontend-dev-utils/src/createDevApp.test.tsx @@ -21,7 +21,6 @@ import { import { within, waitFor } from '@testing-library/react'; import { mockApis } from '@backstage/test-utils'; import { createDevApp } from './createDevApp'; -import { default as appPlugin } from '@backstage/plugin-app'; describe('createDevApp', () => { afterEach(() => { @@ -46,16 +45,7 @@ describe('createDevApp', () => { }); createDevApp({ - features: [ - appPlugin.withOverrides({ - extensions: [ - appPlugin - .getExtension('sign-in-page:app') - .override({ disabled: true }), - ], - }), - testPlugin, - ], + features: [testPlugin], createAppOptions: { advanced: { configLoader: async () => ({ config: mockApis.config() }), diff --git a/packages/frontend-dev-utils/src/createDevApp.tsx b/packages/frontend-dev-utils/src/createDevApp.tsx index dd5d7efc59..078a9208cf 100644 --- a/packages/frontend-dev-utils/src/createDevApp.tsx +++ b/packages/frontend-dev-utils/src/createDevApp.tsx @@ -19,6 +19,7 @@ import { FrontendFeatureLoader, } from '@backstage/frontend-plugin-api'; import { createApp, CreateAppOptions } from '@backstage/frontend-defaults'; +import appPlugin from '@backstage/plugin-app'; import ReactDOM from 'react-dom/client'; /** @@ -55,7 +56,16 @@ export interface CreateDevAppOptions { export function createDevApp(options: CreateDevAppOptions): void { const app = createApp({ ...options.createAppOptions, - features: options.features, + features: [ + appPlugin.withOverrides({ + extensions: [ + appPlugin + .getExtension('sign-in-page:app') + .override({ disabled: true }), + ], + }), + ...options.features, + ], }); ReactDOM.createRoot(document.getElementById('root')!).render(