Skip to content

Commit c235037

Browse files
npm - version:bump to v1.47.2 (#7244)
1 parent 64a82b0 commit c235037

File tree

22 files changed

+1178
-846
lines changed

22 files changed

+1178
-846
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
'@backstage-community/plugin-npm': minor
3+
---
4+
5+
**Breaking change in the alpha export / New Frontend System adopters**:
6+
7+
Backstage v1.47.0 [deprecates](https://backstage.io/docs/releases/v1.47.0#deprecation-and-upcoming-restrictions-of-blueprints-for-app-customization-in-backstagefrontend-plugin-api) `TranslationBlueprint` in `@backstage/frontend-plugin-api` and that plugins can add translation resource to their own extensions list.
8+
9+
The `npm` plugin is following this and doesn't export an `npmTranslation` extension anymore.
10+
11+
It also doesn't add the `TranslationBlueprint` to the plugin extensions anymore.
12+
13+
To enable translation support for the npm plugin again you must add this extension to your app (in many cases `App.tsx`):
14+
15+
```tsx
16+
import { TranslationBlueprint } from '@backstage/plugin-app-react';
17+
18+
import npmPlugin, {
19+
npmTranslations,
20+
} from '@backstage-community/plugin-npm/alpha';
21+
22+
const npmTranslation = TranslationBlueprint.make({
23+
name: 'npmTranslation',
24+
params: {
25+
resource: npmTranslations,
26+
},
27+
});
28+
29+
export default createApp({
30+
features: [
31+
createFrontendModule({
32+
pluginId: 'app',
33+
extensions: [
34+
// ...other extensions
35+
npmTranslation,
36+
],
37+
}),
38+
// ...other plugins
39+
npmPlugin,
40+
],
41+
});
42+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@backstage-community/plugin-npm': minor
3+
'@backstage-community/plugin-npm-backend': minor
4+
'@backstage-community/plugin-npm-common': minor
5+
---
6+
7+
Backstage version bump to v1.47.2

workspaces/npm/README.md

Lines changed: 65 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,70 @@ you must install also the backend plugin and [configure it](./registries.md).
9191

9292
### Frontend plugin
9393

94+
### Load plugin via the new frontend system (alpha)
95+
96+
For early adaopters of the new frontend system.
97+
98+
Your Backstage frontend app must use that new frontend system which isn't the default at the moment.
99+
100+
1. Install the frontend dependency:
101+
102+
```sh
103+
yarn workspace app-next add @backstage-community/plugin-npm
104+
```
105+
106+
2. Add the package to your `packages/app-next/src/App.tsx`.
107+
108+
```tsx
109+
import npmPlugin from '@backstage-community/plugin-npm/alpha';
110+
```
111+
112+
And extend your createApp:
113+
114+
```tsx
115+
export const app = createApp({
116+
features: [
117+
// ...other plugins
118+
npmPlugin,
119+
],
120+
});
121+
```
122+
123+
3. Optional enable translation via the `TranslationBlueprint` extension:
124+
125+
```tsx
126+
import { TranslationBlueprint } from '@backstage/plugin-app-react';
127+
128+
import npmPlugin, {
129+
npmTranslations,
130+
} from '@backstage-community/plugin-npm/alpha';
131+
```
132+
133+
```tsx
134+
const npmTranslation = TranslationBlueprint.make({
135+
name: 'npmTranslation',
136+
params: {
137+
resource: npmTranslations,
138+
},
139+
});
140+
141+
export default createApp({
142+
features: [
143+
createFrontendModule({
144+
pluginId: 'app',
145+
extensions: [
146+
// ...other extensions
147+
npmTranslation,
148+
],
149+
}),
150+
// ...other plugins
151+
npmPlugin,
152+
],
153+
});
154+
```
155+
156+
### Manual wiring the frontend plugin ("Old Frontend System")
157+
94158
1. Install the frontend dependency:
95159

96160
```sh
@@ -140,44 +204,12 @@ you must install also the backend plugin and [configure it](./registries.md).
140204
</EntityLayout.Route>
141205
```
142206

143-
### Alternative: Use the new frontend system (alpha)
144-
145-
For early adaopters of the new frontend system.
146-
147-
Your Backstage frontend app must use that new frontend system which isn't the default at the moment.
148-
149-
1. Install the frontend dependency:
150-
151-
```sh
152-
yarn workspace app-next add @backstage-community/plugin-npm
153-
```
154-
155-
2. Add the package to your `packages/app[-next]/src/App.tsx`.
156-
157-
```tsx
158-
import npmPlugin from '@backstage-community/plugin-npm/alpha';
159-
```
160-
161-
And extend your createApp:
162-
163-
```tsx
164-
export const app = createApp({
165-
features: [
166-
catalogPlugin,
167-
catalogImportPlugin,
168-
userSettingsPlugin,
169-
npmPlugin,
170-
// ...
171-
],
172-
});
173-
```
174-
175207
### Optional: Backend plugin (req. for private packages or alternative registries)
176208

177209
1. Install the backend plugin:
178210

179211
```sh
180-
yarn workspace backend add @backstage-community/plugin-npm
212+
yarn workspace backend add @backstage-community/plugin-npm-backend
181213
```
182214

183215
2. Add it to `packages/backend/src/index.ts`:

workspaces/npm/app-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ app:
22
title: npm plugin example app
33
baseUrl: http://localhost:3000
44

5+
extensions:
6+
- api:app/app-language:
7+
config:
8+
availableLanguages: ['en', 'es', 'fr', 'de', 'ja']
9+
defaultLanguage: 'en'
10+
511
organization:
612
name: npm plugin example
713

workspaces/npm/backstage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "1.46.2"
2+
"version": "1.47.2"
33
}

workspaces/npm/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"dev": "yarn workspaces foreach -A --include @backstage-community/plugin-npm --include @backstage-community/plugin-npm-backend --parallel -v -i run start",
1111
"start": "backstage-cli repo start",
12-
"start-next": "yarn workspaces foreach -A --include backend --include app-next --parallel -v -i run start",
12+
"start:next": "yarn workspaces foreach -A --include backend --include app-next --parallel -v -i run start",
1313
"build:backend": "yarn workspace backend build",
1414
"build-image": "yarn workspace backend build-image",
1515
"tsc": "tsc",
@@ -42,9 +42,9 @@
4242
"directory": "workspaces/npm"
4343
},
4444
"devDependencies": {
45-
"@backstage/cli": "^0.35.1",
45+
"@backstage/cli": "^0.35.3",
4646
"@backstage/e2e-test-utils": "^0.1.1",
47-
"@backstage/repo-tools": "^0.16.1",
47+
"@backstage/repo-tools": "^0.16.3",
4848
"@changesets/cli": "^2.27.1",
4949
"@playwright/test": "^1.32.3",
5050
"knip": "^5.27.4",

workspaces/npm/packages/app-next/knip-report.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
| Name | Location | Severity |
66
| :------------------------------ | :---------------- | :------- |
7-
| @backstage/plugin-notifications | package.json:32:6 | error |
7+
| @backstage/plugin-notifications | package.json:33:6 | error |
88
| @backstage/integration-react | package.json:29:6 | error |
9-
| @backstage/plugin-scaffolder | package.json:34:6 | error |
9+
| @backstage/plugin-scaffolder | package.json:35:6 | error |
1010
| @backstage/core-plugin-api | package.json:26:6 | error |
11-
| @backstage/plugin-org | package.json:33:6 | error |
11+
| @backstage/plugin-org | package.json:34:6 | error |
1212

1313
## Unused devDependencies (4)
1414

1515
| Name | Location | Severity |
1616
| :-------------------------- | :---------------- | :------- |
17-
| @testing-library/user-event | package.json:52:6 | error |
18-
| @backstage/test-utils | package.json:47:6 | error |
19-
| @testing-library/dom | package.json:49:6 | error |
20-
| @playwright/test | package.json:48:6 | error |
17+
| @testing-library/user-event | package.json:53:6 | error |
18+
| @backstage/test-utils | package.json:48:6 | error |
19+
| @testing-library/dom | package.json:50:6 | error |
20+
| @playwright/test | package.json:49:6 | error |
2121

workspaces/npm/packages/app-next/package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,23 @@
2020
},
2121
"dependencies": {
2222
"@backstage-community/plugin-npm": "workspace:^",
23-
"@backstage/cli": "^0.35.1",
24-
"@backstage/core-compat-api": "^0.5.5",
25-
"@backstage/core-components": "^0.18.4",
26-
"@backstage/core-plugin-api": "^1.12.1",
27-
"@backstage/frontend-defaults": "^0.3.4",
28-
"@backstage/frontend-plugin-api": "^0.13.2",
29-
"@backstage/integration-react": "^1.2.13",
30-
"@backstage/plugin-catalog": "^1.32.1",
31-
"@backstage/plugin-catalog-import": "^0.13.8",
32-
"@backstage/plugin-notifications": "^0.5.12",
33-
"@backstage/plugin-org": "^0.6.47",
34-
"@backstage/plugin-scaffolder": "^1.35.0",
35-
"@backstage/plugin-search": "^1.5.1",
36-
"@backstage/plugin-signals": "^0.0.26",
37-
"@backstage/plugin-user-settings": "^0.8.30",
38-
"@backstage/ui": "^0.10.0",
23+
"@backstage/cli": "^0.35.3",
24+
"@backstage/core-compat-api": "^0.5.7",
25+
"@backstage/core-components": "^0.18.6",
26+
"@backstage/core-plugin-api": "^1.12.2",
27+
"@backstage/frontend-defaults": "^0.3.6",
28+
"@backstage/frontend-plugin-api": "^0.13.4",
29+
"@backstage/integration-react": "^1.2.14",
30+
"@backstage/plugin-app-react": "^0.1.0",
31+
"@backstage/plugin-catalog": "^1.32.2",
32+
"@backstage/plugin-catalog-import": "^0.13.9",
33+
"@backstage/plugin-notifications": "^0.5.13",
34+
"@backstage/plugin-org": "^0.6.48",
35+
"@backstage/plugin-scaffolder": "^1.35.2",
36+
"@backstage/plugin-search": "^1.5.3",
37+
"@backstage/plugin-signals": "^0.0.27",
38+
"@backstage/plugin-user-settings": "^0.8.31",
39+
"@backstage/ui": "^0.11.2",
3940
"@material-ui/core": "^4.12.2",
4041
"@material-ui/icons": "^4.9.1",
4142
"react": "^18.0.2",

workspaces/npm/packages/app-next/src/App.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ import {
2020
PageBlueprint,
2121
} from '@backstage/frontend-plugin-api';
2222
import { createApp } from '@backstage/frontend-defaults';
23+
import { TranslationBlueprint } from '@backstage/plugin-app-react';
2324
import catalogPlugin from '@backstage/plugin-catalog/alpha';
2425
import catalogImportPlugin from '@backstage/plugin-catalog-import/alpha';
2526
import userSettingsPlugin from '@backstage/plugin-user-settings/alpha';
2627
import searchPlugin from '@backstage/plugin-search/alpha';
2728
import signalsPlugin from '@backstage/plugin-signals/alpha';
2829

29-
import npmPlugin from '@backstage-community/plugin-npm/alpha';
30+
import npmPlugin, {
31+
npmTranslations,
32+
} from '@backstage-community/plugin-npm/alpha';
3033

3134
import { navModule } from './modules/nav';
3235

@@ -38,11 +41,20 @@ const homePageExtension = PageBlueprint.make({
3841
},
3942
});
4043

44+
const npmTranslation = TranslationBlueprint.make({
45+
name: 'npmTranslation',
46+
params: {
47+
resource: npmTranslations,
48+
},
49+
});
50+
51+
const translations = [npmTranslation];
52+
4153
export default createApp({
4254
features: [
4355
createFrontendModule({
4456
pluginId: 'app',
45-
extensions: [homePageExtension],
57+
extensions: [homePageExtension, ...translations],
4658
}),
4759
catalogPlugin,
4860
catalogImportPlugin,

workspaces/npm/packages/app-next/src/modules/nav/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
} from '@backstage/core-components';
2323
import { compatWrapper } from '@backstage/core-compat-api';
2424
import { Sidebar } from '@backstage/core-components';
25-
import { NavContentBlueprint } from '@backstage/frontend-plugin-api';
25+
import { NavContentBlueprint } from '@backstage/plugin-app-react';
2626
import { SidebarLogo } from './SidebarLogo';
2727
import MenuIcon from '@material-ui/icons/Menu';
2828
import SearchIcon from '@material-ui/icons/Search';

0 commit comments

Comments
 (0)