diff --git a/.changeset/famous-bikes-brush.md b/.changeset/famous-bikes-brush.md new file mode 100644 index 0000000000..0c4867d46a --- /dev/null +++ b/.changeset/famous-bikes-brush.md @@ -0,0 +1,8 @@ +--- +'@backstage/core-plugin-api': patch +--- + +Introduced plugin options for the components, to be able to customise existing components. +Those customizations are stored in React context of the plugin. +The configurable options could be defined during the creation of the plugin via `__experimentalConfigure` method. +And the user of the plugin can redefine it with. diff --git a/.changeset/fast-walls-carry.md b/.changeset/fast-walls-carry.md deleted file mode 100644 index 4f903c2dd8..0000000000 --- a/.changeset/fast-walls-carry.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -'@backstage/app-defaults': patch -'@backstage/core-app-api': patch -'@backstage/core-plugin-api': patch -'@backstage/plugin-catalog': patch ---- - -Introduced plugin options for the components, to be able to customise existing components. -The author of the component might define the configurable places of the component, and the user of this -component can reconfigure it if necessary. - -The configurable options could be defined during the creation of the plugin via `__experimentalConfigure` method. -And the user of the plugin can redefine it with - -```typescript jsx -import { catalogPlugin } from '@backstage/plugin-catalog'; - -catalogPlugin.__experimentalReconfigure({ - createButtonTitle: 'New', -}); -``` - -Also introduced an extra parameter in BackstagePlugin. -This optional parameter is responsible for providing a type for input options for the plugin. diff --git a/.changeset/few-berries-deny.md b/.changeset/few-berries-deny.md new file mode 100644 index 0000000000..0cbed15f81 --- /dev/null +++ b/.changeset/few-berries-deny.md @@ -0,0 +1,15 @@ +--- +'@backstage/plugin-catalog': minor +--- + +Plugin catalog has been modified to use an experimental feature where you can customize the title of the create button. + +You can modify it by doing next: + +```typescript jsx +import { catalogPlugin } from '@backstage/plugin-catalog'; + +catalogPlugin.__experimentalReconfigure({ + createButtonTitle: 'New', +}); +``` diff --git a/.changeset/gentle-games-count.md b/.changeset/gentle-games-count.md new file mode 100644 index 0000000000..fd7b586803 --- /dev/null +++ b/.changeset/gentle-games-count.md @@ -0,0 +1,12 @@ +--- +'@backstage/app-defaults': patch +--- + +Introduced an extra parameter in BackstagePlugin. +This optional parameter is responsible for providing a type for input options for the plugin. + +``` +myPlugin.__experimentalReconfigure({ +... +}); +``` diff --git a/.changeset/hungry-hotels-flow.md b/.changeset/hungry-hotels-flow.md new file mode 100644 index 0000000000..0fef92bd90 --- /dev/null +++ b/.changeset/hungry-hotels-flow.md @@ -0,0 +1,6 @@ +--- +'@backstage/core-app-api': patch +--- + +Introduced an extra parameter in BackstagePlugin. +This optional parameter is responsible for providing a type for input options for the plugin. diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index 116b33c598..4792453af1 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -155,7 +155,7 @@ export type AppConfigLoader = () => Promise; // @public export type AppContext = { - getPlugins(): BackstagePlugin[]; + getPlugins(): BackstagePlugin[]; getSystemIcon(key: string): IconComponent | undefined; getComponents(): AppComponents; }; @@ -254,7 +254,7 @@ export type AuthApiCreateOptions = { // @public export type BackstageApp = { - getPlugins(): BackstagePlugin[]; + getPlugins(): BackstagePlugin[]; getSystemIcon(key: string): IconComponent | undefined; getProvider(): ComponentType<{}>; getRouter(): ComponentType<{}>; diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 5bddd891cd..490d58a267 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -639,10 +639,15 @@ export type PluginFeatureFlagConfig = { name: string; }; -// Warning: (ae-forgotten-export) The symbol "PluginOptionsProviderProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "PluginProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public +export interface PluginOptionsProviderProps { + // (undocumented) + children: ReactNode; + // (undocumented) + plugin?: BackstagePlugin; +} + +// @alpha export const PluginProvider: ({ children, plugin, diff --git a/packages/core-plugin-api/src/plugin-options/index.ts b/packages/core-plugin-api/src/plugin-options/index.ts index 937cf49032..1737a1c836 100644 --- a/packages/core-plugin-api/src/plugin-options/index.ts +++ b/packages/core-plugin-api/src/plugin-options/index.ts @@ -15,3 +15,4 @@ */ export { usePluginOptions, PluginProvider } from './usePluginOptions'; +export type { PluginOptionsProviderProps } from './usePluginOptions'; diff --git a/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx b/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx index 55e2c28701..f5cbb72fcd 100644 --- a/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx +++ b/packages/core-plugin-api/src/plugin-options/usePluginOptions.tsx @@ -34,6 +34,11 @@ export interface PluginOptionsProviderProps { plugin?: BackstagePlugin; } +/** + * Contains the plugin configuration. + * + * @alpha + */ export const PluginProvider = ({ children, plugin,