diff --git a/.changeset/lemon-eyes-grin.md b/.changeset/lemon-eyes-grin.md index 890a143c47..7cbd4b29f1 100644 --- a/.changeset/lemon-eyes-grin.md +++ b/.changeset/lemon-eyes-grin.md @@ -2,4 +2,4 @@ '@backstage/create-app': patch --- -Switched `next-app` template to use blueprint from `@backstage/plugin-app-react. +Switched `next-app` template to use blueprint from `@backstage/plugin-app-react`. diff --git a/.changeset/tired-sides-share.md b/.changeset/tired-sides-share.md new file mode 100644 index 0000000000..661a7aee50 --- /dev/null +++ b/.changeset/tired-sides-share.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-app-react': patch +--- + +Internal refactor to move implementation of blueprints from `@backstage/frontend-plugin-api` to this package. diff --git a/packages/frontend-defaults/src/createApp.test.tsx b/packages/frontend-defaults/src/createApp.test.tsx index 47f6b7895d..3a9ea91bec 100644 --- a/packages/frontend-defaults/src/createApp.test.tsx +++ b/packages/frontend-defaults/src/createApp.test.tsx @@ -60,8 +60,8 @@ describe('createApp', () => { }), }, features: [ - createFrontendPlugin({ - pluginId: 'test', + createFrontendModule({ + pluginId: 'app', extensions: [ ThemeBlueprint.make({ name: 'derp', diff --git a/packages/frontend-plugin-api/src/blueprints/ApiBlueprint.test.ts b/packages/frontend-plugin-api/src/blueprints/ApiBlueprint.test.ts index 6d16a215e1..8043752687 100644 --- a/packages/frontend-plugin-api/src/blueprints/ApiBlueprint.test.ts +++ b/packages/frontend-plugin-api/src/blueprints/ApiBlueprint.test.ts @@ -200,6 +200,7 @@ describe('ApiBlueprint', () => { "test": { "$$type": "@backstage/ExtensionInput", "config": { + "internal": false, "optional": false, "singleton": false, }, diff --git a/packages/frontend-plugin-api/src/wiring/createExtensionInput.ts b/packages/frontend-plugin-api/src/wiring/createExtensionInput.ts index b4fe9983b9..760bd4b984 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtensionInput.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtensionInput.ts @@ -60,11 +60,11 @@ export interface ExtensionInput< * plugin. The following options are available: * * - `singleton`: If set to `true`, only one extension can be attached to the - * input at a time. Additional extension will trigger an app error and be + * input at a time. Additional extensions will trigger an app error and be * ignored. * - `optional`: If set to `true`, the input is optional and can be omitted, * this only has an effect if the `singleton` is set to `true`. - * - `internal`: If set to `true`, only extensions from the same plugins will be + * - `internal`: If set to `true`, only extensions from the same plugin will be * allowed to attach to this input. Other extensions will trigger an app error * and be ignored. * diff --git a/plugins/app-react/src/blueprints/AppRootWrapperBlueprint.test.tsx b/plugins/app-react/src/blueprints/AppRootWrapperBlueprint.test.tsx index cd459b371f..a61f583ca8 100644 --- a/plugins/app-react/src/blueprints/AppRootWrapperBlueprint.test.tsx +++ b/plugins/app-react/src/blueprints/AppRootWrapperBlueprint.test.tsx @@ -20,6 +20,7 @@ import { coreExtensionData, createExtension, createExtensionInput, + createFrontendModule, } from '@backstage/frontend-plugin-api'; import { renderTestApp } from '@backstage/frontend-test-utils'; @@ -63,7 +64,11 @@ describe('AppRootWrapperBlueprint', () => { }, }); - renderTestApp({ extensions: [extension] }); + renderTestApp({ + features: [ + createFrontendModule({ pluginId: 'app', extensions: [extension] }), + ], + }); await waitFor(() => expect(screen.getByText('Hello')).toBeInTheDocument()); }); @@ -95,20 +100,28 @@ describe('AppRootWrapperBlueprint', () => { }); renderTestApp({ - extensions: [ - extension, - createExtension({ - name: 'test-child', - attachTo: { id: 'app-root-wrapper:test', input: 'children' }, - output: [coreExtensionData.reactElement], - factory: () => [coreExtensionData.reactElement(