@backstage/create-app 0.4.31-next.3 → 0.4.31
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 +192 -0
- package/dist/index.cjs.js +47 -47
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,197 @@
|
|
|
1
1
|
# @backstage/create-app
|
|
2
2
|
|
|
3
|
+
## 0.4.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6ff94d60d5: Removed usage of the deprecated `diff` command in the root `package.json`.
|
|
8
|
+
|
|
9
|
+
To make this change in an existing app, make the following change in the root `package.json`:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- "diff": "lerna run diff --",
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- c1f1a4c760: The Backstage packages and plugins have all been updated to support React Router v6 stable. The `create-app` template has not been migrated yet, but if you want to migrate your own app or plugins, check out the [migration guide](https://backstage.io/docs/tutorials/react-router-stable-migration).
|
|
16
|
+
- e83de28e36: Fix typo in the documentation
|
|
17
|
+
- 7d47def9c4: Removed dependency on `@types/jest`.
|
|
18
|
+
- 208d6780c9: The `packages/backend/Dockerfile` received a couple of updates, it now looks as follows:
|
|
19
|
+
|
|
20
|
+
```Dockerfile
|
|
21
|
+
FROM node:16-bullseye-slim
|
|
22
|
+
|
|
23
|
+
# Install sqlite3 dependencies. You can skip this if you don't use sqlite3 in the image,
|
|
24
|
+
# in which case you should also move better-sqlite3 to "devDependencies" in package.json.
|
|
25
|
+
RUN apt-get update && \
|
|
26
|
+
apt-get install -y --no-install-recommends libsqlite3-dev python3 build-essential && \
|
|
27
|
+
rm -rf /var/lib/apt/lists/* && \
|
|
28
|
+
yarn config set python /usr/bin/python3
|
|
29
|
+
|
|
30
|
+
# From here on we use the least-privileged `node` user to run the backend.
|
|
31
|
+
USER node
|
|
32
|
+
WORKDIR /app
|
|
33
|
+
|
|
34
|
+
# This switches many Node.js dependencies to production mode.
|
|
35
|
+
ENV NODE_ENV production
|
|
36
|
+
|
|
37
|
+
# Copy repo skeleton first, to avoid unnecessary docker cache invalidation.
|
|
38
|
+
# The skeleton contains the package.json of each package in the monorepo,
|
|
39
|
+
# and along with yarn.lock and the root package.json, that's enough to run yarn install.
|
|
40
|
+
COPY --chown=node:node yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
|
|
41
|
+
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
|
|
42
|
+
|
|
43
|
+
RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
|
|
44
|
+
|
|
45
|
+
# Then copy the rest of the backend bundle, along with any other files we might want.
|
|
46
|
+
COPY --chown=node:node packages/backend/dist/bundle.tar.gz app-config*.yaml ./
|
|
47
|
+
RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
|
|
48
|
+
|
|
49
|
+
CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The two notable changes are that a `USER node` instruction has been added and the ordering of instructions has been changed accordingly. This means that the app will now be running using the least-privileged `node` user. In order for this to work we now need to make sure that all app files are owned by the `node` user, which we do by adding the `--chown=node:node` option to the `COPY` instructions.
|
|
53
|
+
|
|
54
|
+
The second change is the addition of `ENV NODE_ENV production`, which ensured that all Node.js modules run in production mode. If you apply this change to an existing app, note that one of the more significant changes is that this switches the log formatting to use the default production format, JSON. Rather than your log lines looking like this:
|
|
55
|
+
|
|
56
|
+
```log
|
|
57
|
+
2022-08-10T11:36:05.478Z catalog info Performing database migration type=plugin
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
They will now look like this:
|
|
61
|
+
|
|
62
|
+
```log
|
|
63
|
+
{"level":"info","message":"Performing database migration","plugin":"catalog","service":"backstage","type":"plugin"}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If you wish to keep the existing format, you can override this change by applying the following change to `packages/backend/src/index.ts`:
|
|
67
|
+
|
|
68
|
+
```diff
|
|
69
|
+
getRootLogger,
|
|
70
|
+
+ setRootLogger,
|
|
71
|
+
+ createRootLogger,
|
|
72
|
+
+ coloredFormat,
|
|
73
|
+
useHotMemoize,
|
|
74
|
+
...
|
|
75
|
+
ServerTokenManager,
|
|
76
|
+
} from '@backstage/backend-common';
|
|
77
|
+
|
|
78
|
+
...
|
|
79
|
+
|
|
80
|
+
async function main() {
|
|
81
|
+
+ setRootLogger(createRootLogger({ format: coloredFormat }));
|
|
82
|
+
+
|
|
83
|
+
const config = await loadBackendConfig({
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- 49416194e8: Adds `IdentityApi` configuration to `create-app` scaffolding templates.
|
|
87
|
+
|
|
88
|
+
To migrate to the new `IdentityApi`, edit the `packages/backend/src/index.ts` adding the following import:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
import { DefaultIdentityClient } from '@backstage/plugin-auth-node';
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Use the factory function to create an `IdentityApi` in the `makeCreateEnv` function and return it from the
|
|
95
|
+
function as follows:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
function makeCreateEnv(config: Config) {
|
|
99
|
+
...
|
|
100
|
+
const identity = DefaultIdentityClient.create({
|
|
101
|
+
discovery,
|
|
102
|
+
});
|
|
103
|
+
...
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
...,
|
|
107
|
+
identity
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Backend plugins can be upgraded to work with this new `IdentityApi`.
|
|
113
|
+
|
|
114
|
+
Add `identity` to the `RouterOptions` type.
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
export interface RouterOptions {
|
|
118
|
+
...
|
|
119
|
+
identity: IdentityApi;
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Then you can use the `IdentityApi` from the plugin.
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
export async function createRouter(
|
|
127
|
+
options: RouterOptions,
|
|
128
|
+
): Promise<express.Router> {
|
|
129
|
+
const { identity } = options;
|
|
130
|
+
|
|
131
|
+
router.get('/user', async (req, res) => {
|
|
132
|
+
const user = await identity.getIdentity({ request: req });
|
|
133
|
+
...
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
- 8d886dd33e: Added `yarn new` as one of the scripts installed by default, which calls `backstage-cli new`. This script replaces `create-plugin`, which you can now remove if you want to. It is kept in the `create-app` template for backwards compatibility.
|
|
137
|
+
|
|
138
|
+
The `remove-plugin` command has been removed, as it has been removed from the Backstage CLI.
|
|
139
|
+
|
|
140
|
+
To apply these changes to an existing app, make the following change to the root `package.json`:
|
|
141
|
+
|
|
142
|
+
```diff
|
|
143
|
+
- "remove-plugin": "backstage-cli remove-plugin"
|
|
144
|
+
+ "new": "backstage-cli new --scope internal"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- c3c90280be: The options part of `DatabaseManager.fromConfig` now accepts an optional logger
|
|
148
|
+
field. You may want to supply that logger in your backend initialization code to
|
|
149
|
+
ensure that you can get relevant logging data when things happen related to the
|
|
150
|
+
connection pool.
|
|
151
|
+
|
|
152
|
+
In `packages/backend/src/index.ts`:
|
|
153
|
+
|
|
154
|
+
```diff
|
|
155
|
+
function makeCreateEnv(config: Config) {
|
|
156
|
+
const root = getRootLogger();
|
|
157
|
+
...
|
|
158
|
+
- const databaseManager = DatabaseManager.fromConfig(config);
|
|
159
|
+
+ const databaseManager = DatabaseManager.fromConfig(config, { logger: root });
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
- a578558180: Updated the root `package.json` to use the new `backstage-cli repo clean` command.
|
|
163
|
+
|
|
164
|
+
To apply this change to an existing project, make the following change to the root `package.json`:
|
|
165
|
+
|
|
166
|
+
```diff
|
|
167
|
+
- "clean": "backstage-cli clean && lerna run clean",
|
|
168
|
+
+ "clean": "backstage-cli repo clean",
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
- c0a08fd08c: Added `EntityLinksCard` to the system `EntityPage`.
|
|
172
|
+
|
|
173
|
+
For an existing installation where you want to display the links card for entity pages of kind `system` you should make the following adjustment to `packages/app/src/components/catalog/EntityPage.tsx`
|
|
174
|
+
|
|
175
|
+
```diff
|
|
176
|
+
const systemPage = (
|
|
177
|
+
...
|
|
178
|
+
<Grid item md={6} xs={12}>
|
|
179
|
+
<EntityCatalogGraphCard variant="gridItem" height={400} />
|
|
180
|
+
</Grid>
|
|
181
|
+
+ <Grid item md={4} xs={12}>
|
|
182
|
+
+ <EntityLinksCard />
|
|
183
|
+
+ </Grid>
|
|
184
|
+
- <Grid item md={6}>
|
|
185
|
+
+ <Grid item md={8}>
|
|
186
|
+
<EntityHasComponentsCard variant="gridItem" />
|
|
187
|
+
</Grid>
|
|
188
|
+
...
|
|
189
|
+
);
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
- Updated dependencies
|
|
193
|
+
- @backstage/cli-common@0.1.10
|
|
194
|
+
|
|
3
195
|
## 0.4.31-next.3
|
|
4
196
|
|
|
5
197
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -57,101 +57,101 @@ ${chalk__default["default"].red(`${error}`)}
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
var version$L = "1.6.0
|
|
60
|
+
var version$L = "1.6.0";
|
|
61
61
|
|
|
62
|
-
var version$K = "1.0.6
|
|
62
|
+
var version$K = "1.0.6";
|
|
63
63
|
|
|
64
|
-
var version$J = "0.15.1
|
|
64
|
+
var version$J = "0.15.1";
|
|
65
65
|
|
|
66
|
-
var version$I = "0.3.5
|
|
66
|
+
var version$I = "0.3.5";
|
|
67
67
|
|
|
68
|
-
var version$H = "1.1.0
|
|
68
|
+
var version$H = "1.1.0";
|
|
69
69
|
|
|
70
|
-
var version$G = "1.1.1
|
|
70
|
+
var version$G = "1.1.1";
|
|
71
71
|
|
|
72
|
-
var version$F = "0.19.0
|
|
72
|
+
var version$F = "0.19.0";
|
|
73
73
|
|
|
74
|
-
var version$E = "1.0.2
|
|
74
|
+
var version$E = "1.0.2";
|
|
75
75
|
|
|
76
|
-
var version$D = "1.1.0
|
|
76
|
+
var version$D = "1.1.0";
|
|
77
77
|
|
|
78
|
-
var version$C = "0.11.1
|
|
78
|
+
var version$C = "0.11.1";
|
|
79
79
|
|
|
80
|
-
var version$B = "1.0.6
|
|
80
|
+
var version$B = "1.0.6";
|
|
81
81
|
|
|
82
|
-
var version$A = "1.1.1
|
|
82
|
+
var version$A = "1.1.1";
|
|
83
83
|
|
|
84
|
-
var version$z = "1.1.4
|
|
84
|
+
var version$z = "1.1.4";
|
|
85
85
|
|
|
86
|
-
var version$y = "1.2.0
|
|
86
|
+
var version$y = "1.2.0";
|
|
87
87
|
|
|
88
88
|
var version$x = "0.2.16";
|
|
89
89
|
|
|
90
|
-
var version$w = "0.8.9
|
|
90
|
+
var version$w = "0.8.9";
|
|
91
91
|
|
|
92
|
-
var version$v = "0.3.36
|
|
92
|
+
var version$v = "0.3.36";
|
|
93
93
|
|
|
94
|
-
var version$u = "0.16.0
|
|
94
|
+
var version$u = "0.16.0";
|
|
95
95
|
|
|
96
|
-
var version$t = "0.2.5
|
|
96
|
+
var version$t = "0.2.5";
|
|
97
97
|
|
|
98
|
-
var version$s = "1.5.1
|
|
98
|
+
var version$s = "1.5.1";
|
|
99
99
|
|
|
100
|
-
var version$r = "1.0.6
|
|
100
|
+
var version$r = "1.0.6";
|
|
101
101
|
|
|
102
|
-
var version$q = "1.1.4
|
|
102
|
+
var version$q = "1.1.4";
|
|
103
103
|
|
|
104
|
-
var version$p = "1.4.0
|
|
104
|
+
var version$p = "1.4.0";
|
|
105
105
|
|
|
106
|
-
var version$o = "0.2.21
|
|
106
|
+
var version$o = "0.2.21";
|
|
107
107
|
|
|
108
|
-
var version$n = "0.8.12
|
|
108
|
+
var version$n = "0.8.12";
|
|
109
109
|
|
|
110
|
-
var version$m = "0.3.9
|
|
110
|
+
var version$m = "0.3.9";
|
|
111
111
|
|
|
112
|
-
var version$l = "0.3.40
|
|
112
|
+
var version$l = "0.3.40";
|
|
113
113
|
|
|
114
|
-
var version$k = "0.5.9
|
|
114
|
+
var version$k = "0.5.9";
|
|
115
115
|
|
|
116
|
-
var version$j = "0.3.9
|
|
116
|
+
var version$j = "0.3.9";
|
|
117
117
|
|
|
118
|
-
var version$i = "0.5.9
|
|
118
|
+
var version$i = "0.5.9";
|
|
119
119
|
|
|
120
|
-
var version$h = "0.6.4
|
|
120
|
+
var version$h = "0.6.4";
|
|
121
121
|
|
|
122
|
-
var version$g = "0.4.5
|
|
122
|
+
var version$g = "0.4.5";
|
|
123
123
|
|
|
124
|
-
var version$f = "0.6.5
|
|
124
|
+
var version$f = "0.6.5";
|
|
125
125
|
|
|
126
|
-
var version$e = "0.2.30
|
|
126
|
+
var version$e = "0.2.30";
|
|
127
127
|
|
|
128
|
-
var version$d = "0.1.33
|
|
128
|
+
var version$d = "0.1.33";
|
|
129
129
|
|
|
130
|
-
var version$c = "1.6.0
|
|
130
|
+
var version$c = "1.6.0";
|
|
131
131
|
|
|
132
|
-
var version$b = "1.6.0
|
|
132
|
+
var version$b = "1.6.0";
|
|
133
133
|
|
|
134
|
-
var version$a = "1.0.2
|
|
134
|
+
var version$a = "1.0.2";
|
|
135
135
|
|
|
136
|
-
var version$9 = "1.1.0
|
|
136
|
+
var version$9 = "1.1.0";
|
|
137
137
|
|
|
138
|
-
var version$8 = "1.0.2
|
|
138
|
+
var version$8 = "1.0.2";
|
|
139
139
|
|
|
140
|
-
var version$7 = "0.4.0
|
|
140
|
+
var version$7 = "0.4.0";
|
|
141
141
|
|
|
142
|
-
var version$6 = "1.0.2
|
|
142
|
+
var version$6 = "1.0.2";
|
|
143
143
|
|
|
144
|
-
var version$5 = "0.5.16
|
|
144
|
+
var version$5 = "0.5.16";
|
|
145
145
|
|
|
146
|
-
var version$4 = "1.3.2
|
|
146
|
+
var version$4 = "1.3.2";
|
|
147
147
|
|
|
148
|
-
var version$3 = "1.0.4
|
|
148
|
+
var version$3 = "1.0.4";
|
|
149
149
|
|
|
150
|
-
var version$2 = "1.0.4
|
|
150
|
+
var version$2 = "1.0.4";
|
|
151
151
|
|
|
152
|
-
var version$1 = "1.3.0
|
|
152
|
+
var version$1 = "1.3.0";
|
|
153
153
|
|
|
154
|
-
var version = "0.4.8
|
|
154
|
+
var version = "0.4.8";
|
|
155
155
|
|
|
156
156
|
const packageVersions = {
|
|
157
157
|
root: version$L,
|
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.4.31
|
|
4
|
+
"version": "0.4.31",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"start": "nodemon --"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@backstage/cli-common": "^0.1.10
|
|
35
|
+
"@backstage/cli-common": "^0.1.10",
|
|
36
36
|
"chalk": "^4.0.0",
|
|
37
37
|
"commander": "^9.1.0",
|
|
38
38
|
"fs-extra": "10.1.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"recursive-readdir": "^2.2.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@backstage/cli": "^0.19.0
|
|
45
|
+
"@backstage/cli": "^0.19.0",
|
|
46
46
|
"@types/fs-extra": "^9.0.1",
|
|
47
47
|
"@types/inquirer": "^8.1.3",
|
|
48
48
|
"@types/node": "^16.11.26",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"dist",
|
|
61
61
|
"templates"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "25b94e63455f1fb170506f9e84e3f430f4b79406"
|
|
64
64
|
}
|