diff --git a/packages/core-compat-api/src/collectLegacyRoutes.test.tsx b/packages/core-compat-api/src/collectLegacyRoutes.test.tsx index 4c2acd35a6..0319628b14 100644 --- a/packages/core-compat-api/src/collectLegacyRoutes.test.tsx +++ b/packages/core-compat-api/src/collectLegacyRoutes.test.tsx @@ -73,7 +73,7 @@ describe('collectLegacyRoutes', () => { defaultConfig: {}, }, { - id: 'api:plugin.scoringdata.service', + id: 'api:score-card/plugin.scoringdata.service', attachTo: { id: 'root', input: 'apis' }, disabled: false, }, @@ -89,7 +89,7 @@ describe('collectLegacyRoutes', () => { defaultConfig: {}, }, { - id: 'api:plugin.stackstorm.service', + id: 'api:stackstorm/plugin.stackstorm.service', attachTo: { id: 'root', input: 'apis' }, disabled: false, }, @@ -111,7 +111,7 @@ describe('collectLegacyRoutes', () => { defaultConfig: {}, }, { - id: 'api:plugin.puppetdb.service', + id: 'api:puppetDb/plugin.puppetdb.service', attachTo: { id: 'root', input: 'apis' }, disabled: false, }, @@ -209,7 +209,7 @@ describe('collectLegacyRoutes', () => { disabled: false, }, { - id: 'api:plugin.catalog.service', + id: 'api:catalog/plugin.catalog.service', attachTo: { id: 'root', input: 'apis', @@ -218,7 +218,7 @@ describe('collectLegacyRoutes', () => { disabled: false, }, { - id: 'api:catalog-react.starred-entities', + id: 'api:catalog/catalog-react.starred-entities', attachTo: { id: 'root', input: 'apis', @@ -227,7 +227,7 @@ describe('collectLegacyRoutes', () => { disabled: false, }, { - id: 'api:plugin.catalog.entity-presentation', + id: 'api:catalog/plugin.catalog.entity-presentation', attachTo: { id: 'root', input: 'apis', @@ -241,7 +241,7 @@ describe('collectLegacyRoutes', () => { id: 'score-card', extensions: [ { - id: 'api:plugin.scoringdata.service', + id: 'api:score-card/plugin.scoringdata.service', attachTo: { id: 'root', input: 'apis' }, disabled: false, }, diff --git a/packages/core-compat-api/src/collectLegacyRoutes.tsx b/packages/core-compat-api/src/collectLegacyRoutes.tsx index 197c245278..43e66ce859 100644 --- a/packages/core-compat-api/src/collectLegacyRoutes.tsx +++ b/packages/core-compat-api/src/collectLegacyRoutes.tsx @@ -269,7 +269,7 @@ export function collectLegacyRoutes( ...extensions, ...Array.from(plugin.getApis()).map(factory => ApiBlueprint.make({ - namespace: factory.api.id, + name: factory.api.id, params: { factory }, }), ), diff --git a/packages/core-compat-api/src/convertLegacyApp.test.tsx b/packages/core-compat-api/src/convertLegacyApp.test.tsx index b76a6c2d71..224ab46221 100644 --- a/packages/core-compat-api/src/convertLegacyApp.test.tsx +++ b/packages/core-compat-api/src/convertLegacyApp.test.tsx @@ -65,7 +65,7 @@ describe('convertLegacyApp', () => { defaultConfig: {}, }, { - id: 'api:plugin.scoringdata.service', + id: 'api:score-card/plugin.scoringdata.service', attachTo: { id: 'root', input: 'apis' }, disabled: false, }, @@ -81,7 +81,7 @@ describe('convertLegacyApp', () => { defaultConfig: {}, }, { - id: 'api:plugin.stackstorm.service', + id: 'api:stackstorm/plugin.stackstorm.service', attachTo: { id: 'root', input: 'apis' }, disabled: false, }, @@ -103,7 +103,7 @@ describe('convertLegacyApp', () => { defaultConfig: {}, }, { - id: 'api:plugin.puppetdb.service', + id: 'api:puppetDb/plugin.puppetdb.service', attachTo: { id: 'root', input: 'apis' }, disabled: false, }, diff --git a/packages/core-compat-api/src/convertLegacyApp.ts b/packages/core-compat-api/src/convertLegacyApp.ts index 2729664941..c3e569e85f 100644 --- a/packages/core-compat-api/src/convertLegacyApp.ts +++ b/packages/core-compat-api/src/convertLegacyApp.ts @@ -23,11 +23,12 @@ import React, { } from 'react'; import { ExtensionOverrides, + FrontendModule, FrontendPlugin, coreExtensionData, createExtension, createExtensionInput, - createExtensionOverrides, + createFrontendModule, } from '@backstage/frontend-plugin-api'; import { getComponentData } from '@backstage/core-plugin-api'; import { collectLegacyRoutes } from './collectLegacyRoutes'; @@ -61,7 +62,7 @@ function selectChildren( /** @public */ export function convertLegacyApp( rootElement: React.JSX.Element, -): (FrontendPlugin | ExtensionOverrides)[] { +): (FrontendPlugin | FrontendModule)[] { if (getComponentData(rootElement, 'core.type') === 'FlatRoutes') { return collectLegacyRoutes(rootElement); } @@ -104,7 +105,6 @@ export function convertLegacyApp( const [routesEl] = routesEls; const CoreLayoutOverride = createExtension({ - namespace: 'app', name: 'layout', attachTo: { id: 'app', input: 'root' }, inputs: { @@ -127,7 +127,6 @@ export function convertLegacyApp( }, }); const CoreNavOverride = createExtension({ - namespace: 'app', name: 'nav', attachTo: { id: 'app/layout', input: 'nav' }, output: [], @@ -139,7 +138,8 @@ export function convertLegacyApp( return [ ...collectedRoutes, - createExtensionOverrides({ + createFrontendModule({ + pluginId: 'app', extensions: [CoreLayoutOverride, CoreNavOverride], }), ]; diff --git a/packages/core-compat-api/src/convertLegacyPlugin.test.tsx b/packages/core-compat-api/src/convertLegacyPlugin.test.tsx index 3d5b001c61..01266a35b7 100644 --- a/packages/core-compat-api/src/convertLegacyPlugin.test.tsx +++ b/packages/core-compat-api/src/convertLegacyPlugin.test.tsx @@ -84,7 +84,7 @@ describe('convertLegacyPlugin', () => { }); expect(internalConverted.featureFlags).toEqual([{ name: 'test-flag' }]); expect(internalConverted.extensions.map(e => e.id)).toEqual([ - 'api:plugin.test.client', + 'api:test/plugin.test.client', 'page:test', ]); }); diff --git a/packages/core-compat-api/src/convertLegacyPlugin.ts b/packages/core-compat-api/src/convertLegacyPlugin.ts index bf5759f214..5fd5e585e6 100644 --- a/packages/core-compat-api/src/convertLegacyPlugin.ts +++ b/packages/core-compat-api/src/convertLegacyPlugin.ts @@ -18,7 +18,7 @@ import { BackstagePlugin as LegacyBackstagePlugin } from '@backstage/core-plugin import { ApiBlueprint, ExtensionDefinition, - BackstagePlugin as NewBackstagePlugin, + FrontendPlugin as NewBackstagePlugin, createFrontendPlugin, } from '@backstage/frontend-plugin-api'; import { convertLegacyRouteRefs } from './convertLegacyRouteRef'; @@ -29,7 +29,7 @@ export function convertLegacyPlugin( options: { extensions: ExtensionDefinition[] }, ): NewBackstagePlugin { const apiExtensions = Array.from(legacyPlugin.getApis()).map(factory => - ApiBlueprint.make({ namespace: factory.api.id, params: { factory } }), + ApiBlueprint.make({ name: factory.api.id, params: { factory } }), ); return createFrontendPlugin({ id: legacyPlugin.getId(),