refactor(frontend-plugin-api): remove deprecated AppNodeSpec.source
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/frontend-plugin-api': minor
|
||||
---
|
||||
|
||||
**BREAKING**: Remove deprecated `source` property from the `AppNodeSpec` type, use `AppNodeSpec.plugin` instead.
|
||||
@@ -44,7 +44,7 @@ function PluginInfo() {
|
||||
const [info, setInfo] = useState<FrontendPluginInfo | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
node?.spec.source?.info().then(setInfo);
|
||||
node?.spec.plugin?.info().then(setInfo);
|
||||
}, [node]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -56,7 +56,6 @@ function makeSpec<TConfig, TConfigInput>(
|
||||
attachTo: extension.attachTo,
|
||||
disabled: extension.disabled,
|
||||
extension: extension as Extension<unknown, unknown>,
|
||||
source: undefined,
|
||||
plugin: undefined,
|
||||
...spec,
|
||||
};
|
||||
|
||||
@@ -691,7 +691,7 @@ describe('createSpecializedApp', () => {
|
||||
|
||||
await expect(plugin.info()).rejects.toThrow(errorMsg);
|
||||
|
||||
const installedPlugin = app.tree.nodes.get('test')?.spec.source;
|
||||
const installedPlugin = app.tree.nodes.get('test')?.spec.plugin;
|
||||
expect(installedPlugin).toBeDefined();
|
||||
const info = await installedPlugin?.info();
|
||||
expect(info).toEqual({});
|
||||
@@ -707,7 +707,7 @@ describe('createSpecializedApp', () => {
|
||||
});
|
||||
|
||||
const app = createSpecializedApp({ features: [plugin] });
|
||||
const info = await app.tree.nodes.get('test')?.spec.source?.info();
|
||||
const info = await app.tree.nodes.get('test')?.spec.plugin?.info();
|
||||
expect(info).toMatchObject({
|
||||
packageName: '@backstage/frontend-app-api',
|
||||
});
|
||||
@@ -730,7 +730,7 @@ describe('createSpecializedApp', () => {
|
||||
});
|
||||
|
||||
const app = createSpecializedApp({ features: [overriddenPlugin] });
|
||||
const info = await app.tree.nodes.get('test')?.spec.source?.info();
|
||||
const info = await app.tree.nodes.get('test')?.spec.plugin?.info();
|
||||
expect(info).toMatchObject({
|
||||
packageName: 'test-override',
|
||||
});
|
||||
@@ -754,7 +754,7 @@ describe('createSpecializedApp', () => {
|
||||
});
|
||||
|
||||
const app = createSpecializedApp({ features: [plugin] });
|
||||
const info = await app.tree.nodes.get('test')?.spec.source?.info();
|
||||
const info = await app.tree.nodes.get('test')?.spec.plugin?.info();
|
||||
expect(info).toEqual({
|
||||
packageName: '@backstage/frontend-app-api',
|
||||
version: expect.any(String),
|
||||
@@ -782,7 +782,7 @@ describe('createSpecializedApp', () => {
|
||||
return { info: { packageName: `decorated:${info.packageName}` } };
|
||||
},
|
||||
});
|
||||
const info = await app.tree.nodes.get('test')?.spec.source?.info();
|
||||
const info = await app.tree.nodes.get('test')?.spec.plugin?.info();
|
||||
expect(info).toEqual({
|
||||
packageName: 'decorated:@backstage/frontend-app-api',
|
||||
});
|
||||
|
||||
@@ -131,7 +131,7 @@ describe('createApp', () => {
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
appNode?.spec.source?.info().then(setInfo);
|
||||
appNode?.spec.plugin?.info().then(setInfo);
|
||||
}, [appNode]);
|
||||
|
||||
return <div>Package name: {info?.packageName}</div>;
|
||||
|
||||
@@ -245,8 +245,6 @@ export interface AppNodeSpec {
|
||||
readonly id: string;
|
||||
// (undocumented)
|
||||
readonly plugin?: FrontendPlugin;
|
||||
// @deprecated (undocumented)
|
||||
readonly source?: FrontendPlugin;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
||||
@@ -38,10 +38,6 @@ export interface AppNodeSpec {
|
||||
readonly disabled: boolean;
|
||||
readonly config?: unknown;
|
||||
readonly plugin?: FrontendPlugin;
|
||||
/**
|
||||
* @deprecated Use {@link AppNodeSpec.plugin} instead.
|
||||
*/
|
||||
readonly source?: FrontendPlugin;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user