Bypass sign-in page in createDevApp
The dev app now automatically disables the sign-in page extension, so plugins under development don't require authentication. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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() }),
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user