Skip to content

Commit 945db23

Browse files
feat(npm): switch imports and export TranslationBlueprint for the NFS (#6054)
Signed-off-by: Christoph Jerolimov <[email protected]>
1 parent a3d6180 commit 945db23

File tree

8 files changed

+51
-8
lines changed

8 files changed

+51
-8
lines changed

workspaces/npm/.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
33
"changelog": "@changesets/cli/changelog",
44
"commit": false,
5-
"fixed": [],
5+
"fixed": [["@backstage-community/*"]],
66
"linked": [],
77
"access": "public",
88
"baseBranch": "main",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@backstage-community/plugin-npm': minor
3+
---
4+
5+
This version changes the translation import from `@backstage/core-plugin-api/alpha` to the new frontend system import `@backstage/frontend-plugin-api` and exports now a TranslationBlueprint also in the NFS `/alpha` export.

workspaces/npm/plugins/npm/report-alpha.api.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
1010
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
1111
import { isNpmAvailable } from '@backstage-community/plugin-npm-common';
1212
import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api';
13-
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
14-
import { TranslationResource } from '@backstage/core-plugin-api/alpha';
13+
import { TranslationMessages } from '@backstage/frontend-plugin-api';
14+
import { TranslationRef } from '@backstage/frontend-plugin-api';
15+
import { TranslationResource } from '@backstage/frontend-plugin-api';
1516

1617
// @alpha
1718
const _default: OverridableFrontendPlugin<{}, {}, {}>;
@@ -45,6 +46,30 @@ export const npmBackendApi: ExtensionDefinition<{
4546
) => ExtensionBlueprintParams<AnyApiFactory>;
4647
}>;
4748

49+
// @alpha (undocumented)
50+
export const npmTranslation: ExtensionDefinition<{
51+
kind: 'translation';
52+
name: 'npmTranslation';
53+
config: {};
54+
configInput: {};
55+
output: ExtensionDataRef<
56+
| TranslationResource<string>
57+
| TranslationMessages<
58+
string,
59+
{
60+
[x: string]: string;
61+
},
62+
boolean
63+
>,
64+
'core.translation.translation',
65+
{}
66+
>;
67+
inputs: {};
68+
params: {
69+
resource: TranslationResource | TranslationMessages;
70+
};
71+
}>;
72+
4873
// @public (undocumented)
4974
export const npmTranslationRef: TranslationRef<
5075
'plugin.npm.translation-ref',

workspaces/npm/plugins/npm/report.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { BackstagePlugin } from '@backstage/core-plugin-api';
77
import { isNpmAvailable } from '@backstage-community/plugin-npm-common';
88
import { JSX as JSX_2 } from 'react/jsx-runtime';
99
import { RouteRef } from '@backstage/core-plugin-api';
10-
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
11-
import { TranslationResource } from '@backstage/core-plugin-api/alpha';
10+
import { TranslationRef } from '@backstage/frontend-plugin-api';
11+
import { TranslationResource } from '@backstage/frontend-plugin-api';
1212

1313
// @public
1414
export const EntityNpmInfoCard: () => JSX_2.Element;

workspaces/npm/plugins/npm/src/alpha.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
createFrontendPlugin,
1919
discoveryApiRef,
2020
fetchApiRef,
21+
TranslationBlueprint,
2122
} from '@backstage/frontend-plugin-api';
2223
import {
2324
EntityCardBlueprint,
@@ -26,6 +27,7 @@ import {
2627
import { isNpmAvailable } from '@backstage-community/plugin-npm-common';
2728

2829
import { NpmBackendApiRef, NpmBackendClient } from './api';
30+
import { npmTranslations } from './translations';
2931

3032
export { npmTranslationRef, npmTranslations } from './translations';
3133

@@ -108,6 +110,16 @@ export const entityNpmReleaseTableCard: any = EntityContentBlueprint.make({
108110
},
109111
});
110112

113+
/**
114+
* @alpha
115+
*/
116+
export const npmTranslation = TranslationBlueprint.make({
117+
name: 'npmTranslation',
118+
params: {
119+
resource: npmTranslations,
120+
},
121+
});
122+
111123
/**
112124
* Backstage frontend plugin.
113125
*
@@ -120,5 +132,6 @@ export default createFrontendPlugin({
120132
entityNpmReleaseTableCard,
121133
entityNpmInfoCard,
122134
entityNpmReleaseOverviewCard,
135+
npmTranslation,
123136
],
124137
});

workspaces/npm/plugins/npm/src/translations/de.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { createTranslationMessages } from '@backstage/core-plugin-api/alpha';
17+
import { createTranslationMessages } from '@backstage/frontend-plugin-api';
1818

1919
import { npmTranslationRef } from './ref';
2020

workspaces/npm/plugins/npm/src/translations/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { createTranslationResource } from '@backstage/core-plugin-api/alpha';
17+
import { createTranslationResource } from '@backstage/frontend-plugin-api';
1818

1919
import { npmTranslationRef } from './ref';
2020

workspaces/npm/plugins/npm/src/translations/ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { createTranslationRef } from '@backstage/core-plugin-api/alpha';
17+
import { createTranslationRef } from '@backstage/frontend-plugin-api';
1818

1919
/**
2020
* @public

0 commit comments

Comments
 (0)