@backstage/create-app 0.0.0-nightly-20220610024824 → 0.0.0-nightly-20220613024651

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @backstage/create-app
2
2
 
3
- ## 0.0.0-nightly-20220610024824
3
+ ## 0.0.0-nightly-20220613024651
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -102,6 +102,67 @@
102
102
  };
103
103
  ```
104
104
 
105
+ - 30f04d1497: Components `<DefaultResultListItem>`, `<SearchBar>`, `<SearchFilter>`, and `<SearchResult>` are now deprecated in `@backstage/plugin-search` and should be imported from `@backstage/plugin-search-react` instead.
106
+
107
+ To upgrade your App, update the following in `packages/app/src/components/search/SearchPage.tsx`:
108
+
109
+ ```diff
110
+ import {
111
+ DefaultResultListItem
112
+ SearchBar
113
+ SearchFilter
114
+ SearchResult
115
+ - } from `@backstage/plugin-search`;
116
+ + } from `@backstage/plugin-search-react`;
117
+ ```
118
+
119
+ - f7f5a6c6a3: It's now possible to pass result item components a `rank`, which is captured by the analytics API when a user clicks on a search result. To apply this change, update your `/packages/app/src/components/search/SearchPage.tsx` in the following way:
120
+
121
+ ```diff
122
+ // ...
123
+ <SearchResult>
124
+ {({ results }) => (
125
+ <List>
126
+ - {results.map(({ type, document, highlight }) => {
127
+ + {results.map(({ type, document, highlight, rank }) => {
128
+ switch (type) {
129
+ case 'software-catalog':
130
+ return (
131
+ <CatalogSearchResultListItem
132
+ key={document.location}
133
+ result={document}
134
+ highlight={highlight}
135
+ + rank={rank}
136
+ />
137
+ );
138
+ case 'techdocs':
139
+ return (
140
+ <TechDocsSearchResultListItem
141
+ key={document.location}
142
+ result={document}
143
+ highlight={highlight}
144
+ + rank={rank}
145
+ />
146
+ );
147
+ default:
148
+ return (
149
+ <DefaultResultListItem
150
+ key={document.location}
151
+ result={document}
152
+ highlight={highlight}
153
+ + rank={rank}
154
+ />
155
+ );
156
+ }
157
+ })}
158
+ </List>
159
+ )}
160
+ </SearchResult>
161
+ // ...
162
+ ```
163
+
164
+ If you have implemented a custom Search Modal or other custom search experience, you will want to make similar changes in those components.
165
+
105
166
  - aaf7652084: Bump version of `cypress` in newly scaffolded Backstage Applications. To apply this change to your own instance, please make the following change to `packages/app/package.json` under `devDependencies`.
106
167
 
107
168
  ```diff
@@ -109,6 +170,8 @@
109
170
  + "cypress": "^9.7.0",
110
171
  ```
111
172
 
173
+ - 141a1caebe: Updated the auth backend setup in the template to include a guest sign-in resolver in order to make it quicker to get up and running with a basic sign-in setup. There is no need to update existing apps to match this change, but in case you want to use the guest sign-in resolver you can find it at https://backstage.io/docs/auth/identity-resolver#guest-sign-in-resolver
174
+
112
175
  ## 0.4.28-next.2
113
176
 
114
177
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/create-app",
3
3
  "description": "A CLI that helps you create your own Backstage app",
4
- "version": "0.0.0-nightly-20220610024824",
4
+ "version": "0.0.0-nightly-20220613024651",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -8,14 +8,14 @@ import {
8
8
  } from '@backstage/plugin-catalog-react';
9
9
  import { TechDocsSearchResultListItem } from '@backstage/plugin-techdocs';
10
10
 
11
+ import { SearchType } from '@backstage/plugin-search';
11
12
  import {
13
+ DefaultResultListItem,
12
14
  SearchBar,
13
15
  SearchFilter,
14
16
  SearchResult,
15
- SearchType,
16
- DefaultResultListItem,
17
- } from '@backstage/plugin-search';
18
- import { useSearch } from '@backstage/plugin-search-react';
17
+ useSearch,
18
+ } from '@backstage/plugin-search-react';
19
19
  import {
20
20
  CatalogIcon,
21
21
  Content,
@@ -112,7 +112,7 @@ const SearchPage = () => {
112
112
  <SearchResult>
113
113
  {({ results }) => (
114
114
  <List>
115
- {results.map(({ type, document, highlight }) => {
115
+ {results.map(({ type, document, highlight, rank }) => {
116
116
  switch (type) {
117
117
  case 'software-catalog':
118
118
  return (
@@ -120,6 +120,7 @@ const SearchPage = () => {
120
120
  key={document.location}
121
121
  result={document}
122
122
  highlight={highlight}
123
+ rank={rank}
123
124
  />
124
125
  );
125
126
  case 'techdocs':
@@ -128,6 +129,7 @@ const SearchPage = () => {
128
129
  key={document.location}
129
130
  result={document}
130
131
  highlight={highlight}
132
+ rank={rank}
131
133
  />
132
134
  );
133
135
  default:
@@ -136,6 +138,7 @@ const SearchPage = () => {
136
138
  key={document.location}
137
139
  result={document}
138
140
  highlight={highlight}
141
+ rank={rank}
139
142
  />
140
143
  );
141
144
  }
@@ -18,18 +18,36 @@ export default async function createPlugin(
18
18
  providerFactories: {
19
19
  ...defaultAuthProviderFactories,
20
20
 
21
- // This overrides the default GitHub auth provider with a custom one.
22
- // Since the options are empty it will behave just like the default
23
- // provider, but if you uncomment the `signIn` section you will enable
24
- // sign-in via GitHub. This particular configuration uses a resolver
25
- // that matches the username to the user entity name. See the auth
26
- // documentation for more details on how to enable and customize sign-in:
21
+ // This replaces the default GitHub auth provider with a customized one.
22
+ // The `signIn` option enables sign-in for this provider, using the
23
+ // identity resolution logic that's provided in the `resolver` callback.
24
+ //
25
+ // This particular resolver makes all users share a single "guest" identity.
26
+ // It should only be used for testing and trying out Backstage.
27
+ //
28
+ // If you want to use a production ready resolver you can switch to the
29
+ // the one that is commented out below, it looks up a user entity in the
30
+ // catalog using the GitHub username of the authenticated user.
31
+ // That resolver requires you to have user entities populated in the catalog,
32
+ // for example using https://backstage.io/docs/integrations/github/org
33
+ //
34
+ // There are other resolvers to choose from, and you can also create
35
+ // your own, see the auth documentation for more details:
27
36
  //
28
37
  // https://backstage.io/docs/auth/identity-resolver
29
38
  github: providers.github.create({
30
- // signIn: {
31
- // resolver: providers.github.resolvers.usernameMatchingUserEntityName(),
32
- // },
39
+ signIn: {
40
+ resolver(_, ctx) {
41
+ const userRef = 'user:default/guest'; // Must be a full entity reference
42
+ return ctx.issueToken({
43
+ claims: {
44
+ sub: userRef, // The user's own identity
45
+ ent: [userRef], // A list of identities that the user claims ownership through
46
+ },
47
+ });
48
+ },
49
+ // resolver: providers.github.resolvers.usernameMatchingUserEntityName(),
50
+ },
33
51
  }),
34
52
  },
35
53
  });