@backstage/cli 0.31.0 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/packages/cli/package.json.cjs.js +1 -1
- package/dist/plugins/catalog-node/package.json.cjs.js +1 -1
- package/package.json +2 -2
- package/templates/backend-plugin/src/plugin.ts.hbs +2 -4
- package/templates/backend-plugin/src/services/TodoListService/createTodoListService.ts +3 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @backstage/cli
|
|
2
2
|
|
|
3
|
+
## 0.31.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0faff9f: Update the `to do` plugin template to stop using the deprecated catalog alpha service reference.
|
|
8
|
+
If you start seeing the `should create TODO item with catalog information` test failing, you have two options to fix this:
|
|
9
|
+
Update the test to mock the legacy alpha catalog service, or migrate the `TODO` plugin backend to use the new catalog service reference.
|
|
10
|
+
We recommend the second option, see [this](https://github.com/backstage/backstage/pull/29450/files/267115d0436009443ca68ac84e7dcc646c9c938d#diff-47e01aeb12dd55fab9e697f810be21a8d08d39c37df1b078f6d0894f9bad5a1b) pull request for an example of how to do the migration.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/catalog-model@1.7.3
|
|
13
|
+
- @backstage/cli-common@0.1.15
|
|
14
|
+
- @backstage/cli-node@0.2.13
|
|
15
|
+
- @backstage/config@1.3.2
|
|
16
|
+
- @backstage/config-loader@1.10.0
|
|
17
|
+
- @backstage/errors@1.2.7
|
|
18
|
+
- @backstage/eslint-plugin@0.1.10
|
|
19
|
+
- @backstage/integration@1.16.2
|
|
20
|
+
- @backstage/release-manifests@0.0.12
|
|
21
|
+
- @backstage/types@1.2.1
|
|
22
|
+
|
|
3
23
|
## 0.31.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.1",
|
|
4
4
|
"description": "CLI for developing Backstage plugins and apps",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli"
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"@backstage/errors": "^1.2.7",
|
|
175
175
|
"@backstage/plugin-auth-backend": "^0.24.4",
|
|
176
176
|
"@backstage/plugin-auth-backend-module-guest-provider": "^0.2.6",
|
|
177
|
-
"@backstage/plugin-catalog-node": "^1.16.
|
|
177
|
+
"@backstage/plugin-catalog-node": "^1.16.2",
|
|
178
178
|
"@backstage/plugin-scaffolder-node": "^0.8.0",
|
|
179
179
|
"@backstage/plugin-scaffolder-node-test-utils": "^0.2.0",
|
|
180
180
|
"@backstage/test-utils": "^1.7.6",
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createBackendPlugin,
|
|
4
4
|
} from '@backstage/backend-plugin-api';
|
|
5
5
|
import { createRouter } from './router';
|
|
6
|
-
import { catalogServiceRef } from '@backstage/plugin-catalog-node
|
|
6
|
+
import { catalogServiceRef } from '@backstage/plugin-catalog-node';
|
|
7
7
|
import { createTodoListService } from './services/TodoListService';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -17,15 +17,13 @@ export const {{pluginVar}} = createBackendPlugin({
|
|
|
17
17
|
env.registerInit({
|
|
18
18
|
deps: {
|
|
19
19
|
logger: coreServices.logger,
|
|
20
|
-
auth: coreServices.auth,
|
|
21
20
|
httpAuth: coreServices.httpAuth,
|
|
22
21
|
httpRouter: coreServices.httpRouter,
|
|
23
22
|
catalog: catalogServiceRef,
|
|
24
23
|
},
|
|
25
|
-
async init({ logger,
|
|
24
|
+
async init({ logger, httpAuth, httpRouter, catalog }) {
|
|
26
25
|
const todoListService = await createTodoListService({
|
|
27
26
|
logger,
|
|
28
|
-
auth,
|
|
29
27
|
catalog,
|
|
30
28
|
});
|
|
31
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoggerService } from '@backstage/backend-plugin-api';
|
|
2
2
|
import { NotFoundError } from '@backstage/errors';
|
|
3
|
-
import { catalogServiceRef } from '@backstage/plugin-catalog-node
|
|
3
|
+
import { catalogServiceRef } from '@backstage/plugin-catalog-node';
|
|
4
4
|
import crypto from 'node:crypto';
|
|
5
5
|
import { TodoItem, TodoListService } from './types';
|
|
6
6
|
|
|
@@ -10,11 +10,9 @@ import { TodoItem, TodoListService } from './types';
|
|
|
10
10
|
// documentation for more information on how to do this:
|
|
11
11
|
// https://backstage.io/docs/backend-system/core-services/database
|
|
12
12
|
export async function createTodoListService({
|
|
13
|
-
auth,
|
|
14
13
|
logger,
|
|
15
14
|
catalog,
|
|
16
15
|
}: {
|
|
17
|
-
auth: AuthService;
|
|
18
16
|
logger: LoggerService;
|
|
19
17
|
catalog: typeof catalogServiceRef.T;
|
|
20
18
|
}): Promise<TodoListService> {
|
|
@@ -40,13 +38,7 @@ export async function createTodoListService({
|
|
|
40
38
|
// If you want to make a request using the plugin backend's own identity,
|
|
41
39
|
// you can access it via the `auth.getOwnServiceCredentials()` method.
|
|
42
40
|
// Beware that this bypasses any user permission checks.
|
|
43
|
-
const
|
|
44
|
-
onBehalfOf: options.credentials,
|
|
45
|
-
targetPluginId: 'catalog',
|
|
46
|
-
});
|
|
47
|
-
const entity = await catalog.getEntityByRef(input.entityRef, {
|
|
48
|
-
token,
|
|
49
|
-
});
|
|
41
|
+
const entity = await catalog.getEntityByRef(input.entityRef, options);
|
|
50
42
|
if (!entity) {
|
|
51
43
|
throw new NotFoundError(
|
|
52
44
|
`No entity found for ref '${input.entityRef}'`,
|