@backstage/create-app 0.4.26-next.2 → 0.4.27-next.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 CHANGED
@@ -1,5 +1,317 @@
1
1
  # @backstage/create-app
2
2
 
3
+ ## 0.4.27-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 7b253072c6: Tweaked template to provide an example and guidance for how to configure sign-in in `packages/backend/src/plugins/auth.ts`. There is no need to add this to existing apps, but for more information about sign-in configuration, see https://backstage.io/docs/auth/identity-resolver.
8
+ - 00fa0dada0: Removed the database choice from the `create-app` command.
9
+
10
+ This reduces the step from development to production by always installing the dependencies and templating the production configuration in `app-config.production.yaml`.
11
+
12
+ Added `app-config.local.yaml` to allow for local configuration overrides.
13
+ To replicate this behavior in an existing installation simply `touch app-config.local.yaml` in the project root and apply your local configuration.
14
+
15
+ `better-sqlite3` has been moved to devDependencies, for existing installations using postgres in production and SQLite in development it's recommended to move SQLite into the devDependencies section to avoid unnecessary dependencies during builds.
16
+
17
+ in `packages/backend/package.json`
18
+
19
+ ```diff
20
+ "dependencies": {
21
+ ...
22
+ "pg": "^8.3.0",
23
+ - "better-sqlite3": "^7.5.0",
24
+ "winston": "^3.2.1"
25
+ },
26
+ "devDependencies": {
27
+ ...
28
+ "@types/luxon": "^2.0.4",
29
+ + "better-sqlite3": "^7.5.0"
30
+ }
31
+ ```
32
+
33
+ - d41f19ca2a: Bumped the `typescript` version in the template to `~4.6.4`.
34
+
35
+ To apply this change to an existing app, make the following change to the root `package.json`:
36
+
37
+ ```diff
38
+ dependencies: {
39
+ ...
40
+ - "typescript": "~4.5.4"
41
+ + "typescript": "~4.6.4"
42
+ },
43
+ ```
44
+
45
+ ## 0.4.27-next.0
46
+
47
+ ### Patch Changes
48
+
49
+ - 3983940a21: Optimized the command order in `packages/backend/Dockerfile` as well as added the `--no-install-recommends` to the `apt-get install` and tweaked the installed packages.
50
+
51
+ To apply this change to an existing app, update your `packages/backend/Dockerfile` to match the documented `Dockerfile` at https://backstage.io/docs/deployment/docker#host-build.
52
+
53
+ - 28bbf5aff6: Added some instruction comments to the generated config files, to clarify the
54
+ usage of `backend.baseUrl` and `backend.listen.host`. Importantly, it also per
55
+ default now listens on all IPv4 interfaces, to make it easier to take the step
56
+ over to production. If you want to do the same, update your
57
+ `app-config.production.yaml` as follows:
58
+
59
+ ```diff
60
+ backend:
61
+ listen:
62
+ port: 7007
63
+ + host: 0.0.0.0
64
+ ```
65
+
66
+ Also, updated the builtin backend Dockerfile to honor the
67
+ `app-config.production.yaml` file. If you want to do the same, change
68
+ `packages/backend/Dockerfile` as follows:
69
+
70
+ ```diff
71
+ -COPY packages/backend/dist/bundle.tar.gz app-config.yaml ./
72
+ +COPY packages/backend/dist/bundle.tar.gz app-config*.yaml ./
73
+ RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
74
+
75
+ -CMD ["node", "packages/backend", "--config", "app-config.yaml"]
76
+ +CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
77
+ ```
78
+
79
+ If you look carefully, this adds a glob match on app-config files. For those
80
+ that try out the build flows locally, you also want to make sure that the docker
81
+ daemon does NOT pick up any local/private config files that might contain
82
+ secrets. You should therefore also update your local `.dockerignore` file at the
83
+ same time:
84
+
85
+ ```diff
86
+ +*.local.yaml
87
+ ```
88
+
89
+ - cfc0f19699: Updated dependency `fs-extra` to `10.1.0`.
90
+ - 344ea56acc: Bump `commander` to version 9.1.0
91
+ - 806427545f: Added a link to the `${GITHUB_TOKEN}` to document how to generate a token
92
+
93
+ ## 0.4.26
94
+
95
+ ### Patch Changes
96
+
97
+ - 1691c6c5c2: Made `User` and `Group` entity kinds not permitted by the default
98
+ `catalog.rules` config.
99
+
100
+ The effect of this is that after creating a new Backstage repository, its
101
+ catalog no longer permits regular users to register `User` or `Group` entities
102
+ using the Backstage interface. Additionally, if you have config locations that
103
+ result in `User` or `Group` entities, you need to add those kinds to its own
104
+ specific rules:
105
+
106
+ ```yaml
107
+ catalog:
108
+ locations:
109
+ # This applies for example to url type locations
110
+ - type: url
111
+ target: https://example.com/org.yaml
112
+ rules:
113
+ - allow: [User, Group]
114
+ # But also note that this applies to ALL org location types!
115
+ - type: github-org
116
+ target: https://github.com/my-org-name
117
+ rules:
118
+ - allow: [User, Group]
119
+ ```
120
+
121
+ This rule change does NOT affect entity providers, only things that are emitted
122
+ by entity processors.
123
+
124
+ We recommend that this change is applied to your own Backstage repository, since
125
+ it makes it impossible for regular end users to affect your org data through
126
+ e.g. YAML files. To do so, remove the two kinds from the default rules in your config:
127
+
128
+ ```diff
129
+ catalog:
130
+ rules:
131
+ - - allow: [Component, System, API, Group, User, Resource, Location]
132
+ + - allow: [Component, System, API, Resource, Location]
133
+ ```
134
+
135
+ And for any location that in any way results in org data being ingested, add the corresponding rule to it:
136
+
137
+ ```diff
138
+ catalog:
139
+ locations:
140
+ - type: github-org
141
+ target: https://github.com/my-org-name
142
+ + rules:
143
+ + - allow: [User, Group]
144
+ ```
145
+
146
+ - 0e911394d2: Remove the `knex` package that is installed in the `packages/backend` as it's provided by the `@backstage/*` packages for you automatically. You can make the following change in your `packages/backend/package.json` if you wish to apply this change.
147
+
148
+ ```diff
149
+ "lint": "backstage-cli package lint",
150
+ "test": "backstage-cli package test",
151
+ "clean": "backstage-cli package clean",
152
+ - "migrate:create": "knex migrate:make -x ts"
153
+ ```
154
+
155
+ ```diff
156
+ "express": "^4.17.1",
157
+ "express-promise-router": "^4.1.0",
158
+ - "knex": "^0.21.6",
159
+ "pg": "^8.3.0",
160
+ ```
161
+
162
+ - 520e21aaea: imports `useSearch` hook from new `@backstage/plugin-search-react` package.
163
+
164
+ To upgrade existing Apps:
165
+
166
+ 1. Change the import to the following:
167
+
168
+ `packages/app/src/components/search/SearchPage.tsx`
169
+
170
+ ```diff
171
+ import {
172
+ ...
173
+ SearchType,
174
+ - useSearch,
175
+ } from '@backstage/plugin-search';
176
+ +import { useSearch } from '@backstage/plugin-search-react';
177
+ ```
178
+
179
+ 2. Add `@backstage/plugin-search-react` as a dependency to the app.
180
+
181
+ - 43759dd789: Removed `@octokit/rest` and `@gitbeaker/node` from backend dependencies as these are unused in the default app.
182
+
183
+ To apply these changes to your existing app, remove the following lines from the `dependencies` section of `packages/backend/package.json`
184
+
185
+ ```diff
186
+ "@backstage/plugin-techdocs-backend": "^1.0.0",
187
+ - "@gitbeaker/node": "^34.6.0",
188
+ - "@octokit/rest": "^18.5.3",
189
+ ```
190
+
191
+ - e838a7060a: Add type resolutions for `@types/react` and `types/react-dom`.
192
+
193
+ The reason for this is the usage of `"@types/react": "*"` as a dependency which is very common practice in react packages. This recently resolves to react 18 which introduces several breaking changes in both internal and external packages.
194
+
195
+ To apply these changes to your existing installation, add a resolutions block to your `package.json`
196
+
197
+ ```json
198
+ "resolutions": {
199
+ "@types/react": "^17",
200
+ "@types/react-dom": "^17"
201
+ },
202
+ ```
203
+
204
+ If your existing app depends on react 16, use this resolution block instead.
205
+
206
+ ```json
207
+ "resolutions": {
208
+ "@types/react": "^16",
209
+ "@types/react-dom": "^16"
210
+ },
211
+ ```
212
+
213
+ - 0a63e99a26: **BREAKING**: `IndexBuilder.addCollator()` now requires a `schedule` parameter (replacing `defaultRefreshIntervalSeconds`) which is expected to be a `TaskRunner` that is configured with the desired search indexing schedule for the given collator.
214
+
215
+ `Scheduler.addToSchedule()` now takes a new parameter object (`ScheduleTaskParameters`) with two new options `id` and `scheduledRunner` in addition to the migrated `task` argument.
216
+
217
+ NOTE: The search backend plugin now creates a dedicated database for coordinating indexing tasks.
218
+
219
+ To make this change to an existing app, make the following changes to `packages/backend/src/plugins/search.ts`:
220
+
221
+ ```diff
222
+ +import { Duration } from 'luxon';
223
+
224
+ /* ... */
225
+
226
+ + const schedule = env.scheduler.createScheduledTaskRunner({
227
+ + frequency: Duration.fromObject({ minutes: 10 }),
228
+ + timeout: Duration.fromObject({ minutes: 15 }),
229
+ + initialDelay: Duration.fromObject({ seconds: 3 }),
230
+ + });
231
+
232
+ indexBuilder.addCollator({
233
+ - defaultRefreshIntervalSeconds: 600,
234
+ + schedule,
235
+ factory: DefaultCatalogCollatorFactory.fromConfig(env.config, {
236
+ discovery: env.discovery,
237
+ tokenManager: env.tokenManager,
238
+ }),
239
+ });
240
+
241
+ indexBuilder.addCollator({
242
+ - defaultRefreshIntervalSeconds: 600,
243
+ + schedule,
244
+ factory: DefaultTechDocsCollatorFactory.fromConfig(env.config, {
245
+ discovery: env.discovery,
246
+ tokenManager: env.tokenManager,
247
+ }),
248
+ });
249
+
250
+ const { scheduler } = await indexBuilder.build();
251
+ - setTimeout(() => scheduler.start(), 3000);
252
+ + scheduler.start();
253
+ /* ... */
254
+ ```
255
+
256
+ NOTE: For scenarios where the `lunr` search engine is used in a multi-node configuration, a non-distributed `TaskRunner` like the following should be implemented to ensure consistency across nodes (alternatively, you can configure
257
+ the search plugin to use a non-distributed DB such as [SQLite](https://backstage.io/docs/tutorials/configuring-plugin-databases#postgresql-and-sqlite-3)):
258
+
259
+ ```diff
260
+ +import { TaskInvocationDefinition, TaskRunner } from '@backstage/backend-tasks';
261
+
262
+ /* ... */
263
+
264
+ + const schedule: TaskRunner = {
265
+ + run: async (task: TaskInvocationDefinition) => {
266
+ + const startRefresh = async () => {
267
+ + while (!task.signal?.aborted) {
268
+ + try {
269
+ + await task.fn(task.signal);
270
+ + } catch {
271
+ + // ignore intentionally
272
+ + }
273
+ +
274
+ + await new Promise(resolve => setTimeout(resolve, 600 * 1000));
275
+ + }
276
+ + };
277
+ + startRefresh();
278
+ + },
279
+ + };
280
+
281
+ indexBuilder.addCollator({
282
+ - defaultRefreshIntervalSeconds: 600,
283
+ + schedule,
284
+ factory: DefaultCatalogCollatorFactory.fromConfig(env.config, {
285
+ discovery: env.discovery,
286
+ tokenManager: env.tokenManager,
287
+ }),
288
+ });
289
+
290
+ /* ... */
291
+ ```
292
+
293
+ - c07d9f9e1c: Add helpful README.md files in the original `packages` and `plugins` folders
294
+ - 230ad0826f: Bump to using `@types/node` v16
295
+ - 1882dbda2b: Accept `PermissionEvaluator` instead of the deprecated `PermissionAuthorizer`.
296
+
297
+ Apply the following to `packages/backend/src/types.ts`:
298
+
299
+ ```diff
300
+ - import { PermissionAuthorizer } from '@backstage/plugin-permission-common';
301
+ + import { PermissionEvaluator } from '@backstage/plugin-permission-common';
302
+
303
+ export type PluginEnvironment = {
304
+ ...
305
+ discovery: PluginEndpointDiscovery;
306
+ tokenManager: TokenManager;
307
+ scheduler: PluginTaskScheduler;
308
+ - permissions: PermissionAuthorizer;
309
+ + permissions: PermissionEvaluator;
310
+ };
311
+ ```
312
+
313
+ - e80cca164d: Tweaked `.eslintrc.js` files in the template to avoid having them apply during development. This change does not affect create apps.
314
+
3
315
  ## 0.4.26-next.2
4
316
 
5
317
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var program = require('commander');
3
+ var commander = require('commander');
4
4
  var chalk = require('chalk');
5
5
  var inquirer = require('inquirer');
6
6
  var path = require('path');
@@ -15,7 +15,6 @@ var util = require('util');
15
15
 
16
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
17
 
18
- var program__default = /*#__PURE__*/_interopDefaultLegacy(program);
19
18
  var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
20
19
  var inquirer__default = /*#__PURE__*/_interopDefaultLegacy(inquirer);
21
20
  var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
@@ -31,10 +30,13 @@ class CustomError extends Error {
31
30
  }
32
31
  class ExitCodeError extends CustomError {
33
32
  constructor(code, command) {
33
+ var __super = (...args) => {
34
+ super(...args);
35
+ };
34
36
  if (command) {
35
- super(`Command '${command}' exited with code ${code}`);
37
+ __super(`Command '${command}' exited with code ${code}`);
36
38
  } else {
37
- super(`Child exited with code ${code}`);
39
+ __super(`Child exited with code ${code}`);
38
40
  }
39
41
  this.code = code;
40
42
  }
@@ -55,132 +57,135 @@ ${chalk__default["default"].red(`${error}`)}
55
57
  }
56
58
  }
57
59
 
58
- var version$I = "0.4.26-next.2";
60
+ var version$J = "0.4.27-next.1";
59
61
 
60
- var version$H = "1.1.0-next.3";
62
+ var version$I = "1.2.0-next.1";
61
63
 
62
- var version$G = "1.0.1-next.2";
64
+ var version$H = "1.0.2-next.0";
63
65
 
64
- var version$F = "0.13.2-next.2";
66
+ var version$G = "0.13.3-next.1";
65
67
 
66
- var version$E = "0.3.0-next.2";
68
+ var version$F = "0.3.1-next.0";
67
69
 
68
- var version$D = "1.0.1-next.0";
70
+ var version$E = "1.0.1";
69
71
 
70
- var version$C = "1.0.1-next.1";
72
+ var version$D = "1.0.1";
71
73
 
72
- var version$B = "0.17.0-next.3";
74
+ var version$C = "0.17.1-next.1";
73
75
 
74
- var version$A = "1.0.0";
76
+ var version$B = "1.0.0";
75
77
 
76
- var version$z = "1.0.1-next.1";
78
+ var version$A = "1.0.2-next.0";
77
79
 
78
- var version$y = "0.9.3-next.2";
80
+ var version$z = "0.9.4-next.0";
79
81
 
80
- var version$x = "1.0.1-next.0";
82
+ var version$y = "1.0.2-next.0";
81
83
 
82
- var version$w = "1.0.0";
84
+ var version$x = "1.0.0";
83
85
 
84
- var version$v = "1.0.1-next.2";
86
+ var version$w = "1.1.0-next.1";
85
87
 
86
- var version$u = "1.0.1-next.2";
88
+ var version$v = "1.1.0-next.1";
87
89
 
88
- var version$t = "0.2.15";
90
+ var version$u = "0.2.15";
89
91
 
90
- var version$s = "0.8.4-next.3";
92
+ var version$t = "0.8.5-next.1";
91
93
 
92
- var version$r = "0.3.31-next.1";
94
+ var version$s = "0.3.32-next.0";
93
95
 
94
- var version$q = "0.13.0-next.2";
96
+ var version$r = "0.13.1-next.1";
95
97
 
96
- var version$p = "1.1.0-next.3";
98
+ var version$q = "1.2.0-next.1";
97
99
 
98
- var version$o = "1.0.1-next.1";
100
+ var version$p = "1.0.1";
99
101
 
100
- var version$n = "1.0.1-next.3";
102
+ var version$o = "1.1.0-next.1";
101
103
 
102
- var version$m = "1.1.0-next.3";
104
+ var version$n = "1.1.2-next.1";
103
105
 
104
- var version$l = "0.2.16-next.3";
106
+ var version$m = "0.2.17-next.1";
105
107
 
106
- var version$k = "0.8.7-next.2";
108
+ var version$l = "0.8.8-next.1";
107
109
 
108
- var version$j = "0.3.4-next.1";
110
+ var version$k = "0.3.5-next.1";
109
111
 
110
- var version$i = "0.3.35-next.1";
112
+ var version$j = "0.3.36-next.1";
111
113
 
112
- var version$h = "0.5.4-next.2";
114
+ var version$i = "0.5.5-next.1";
113
115
 
114
- var version$g = "0.3.4-next.1";
116
+ var version$h = "0.3.5-next.1";
115
117
 
116
- var version$f = "0.5.4-next.3";
118
+ var version$g = "0.5.5-next.1";
117
119
 
118
- var version$e = "0.6.0-next.1";
120
+ var version$f = "0.6.0";
119
121
 
120
- var version$d = "0.4.0-next.1";
122
+ var version$e = "0.4.1-next.0";
121
123
 
122
- var version$c = "0.6.0-next.2";
124
+ var version$d = "0.6.1-next.0";
123
125
 
124
- var version$b = "0.2.25-next.0";
126
+ var version$c = "0.2.26-next.0";
125
127
 
126
- var version$a = "0.1.28-next.0";
128
+ var version$b = "0.1.29-next.1";
127
129
 
128
- var version$9 = "1.1.0-next.3";
130
+ var version$a = "1.2.0-next.1";
129
131
 
130
- var version$8 = "1.1.0-next.2";
132
+ var version$9 = "1.2.0-next.0";
131
133
 
132
- var version$7 = "0.7.5-next.1";
134
+ var version$8 = "0.8.1-next.1";
133
135
 
134
- var version$6 = "0.5.0-next.2";
136
+ var version$7 = "0.2.0-next.1";
135
137
 
136
- var version$5 = "0.3.2-next.1";
138
+ var version$6 = "0.5.2-next.0";
137
139
 
138
- var version$4 = "0.6.0-next.1";
140
+ var version$5 = "0.3.3-next.0";
139
141
 
140
- var version$3 = "0.5.11-next.2";
142
+ var version$4 = "0.6.1-next.0";
141
143
 
142
- var version$2 = "1.1.0-next.3";
144
+ var version$3 = "0.5.12-next.0";
143
145
 
144
- var version$1 = "1.1.0-next.2";
146
+ var version$2 = "1.1.1-next.1";
145
147
 
146
- var version = "0.4.3-next.1";
148
+ var version$1 = "1.1.1-next.0";
149
+
150
+ var version = "0.4.4-next.0";
147
151
 
148
152
  const packageVersions = {
149
- root: version$H,
150
- "@backstage/app-defaults": version$G,
151
- "@backstage/backend-common": version$F,
152
- "@backstage/backend-tasks": version$E,
153
- "@backstage/catalog-client": version$D,
154
- "@backstage/catalog-model": version$C,
155
- "@backstage/cli": version$B,
156
- "@backstage/config": version$A,
157
- "@backstage/core-app-api": version$z,
158
- "@backstage/core-components": version$y,
159
- "@backstage/core-plugin-api": version$x,
160
- "@backstage/errors": version$w,
161
- "@backstage/integration-react": version$v,
162
- "@backstage/plugin-api-docs": version$s,
163
- "@backstage/plugin-app-backend": version$r,
164
- "@backstage/plugin-auth-backend": version$q,
165
- "@backstage/plugin-catalog": version$p,
166
- "@backstage/plugin-catalog-common": version$o,
167
- "@backstage/plugin-catalog-react": version$n,
168
- "@backstage/plugin-catalog-backend": version$m,
169
- "@backstage/plugin-catalog-graph": version$l,
170
- "@backstage/plugin-catalog-import": version$k,
171
- "@backstage/plugin-circleci": version$j,
172
- "@backstage/plugin-explore": version$i,
173
- "@backstage/plugin-github-actions": version$h,
174
- "@backstage/plugin-lighthouse": version$g,
175
- "@backstage/plugin-org": version$f,
176
- "@backstage/plugin-permission-common": version$e,
177
- "@backstage/plugin-permission-node": version$c,
178
- "@backstage/plugin-permission-react": version$d,
179
- "@backstage/plugin-proxy-backend": version$b,
180
- "@backstage/plugin-rollbar-backend": version$a,
181
- "@backstage/plugin-scaffolder": version$9,
182
- "@backstage/plugin-scaffolder-backend": version$8,
183
- "@backstage/plugin-search": version$7,
153
+ root: version$I,
154
+ "@backstage/app-defaults": version$H,
155
+ "@backstage/backend-common": version$G,
156
+ "@backstage/backend-tasks": version$F,
157
+ "@backstage/catalog-client": version$E,
158
+ "@backstage/catalog-model": version$D,
159
+ "@backstage/cli": version$C,
160
+ "@backstage/config": version$B,
161
+ "@backstage/core-app-api": version$A,
162
+ "@backstage/core-components": version$z,
163
+ "@backstage/core-plugin-api": version$y,
164
+ "@backstage/errors": version$x,
165
+ "@backstage/integration-react": version$w,
166
+ "@backstage/plugin-api-docs": version$t,
167
+ "@backstage/plugin-app-backend": version$s,
168
+ "@backstage/plugin-auth-backend": version$r,
169
+ "@backstage/plugin-catalog": version$q,
170
+ "@backstage/plugin-catalog-common": version$p,
171
+ "@backstage/plugin-catalog-react": version$o,
172
+ "@backstage/plugin-catalog-backend": version$n,
173
+ "@backstage/plugin-catalog-graph": version$m,
174
+ "@backstage/plugin-catalog-import": version$l,
175
+ "@backstage/plugin-circleci": version$k,
176
+ "@backstage/plugin-explore": version$j,
177
+ "@backstage/plugin-github-actions": version$i,
178
+ "@backstage/plugin-lighthouse": version$h,
179
+ "@backstage/plugin-org": version$g,
180
+ "@backstage/plugin-permission-common": version$f,
181
+ "@backstage/plugin-permission-node": version$d,
182
+ "@backstage/plugin-permission-react": version$e,
183
+ "@backstage/plugin-proxy-backend": version$c,
184
+ "@backstage/plugin-rollbar-backend": version$b,
185
+ "@backstage/plugin-scaffolder": version$a,
186
+ "@backstage/plugin-scaffolder-backend": version$9,
187
+ "@backstage/plugin-search": version$8,
188
+ "@backstage/plugin-search-react": version$7,
184
189
  "@backstage/plugin-search-backend": version$6,
185
190
  "@backstage/plugin-search-backend-module-pg": version$5,
186
191
  "@backstage/plugin-search-backend-node": version$4,
@@ -188,8 +193,8 @@ const packageVersions = {
188
193
  "@backstage/plugin-techdocs": version$2,
189
194
  "@backstage/plugin-techdocs-backend": version$1,
190
195
  "@backstage/plugin-user-settings": version,
191
- "@backstage/test-utils": version$u,
192
- "@backstage/theme": version$t
196
+ "@backstage/test-utils": version$v,
197
+ "@backstage/theme": version$u
193
198
  };
194
199
 
195
200
  const TASK_NAME_MAX_LENGTH = 14;
@@ -318,7 +323,7 @@ async function moveAppTask(tempDir, destination, id) {
318
323
  });
319
324
  }
320
325
 
321
- var createApp = async (cmd) => {
326
+ var createApp = async (opts) => {
322
327
  const paths = cliCommon.findPaths(__dirname);
323
328
  const answers = await inquirer__default["default"].prompt([
324
329
  {
@@ -333,27 +338,19 @@ var createApp = async (cmd) => {
333
338
  }
334
339
  return true;
335
340
  }
336
- },
337
- {
338
- type: "list",
339
- name: "dbType",
340
- message: chalk__default["default"].blue("Select database for the backend [required]"),
341
- choices: ["SQLite", "PostgreSQL"]
342
341
  }
343
342
  ]);
344
- answers.dbTypePG = answers.dbType === "PostgreSQL";
345
- answers.dbTypeSqlite = answers.dbType === "SQLite";
346
343
  const templateDir = paths.resolveOwn("templates/default-app");
347
344
  const tempDir = path.resolve(os__default["default"].tmpdir(), answers.name);
348
- const appDir = cmd.path ? path.resolve(paths.targetDir, cmd.path) : path.resolve(paths.targetDir, answers.name);
345
+ const appDir = opts.path ? path.resolve(paths.targetDir, opts.path) : path.resolve(paths.targetDir, answers.name);
349
346
  Task.log();
350
347
  Task.log("Creating the app...");
351
348
  try {
352
- if (cmd.path) {
349
+ if (opts.path) {
353
350
  Task.section("Checking that supplied path exists");
354
351
  await checkPathExistsTask(appDir);
355
352
  Task.section("Preparing files");
356
- await templatingTask(templateDir, cmd.path, answers);
353
+ await templatingTask(templateDir, opts.path, answers);
357
354
  } else {
358
355
  Task.section("Checking if the directory is available");
359
356
  await checkAppExistsTask(paths.targetDir, answers.name);
@@ -364,7 +361,7 @@ var createApp = async (cmd) => {
364
361
  Task.section("Moving to final location");
365
362
  await moveAppTask(tempDir, appDir, answers.name);
366
363
  }
367
- if (!cmd.skipInstall) {
364
+ if (!opts.skipInstall) {
368
365
  Task.section("Building the app");
369
366
  await buildAppTask(appDir);
370
367
  }
@@ -386,8 +383,8 @@ var createApp = async (cmd) => {
386
383
  };
387
384
 
388
385
  const main = (argv) => {
389
- program__default["default"].name("backstage-create-app").version(version$I).description("Creates a new app in a new directory or specified path").option("--path [directory]", "Location to store the app defaulting to a new folder with the app name").option("--skip-install", "Skip the install and builds steps after creating the app").action((cmd) => createApp(cmd));
390
- program__default["default"].parse(argv);
386
+ commander.program.name("backstage-create-app").version(version$J).description("Creates a new app in a new directory or specified path").option("--path [directory]", "Location to store the app defaulting to a new folder with the app name").option("--skip-install", "Skip the install and builds steps after creating the app").action((cmd) => createApp(cmd));
387
+ commander.program.parse(argv);
391
388
  };
392
389
  process.on("unhandledRejection", (rejection) => {
393
390
  if (rejection instanceof Error) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/lib/errors.ts","../src/lib/versions.ts","../src/lib/tasks.ts","../src/createApp.ts","../src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport chalk from 'chalk';\n\nexport class CustomError extends Error {\n get name(): string {\n return this.constructor.name;\n }\n}\n\nexport class ExitCodeError extends CustomError {\n readonly code: number;\n\n constructor(code: number, command?: string) {\n if (command) {\n super(`Command '${command}' exited with code ${code}`);\n } else {\n super(`Child exited with code ${code}`);\n }\n this.code = code;\n }\n}\n\nexport function exitWithError(error: Error): never {\n if (error instanceof ExitCodeError) {\n process.stderr.write(`\\n${chalk.red(error.message)}\\n\\n`);\n process.exit(error.code);\n } else {\n process.stderr.write(`\\n${chalk.red(`${error}`)}\\n\\n`);\n process.exit(1);\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable monorepo/no-relative-import */\n\n/*\nThis is a list of all packages used by the template. If dependencies are added or removed,\nthis list should be updated as well.\n\nThe list, and the accompanying peerDependencies entries, are here to ensure correct versioning\nand bumping of this package. Without this list the version would not be bumped unless we\nmanually trigger a release.\n\nThis does not create an actual dependency on these packages and does not bring in any code.\nRelative imports are used rather than package imports to make sure the packages aren't externalized.\nRollup will extract the value of the version field in each package at build time without\nleaving any imports in place.\n*/\n\nimport { version as root } from '../../../../package.json';\n\nimport { version as appDefaults } from '../../../app-defaults/package.json';\nimport { version as backendCommon } from '../../../backend-common/package.json';\nimport { version as backendTasks } from '../../../backend-tasks/package.json';\nimport { version as catalogClient } from '../../../catalog-client/package.json';\nimport { version as catalogModel } from '../../../catalog-model/package.json';\nimport { version as cli } from '../../../cli/package.json';\nimport { version as config } from '../../../config/package.json';\nimport { version as coreAppApi } from '../../../core-app-api/package.json';\nimport { version as coreComponents } from '../../../core-components/package.json';\nimport { version as corePluginApi } from '../../../core-plugin-api/package.json';\nimport { version as errors } from '../../../errors/package.json';\nimport { version as integrationReact } from '../../../integration-react/package.json';\nimport { version as testUtils } from '../../../test-utils/package.json';\nimport { version as theme } from '../../../theme/package.json';\n\nimport { version as pluginApiDocs } from '../../../../plugins/api-docs/package.json';\nimport { version as pluginAppBackend } from '../../../../plugins/app-backend/package.json';\nimport { version as pluginAuthBackend } from '../../../../plugins/auth-backend/package.json';\nimport { version as pluginCatalog } from '../../../../plugins/catalog/package.json';\nimport { version as pluginCatalogCommon } from '../../../../plugins/catalog-common/package.json';\nimport { version as pluginCatalogReact } from '../../../../plugins/catalog-react/package.json';\nimport { version as pluginCatalogBackend } from '../../../../plugins/catalog-backend/package.json';\nimport { version as pluginCatalogGraph } from '../../../../plugins/catalog-graph/package.json';\nimport { version as pluginCatalogImport } from '../../../../plugins/catalog-import/package.json';\nimport { version as pluginCircleci } from '../../../../plugins/circleci/package.json';\nimport { version as pluginExplore } from '../../../../plugins/explore/package.json';\nimport { version as pluginGithubActions } from '../../../../plugins/github-actions/package.json';\nimport { version as pluginLighthouse } from '../../../../plugins/lighthouse/package.json';\nimport { version as pluginOrg } from '../../../../plugins/org/package.json';\nimport { version as pluginPermissionCommon } from '../../../../plugins/permission-common/package.json';\nimport { version as pluginPermissionReact } from '../../../../plugins/permission-react/package.json';\nimport { version as pluginPermissionNode } from '../../../../plugins/permission-node/package.json';\nimport { version as pluginProxyBackend } from '../../../../plugins/proxy-backend/package.json';\nimport { version as pluginRollbarBackend } from '../../../../plugins/rollbar-backend/package.json';\nimport { version as pluginScaffolder } from '../../../../plugins/scaffolder/package.json';\nimport { version as pluginScaffolderBackend } from '../../../../plugins/scaffolder-backend/package.json';\nimport { version as pluginSearch } from '../../../../plugins/search/package.json';\nimport { version as pluginSearchBackend } from '../../../../plugins/search-backend/package.json';\nimport { version as pluginSearchBackendModulePg } from '../../../../plugins/search-backend-module-pg/package.json';\nimport { version as pluginSearchBackendNode } from '../../../../plugins/search-backend-node/package.json';\nimport { version as pluginTechRadar } from '../../../../plugins/tech-radar/package.json';\nimport { version as pluginTechdocs } from '../../../../plugins/techdocs/package.json';\nimport { version as pluginTechdocsBackend } from '../../../../plugins/techdocs-backend/package.json';\nimport { version as pluginUserSettings } from '../../../../plugins/user-settings/package.json';\n\nexport const packageVersions = {\n root,\n '@backstage/app-defaults': appDefaults,\n '@backstage/backend-common': backendCommon,\n '@backstage/backend-tasks': backendTasks,\n '@backstage/catalog-client': catalogClient,\n '@backstage/catalog-model': catalogModel,\n '@backstage/cli': cli,\n '@backstage/config': config,\n '@backstage/core-app-api': coreAppApi,\n '@backstage/core-components': coreComponents,\n '@backstage/core-plugin-api': corePluginApi,\n '@backstage/errors': errors,\n '@backstage/integration-react': integrationReact,\n '@backstage/plugin-api-docs': pluginApiDocs,\n '@backstage/plugin-app-backend': pluginAppBackend,\n '@backstage/plugin-auth-backend': pluginAuthBackend,\n '@backstage/plugin-catalog': pluginCatalog,\n '@backstage/plugin-catalog-common': pluginCatalogCommon,\n '@backstage/plugin-catalog-react': pluginCatalogReact,\n '@backstage/plugin-catalog-backend': pluginCatalogBackend,\n '@backstage/plugin-catalog-graph': pluginCatalogGraph,\n '@backstage/plugin-catalog-import': pluginCatalogImport,\n '@backstage/plugin-circleci': pluginCircleci,\n '@backstage/plugin-explore': pluginExplore,\n '@backstage/plugin-github-actions': pluginGithubActions,\n '@backstage/plugin-lighthouse': pluginLighthouse,\n '@backstage/plugin-org': pluginOrg,\n '@backstage/plugin-permission-common': pluginPermissionCommon,\n '@backstage/plugin-permission-node': pluginPermissionNode,\n '@backstage/plugin-permission-react': pluginPermissionReact,\n '@backstage/plugin-proxy-backend': pluginProxyBackend,\n '@backstage/plugin-rollbar-backend': pluginRollbarBackend,\n '@backstage/plugin-scaffolder': pluginScaffolder,\n '@backstage/plugin-scaffolder-backend': pluginScaffolderBackend,\n '@backstage/plugin-search': pluginSearch,\n '@backstage/plugin-search-backend': pluginSearchBackend,\n '@backstage/plugin-search-backend-module-pg': pluginSearchBackendModulePg,\n '@backstage/plugin-search-backend-node': pluginSearchBackendNode,\n '@backstage/plugin-tech-radar': pluginTechRadar,\n '@backstage/plugin-techdocs': pluginTechdocs,\n '@backstage/plugin-techdocs-backend': pluginTechdocsBackend,\n '@backstage/plugin-user-settings': pluginUserSettings,\n '@backstage/test-utils': testUtils,\n '@backstage/theme': theme,\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport handlebars from 'handlebars';\nimport ora from 'ora';\nimport recursive from 'recursive-readdir';\nimport {\n basename,\n dirname,\n resolve as resolvePath,\n relative as relativePath,\n} from 'path';\nimport { exec as execCb } from 'child_process';\nimport { packageVersions } from './versions';\nimport { promisify } from 'util';\n\nconst TASK_NAME_MAX_LENGTH = 14;\nconst exec = promisify(execCb);\n\nexport class Task {\n static log(name: string = '') {\n process.stdout.write(`${chalk.green(name)}\\n`);\n }\n\n static error(message: string = '') {\n process.stdout.write(`\\n${chalk.red(message)}\\n\\n`);\n }\n\n static section(name: string) {\n const title = chalk.green(`${name}:`);\n process.stdout.write(`\\n ${title}\\n`);\n }\n\n static exit(code: number = 0) {\n process.exit(code);\n }\n\n static async forItem(\n task: string,\n item: string,\n taskFunc: () => Promise<void>,\n ): Promise<void> {\n const paddedTask = chalk.green(task.padEnd(TASK_NAME_MAX_LENGTH));\n\n const spinner = ora({\n prefixText: chalk.green(` ${paddedTask}${chalk.cyan(item)}`),\n spinner: 'arc',\n color: 'green',\n }).start();\n\n try {\n await taskFunc();\n spinner.succeed();\n } catch (error) {\n spinner.fail();\n throw error;\n }\n }\n}\n\n/**\n * Generate a templated backstage project\n *\n * @param templateDir - location containing template files\n * @param destinationDir - location to save templated project\n * @param context - template parameters\n */\nexport async function templatingTask(\n templateDir: string,\n destinationDir: string,\n context: any,\n) {\n const files = await recursive(templateDir).catch(error => {\n throw new Error(`Failed to read template directory: ${error.message}`);\n });\n\n for (const file of files) {\n const destinationFile = resolvePath(\n destinationDir,\n relativePath(templateDir, file),\n );\n await fs.ensureDir(dirname(destinationFile));\n\n if (file.endsWith('.hbs')) {\n await Task.forItem('templating', basename(file), async () => {\n const destination = destinationFile.replace(/\\.hbs$/, '');\n\n const template = await fs.readFile(file);\n const compiled = handlebars.compile(template.toString());\n const contents = compiled(\n { name: basename(destination), ...context },\n {\n helpers: {\n version(name: keyof typeof packageVersions) {\n if (name in packageVersions) {\n return packageVersions[name];\n }\n throw new Error(`No version available for package ${name}`);\n },\n },\n },\n );\n\n await fs.writeFile(destination, contents).catch(error => {\n throw new Error(\n `Failed to create file: ${destination}: ${error.message}`,\n );\n });\n });\n } else {\n await Task.forItem('copying', basename(file), async () => {\n await fs.copyFile(file, destinationFile).catch(error => {\n const destination = destinationFile;\n throw new Error(\n `Failed to copy file to ${destination} : ${error.message}`,\n );\n });\n });\n }\n }\n}\n\n/**\n * Verify that application target does not already exist\n *\n * @param rootDir - The directory to create application folder `name`\n * @param name - The specified name of the application\n * @Throws Error - If directory with name of `destination` already exists\n */\nexport async function checkAppExistsTask(rootDir: string, name: string) {\n await Task.forItem('checking', name, async () => {\n const destination = resolvePath(rootDir, name);\n\n if (await fs.pathExists(destination)) {\n const existing = chalk.cyan(destination.replace(`${rootDir}/`, ''));\n throw new Error(\n `A directory with the same name already exists: ${existing}\\nPlease try again with a different app name`,\n );\n }\n });\n}\n\n/**\n * Verify that application `path` exists, otherwise create the directory\n *\n * @param path - target to create directory\n * @throws if `path` is a file, or `fs.mkdir` fails\n */\nexport async function checkPathExistsTask(path: string) {\n await Task.forItem('checking', path, async () => {\n try {\n await fs.mkdirs(path);\n } catch (error) {\n // will fail if a file already exists at given `path`\n throw new Error(`Failed to create app directory: ${error.message}`);\n }\n });\n}\n\n/**\n * Create a folder to store templated files\n *\n * @param tempDir - target temporary directory\n * @throws if `fs.mkdir` fails\n */\nexport async function createTemporaryAppFolderTask(tempDir: string) {\n await Task.forItem('creating', 'temporary directory', async () => {\n try {\n await fs.mkdir(tempDir);\n } catch (error) {\n throw new Error(`Failed to create temporary app directory, ${error}`);\n }\n });\n}\n\n/**\n * Run `yarn install` and `run tsc` in application directory\n *\n * @param appDir - location of application to build\n */\nexport async function buildAppTask(appDir: string) {\n const runCmd = async (cmd: string) => {\n await Task.forItem('executing', cmd, async () => {\n process.chdir(appDir);\n await exec(cmd).catch(error => {\n process.stdout.write(error.stderr);\n process.stdout.write(error.stdout);\n throw new Error(`Could not execute command ${chalk.cyan(cmd)}`);\n });\n });\n };\n\n await runCmd('yarn install');\n await runCmd('yarn tsc');\n}\n\n/**\n * Move temporary directory to destination application folder\n *\n * @param tempDir - source path to copy files from\n * @param destination - target path to copy files\n * @param id - item ID\n * @throws if `fs.move` fails\n */\nexport async function moveAppTask(\n tempDir: string,\n destination: string,\n id: string,\n) {\n await Task.forItem('moving', id, async () => {\n await fs\n .move(tempDir, destination)\n .catch(error => {\n throw new Error(\n `Failed to move app from ${tempDir} to ${destination}: ${error.message}`,\n );\n })\n .finally(() => {\n // remove temporary files on both success and failure\n fs.removeSync(tempDir);\n });\n });\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport chalk from 'chalk';\nimport { Command } from 'commander';\nimport inquirer, { Answers } from 'inquirer';\nimport { resolve as resolvePath } from 'path';\nimport { findPaths } from '@backstage/cli-common';\nimport os from 'os';\nimport {\n Task,\n buildAppTask,\n checkAppExistsTask,\n checkPathExistsTask,\n createTemporaryAppFolderTask,\n moveAppTask,\n templatingTask,\n} from './lib/tasks';\n\nexport default async (cmd: Command): Promise<void> => {\n /* eslint-disable-next-line no-restricted-syntax */\n const paths = findPaths(__dirname);\n\n const answers: Answers = await inquirer.prompt([\n {\n type: 'input',\n name: 'name',\n message: chalk.blue('Enter a name for the app [required]'),\n validate: (value: any) => {\n if (!value) {\n return chalk.red('Please enter a name for the app');\n } else if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(value)) {\n return chalk.red(\n 'App name must be lowercase and contain only letters, digits, and dashes.',\n );\n }\n return true;\n },\n },\n {\n type: 'list',\n name: 'dbType',\n message: chalk.blue('Select database for the backend [required]'),\n choices: ['SQLite', 'PostgreSQL'],\n },\n ]);\n answers.dbTypePG = answers.dbType === 'PostgreSQL';\n answers.dbTypeSqlite = answers.dbType === 'SQLite';\n\n const templateDir = paths.resolveOwn('templates/default-app');\n const tempDir = resolvePath(os.tmpdir(), answers.name);\n\n // Use `--path` argument as application directory when specified, otherwise\n // create a directory using `answers.name`\n const appDir = cmd.path\n ? resolvePath(paths.targetDir, cmd.path)\n : resolvePath(paths.targetDir, answers.name);\n\n Task.log();\n Task.log('Creating the app...');\n\n try {\n if (cmd.path) {\n // Template directly to specified path\n\n Task.section('Checking that supplied path exists');\n await checkPathExistsTask(appDir);\n\n Task.section('Preparing files');\n await templatingTask(templateDir, cmd.path, answers);\n } else {\n // Template to temporary location, and then move files\n\n Task.section('Checking if the directory is available');\n await checkAppExistsTask(paths.targetDir, answers.name);\n\n Task.section('Creating a temporary app directory');\n await createTemporaryAppFolderTask(tempDir);\n\n Task.section('Preparing files');\n await templatingTask(templateDir, tempDir, answers);\n\n Task.section('Moving to final location');\n await moveAppTask(tempDir, appDir, answers.name);\n }\n\n if (!cmd.skipInstall) {\n Task.section('Building the app');\n await buildAppTask(appDir);\n }\n\n Task.log();\n Task.log(\n chalk.green(`🥇 Successfully created ${chalk.cyan(answers.name)}`),\n );\n Task.log();\n Task.section('All set! Now you might want to');\n Task.log(` Run the app: ${chalk.cyan(`cd ${answers.name} && yarn dev`)}`);\n Task.log(\n ' Set up the software catalog: https://backstage.io/docs/features/software-catalog/configuration',\n );\n Task.log(' Add authentication: https://backstage.io/docs/auth/');\n Task.log();\n Task.exit();\n } catch (error) {\n Task.error(String(error));\n\n Task.log('It seems that something went wrong when creating the app 🤔');\n\n Task.error('🔥 Failed to create app!');\n Task.exit(1);\n }\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A CLI that helps you create your own Backstage app\n *\n * @packageDocumentation\n */\n\nimport program from 'commander';\nimport { exitWithError } from './lib/errors';\nimport { version } from '../package.json';\nimport createApp from './createApp';\n\nconst main = (argv: string[]) => {\n program\n .name('backstage-create-app')\n .version(version)\n .description('Creates a new app in a new directory or specified path')\n .option(\n '--path [directory]',\n 'Location to store the app defaulting to a new folder with the app name',\n )\n .option(\n '--skip-install',\n 'Skip the install and builds steps after creating the app',\n )\n .action(cmd => createApp(cmd));\n\n program.parse(argv);\n};\n\nprocess.on('unhandledRejection', rejection => {\n if (rejection instanceof Error) {\n exitWithError(rejection);\n } else {\n exitWithError(new Error(`Unknown rejection: '${rejection}'`));\n }\n});\n\nmain(process.argv);\n"],"names":["chalk","root","appDefaults","backendCommon","backendTasks","catalogClient","catalogModel","cli","config","coreAppApi","coreComponents","corePluginApi","errors","integrationReact","pluginApiDocs","pluginAppBackend","pluginAuthBackend","pluginCatalog","pluginCatalogCommon","pluginCatalogReact","pluginCatalogBackend","pluginCatalogGraph","pluginCatalogImport","pluginCircleci","pluginExplore","pluginGithubActions","pluginLighthouse","pluginOrg","pluginPermissionCommon","pluginPermissionNode","pluginPermissionReact","pluginProxyBackend","pluginRollbarBackend","pluginScaffolder","pluginScaffolderBackend","pluginSearch","pluginSearchBackend","pluginSearchBackendModulePg","pluginSearchBackendNode","pluginTechRadar","pluginTechdocs","pluginTechdocsBackend","pluginUserSettings","testUtils","theme","promisify","execCb","ora","recursive","resolvePath","relativePath","fs","dirname","basename","handlebars","findPaths","inquirer","os","program","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACO,MAAM,WAAW,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9B,IAAI,IAAI,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;AACnF,IAAI,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACnD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,GAAG;AACH,CAAC;;AC3ED,MAAM,IAAI,GAAG,CAAC,IAAI,KAAK;AACvB,EAAE0D,2BAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAACC,SAAO,CAAC,CAAC,WAAW,CAAC,wDAAwD,CAAC,CAAC,MAAM,CAAC,oBAAoB,EAAE,wEAAwE,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,0DAA0D,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1V,EAAED,2BAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC,CAAC;AACF,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,SAAS,KAAK;AAChD,EAAE,IAAI,SAAS,YAAY,KAAK,EAAE;AAClC,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;AAC7B,GAAG,MAAM;AACT,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,GAAG;AACH,CAAC,CAAC,CAAC;AACH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/lib/errors.ts","../src/lib/versions.ts","../src/lib/tasks.ts","../src/createApp.ts","../src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport chalk from 'chalk';\n\nexport class CustomError extends Error {\n get name(): string {\n return this.constructor.name;\n }\n}\n\nexport class ExitCodeError extends CustomError {\n readonly code: number;\n\n constructor(code: number, command?: string) {\n if (command) {\n super(`Command '${command}' exited with code ${code}`);\n } else {\n super(`Child exited with code ${code}`);\n }\n this.code = code;\n }\n}\n\nexport function exitWithError(error: Error): never {\n if (error instanceof ExitCodeError) {\n process.stderr.write(`\\n${chalk.red(error.message)}\\n\\n`);\n process.exit(error.code);\n } else {\n process.stderr.write(`\\n${chalk.red(`${error}`)}\\n\\n`);\n process.exit(1);\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable monorepo/no-relative-import */\n\n/*\nThis is a list of all packages used by the template. If dependencies are added or removed,\nthis list should be updated as well.\n\nThe list, and the accompanying peerDependencies entries, are here to ensure correct versioning\nand bumping of this package. Without this list the version would not be bumped unless we\nmanually trigger a release.\n\nThis does not create an actual dependency on these packages and does not bring in any code.\nRelative imports are used rather than package imports to make sure the packages aren't externalized.\nRollup will extract the value of the version field in each package at build time without\nleaving any imports in place.\n*/\n\nimport { version as root } from '../../../../package.json';\n\nimport { version as appDefaults } from '../../../app-defaults/package.json';\nimport { version as backendCommon } from '../../../backend-common/package.json';\nimport { version as backendTasks } from '../../../backend-tasks/package.json';\nimport { version as catalogClient } from '../../../catalog-client/package.json';\nimport { version as catalogModel } from '../../../catalog-model/package.json';\nimport { version as cli } from '../../../cli/package.json';\nimport { version as config } from '../../../config/package.json';\nimport { version as coreAppApi } from '../../../core-app-api/package.json';\nimport { version as coreComponents } from '../../../core-components/package.json';\nimport { version as corePluginApi } from '../../../core-plugin-api/package.json';\nimport { version as errors } from '../../../errors/package.json';\nimport { version as integrationReact } from '../../../integration-react/package.json';\nimport { version as testUtils } from '../../../test-utils/package.json';\nimport { version as theme } from '../../../theme/package.json';\n\nimport { version as pluginApiDocs } from '../../../../plugins/api-docs/package.json';\nimport { version as pluginAppBackend } from '../../../../plugins/app-backend/package.json';\nimport { version as pluginAuthBackend } from '../../../../plugins/auth-backend/package.json';\nimport { version as pluginCatalog } from '../../../../plugins/catalog/package.json';\nimport { version as pluginCatalogCommon } from '../../../../plugins/catalog-common/package.json';\nimport { version as pluginCatalogReact } from '../../../../plugins/catalog-react/package.json';\nimport { version as pluginCatalogBackend } from '../../../../plugins/catalog-backend/package.json';\nimport { version as pluginCatalogGraph } from '../../../../plugins/catalog-graph/package.json';\nimport { version as pluginCatalogImport } from '../../../../plugins/catalog-import/package.json';\nimport { version as pluginCircleci } from '../../../../plugins/circleci/package.json';\nimport { version as pluginExplore } from '../../../../plugins/explore/package.json';\nimport { version as pluginGithubActions } from '../../../../plugins/github-actions/package.json';\nimport { version as pluginLighthouse } from '../../../../plugins/lighthouse/package.json';\nimport { version as pluginOrg } from '../../../../plugins/org/package.json';\nimport { version as pluginPermissionCommon } from '../../../../plugins/permission-common/package.json';\nimport { version as pluginPermissionReact } from '../../../../plugins/permission-react/package.json';\nimport { version as pluginPermissionNode } from '../../../../plugins/permission-node/package.json';\nimport { version as pluginProxyBackend } from '../../../../plugins/proxy-backend/package.json';\nimport { version as pluginRollbarBackend } from '../../../../plugins/rollbar-backend/package.json';\nimport { version as pluginScaffolder } from '../../../../plugins/scaffolder/package.json';\nimport { version as pluginScaffolderBackend } from '../../../../plugins/scaffolder-backend/package.json';\nimport { version as pluginSearch } from '../../../../plugins/search/package.json';\nimport { version as pluginSearchReact } from '../../../../plugins/search-react/package.json';\nimport { version as pluginSearchBackend } from '../../../../plugins/search-backend/package.json';\nimport { version as pluginSearchBackendModulePg } from '../../../../plugins/search-backend-module-pg/package.json';\nimport { version as pluginSearchBackendNode } from '../../../../plugins/search-backend-node/package.json';\nimport { version as pluginTechRadar } from '../../../../plugins/tech-radar/package.json';\nimport { version as pluginTechdocs } from '../../../../plugins/techdocs/package.json';\nimport { version as pluginTechdocsBackend } from '../../../../plugins/techdocs-backend/package.json';\nimport { version as pluginUserSettings } from '../../../../plugins/user-settings/package.json';\n\nexport const packageVersions = {\n root,\n '@backstage/app-defaults': appDefaults,\n '@backstage/backend-common': backendCommon,\n '@backstage/backend-tasks': backendTasks,\n '@backstage/catalog-client': catalogClient,\n '@backstage/catalog-model': catalogModel,\n '@backstage/cli': cli,\n '@backstage/config': config,\n '@backstage/core-app-api': coreAppApi,\n '@backstage/core-components': coreComponents,\n '@backstage/core-plugin-api': corePluginApi,\n '@backstage/errors': errors,\n '@backstage/integration-react': integrationReact,\n '@backstage/plugin-api-docs': pluginApiDocs,\n '@backstage/plugin-app-backend': pluginAppBackend,\n '@backstage/plugin-auth-backend': pluginAuthBackend,\n '@backstage/plugin-catalog': pluginCatalog,\n '@backstage/plugin-catalog-common': pluginCatalogCommon,\n '@backstage/plugin-catalog-react': pluginCatalogReact,\n '@backstage/plugin-catalog-backend': pluginCatalogBackend,\n '@backstage/plugin-catalog-graph': pluginCatalogGraph,\n '@backstage/plugin-catalog-import': pluginCatalogImport,\n '@backstage/plugin-circleci': pluginCircleci,\n '@backstage/plugin-explore': pluginExplore,\n '@backstage/plugin-github-actions': pluginGithubActions,\n '@backstage/plugin-lighthouse': pluginLighthouse,\n '@backstage/plugin-org': pluginOrg,\n '@backstage/plugin-permission-common': pluginPermissionCommon,\n '@backstage/plugin-permission-node': pluginPermissionNode,\n '@backstage/plugin-permission-react': pluginPermissionReact,\n '@backstage/plugin-proxy-backend': pluginProxyBackend,\n '@backstage/plugin-rollbar-backend': pluginRollbarBackend,\n '@backstage/plugin-scaffolder': pluginScaffolder,\n '@backstage/plugin-scaffolder-backend': pluginScaffolderBackend,\n '@backstage/plugin-search': pluginSearch,\n '@backstage/plugin-search-react': pluginSearchReact,\n '@backstage/plugin-search-backend': pluginSearchBackend,\n '@backstage/plugin-search-backend-module-pg': pluginSearchBackendModulePg,\n '@backstage/plugin-search-backend-node': pluginSearchBackendNode,\n '@backstage/plugin-tech-radar': pluginTechRadar,\n '@backstage/plugin-techdocs': pluginTechdocs,\n '@backstage/plugin-techdocs-backend': pluginTechdocsBackend,\n '@backstage/plugin-user-settings': pluginUserSettings,\n '@backstage/test-utils': testUtils,\n '@backstage/theme': theme,\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport handlebars from 'handlebars';\nimport ora from 'ora';\nimport recursive from 'recursive-readdir';\nimport {\n basename,\n dirname,\n resolve as resolvePath,\n relative as relativePath,\n} from 'path';\nimport { exec as execCb } from 'child_process';\nimport { packageVersions } from './versions';\nimport { promisify } from 'util';\n\nconst TASK_NAME_MAX_LENGTH = 14;\nconst exec = promisify(execCb);\n\nexport class Task {\n static log(name: string = '') {\n process.stdout.write(`${chalk.green(name)}\\n`);\n }\n\n static error(message: string = '') {\n process.stdout.write(`\\n${chalk.red(message)}\\n\\n`);\n }\n\n static section(name: string) {\n const title = chalk.green(`${name}:`);\n process.stdout.write(`\\n ${title}\\n`);\n }\n\n static exit(code: number = 0) {\n process.exit(code);\n }\n\n static async forItem(\n task: string,\n item: string,\n taskFunc: () => Promise<void>,\n ): Promise<void> {\n const paddedTask = chalk.green(task.padEnd(TASK_NAME_MAX_LENGTH));\n\n const spinner = ora({\n prefixText: chalk.green(` ${paddedTask}${chalk.cyan(item)}`),\n spinner: 'arc',\n color: 'green',\n }).start();\n\n try {\n await taskFunc();\n spinner.succeed();\n } catch (error) {\n spinner.fail();\n throw error;\n }\n }\n}\n\n/**\n * Generate a templated backstage project\n *\n * @param templateDir - location containing template files\n * @param destinationDir - location to save templated project\n * @param context - template parameters\n */\nexport async function templatingTask(\n templateDir: string,\n destinationDir: string,\n context: any,\n) {\n const files = await recursive(templateDir).catch(error => {\n throw new Error(`Failed to read template directory: ${error.message}`);\n });\n\n for (const file of files) {\n const destinationFile = resolvePath(\n destinationDir,\n relativePath(templateDir, file),\n );\n await fs.ensureDir(dirname(destinationFile));\n\n if (file.endsWith('.hbs')) {\n await Task.forItem('templating', basename(file), async () => {\n const destination = destinationFile.replace(/\\.hbs$/, '');\n\n const template = await fs.readFile(file);\n const compiled = handlebars.compile(template.toString());\n const contents = compiled(\n { name: basename(destination), ...context },\n {\n helpers: {\n version(name: keyof typeof packageVersions) {\n if (name in packageVersions) {\n return packageVersions[name];\n }\n throw new Error(`No version available for package ${name}`);\n },\n },\n },\n );\n\n await fs.writeFile(destination, contents).catch(error => {\n throw new Error(\n `Failed to create file: ${destination}: ${error.message}`,\n );\n });\n });\n } else {\n await Task.forItem('copying', basename(file), async () => {\n await fs.copyFile(file, destinationFile).catch(error => {\n const destination = destinationFile;\n throw new Error(\n `Failed to copy file to ${destination} : ${error.message}`,\n );\n });\n });\n }\n }\n}\n\n/**\n * Verify that application target does not already exist\n *\n * @param rootDir - The directory to create application folder `name`\n * @param name - The specified name of the application\n * @Throws Error - If directory with name of `destination` already exists\n */\nexport async function checkAppExistsTask(rootDir: string, name: string) {\n await Task.forItem('checking', name, async () => {\n const destination = resolvePath(rootDir, name);\n\n if (await fs.pathExists(destination)) {\n const existing = chalk.cyan(destination.replace(`${rootDir}/`, ''));\n throw new Error(\n `A directory with the same name already exists: ${existing}\\nPlease try again with a different app name`,\n );\n }\n });\n}\n\n/**\n * Verify that application `path` exists, otherwise create the directory\n *\n * @param path - target to create directory\n * @throws if `path` is a file, or `fs.mkdir` fails\n */\nexport async function checkPathExistsTask(path: string) {\n await Task.forItem('checking', path, async () => {\n try {\n await fs.mkdirs(path);\n } catch (error) {\n // will fail if a file already exists at given `path`\n throw new Error(`Failed to create app directory: ${error.message}`);\n }\n });\n}\n\n/**\n * Create a folder to store templated files\n *\n * @param tempDir - target temporary directory\n * @throws if `fs.mkdir` fails\n */\nexport async function createTemporaryAppFolderTask(tempDir: string) {\n await Task.forItem('creating', 'temporary directory', async () => {\n try {\n await fs.mkdir(tempDir);\n } catch (error) {\n throw new Error(`Failed to create temporary app directory, ${error}`);\n }\n });\n}\n\n/**\n * Run `yarn install` and `run tsc` in application directory\n *\n * @param appDir - location of application to build\n */\nexport async function buildAppTask(appDir: string) {\n const runCmd = async (cmd: string) => {\n await Task.forItem('executing', cmd, async () => {\n process.chdir(appDir);\n await exec(cmd).catch(error => {\n process.stdout.write(error.stderr);\n process.stdout.write(error.stdout);\n throw new Error(`Could not execute command ${chalk.cyan(cmd)}`);\n });\n });\n };\n\n await runCmd('yarn install');\n await runCmd('yarn tsc');\n}\n\n/**\n * Move temporary directory to destination application folder\n *\n * @param tempDir - source path to copy files from\n * @param destination - target path to copy files\n * @param id - item ID\n * @throws if `fs.move` fails\n */\nexport async function moveAppTask(\n tempDir: string,\n destination: string,\n id: string,\n) {\n await Task.forItem('moving', id, async () => {\n await fs\n .move(tempDir, destination)\n .catch(error => {\n throw new Error(\n `Failed to move app from ${tempDir} to ${destination}: ${error.message}`,\n );\n })\n .finally(() => {\n // remove temporary files on both success and failure\n fs.removeSync(tempDir);\n });\n });\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport chalk from 'chalk';\nimport { OptionValues } from 'commander';\nimport inquirer, { Answers } from 'inquirer';\nimport { resolve as resolvePath } from 'path';\nimport { findPaths } from '@backstage/cli-common';\nimport os from 'os';\nimport {\n Task,\n buildAppTask,\n checkAppExistsTask,\n checkPathExistsTask,\n createTemporaryAppFolderTask,\n moveAppTask,\n templatingTask,\n} from './lib/tasks';\n\nexport default async (opts: OptionValues): Promise<void> => {\n /* eslint-disable-next-line no-restricted-syntax */\n const paths = findPaths(__dirname);\n\n const answers: Answers = await inquirer.prompt([\n {\n type: 'input',\n name: 'name',\n message: chalk.blue('Enter a name for the app [required]'),\n validate: (value: any) => {\n if (!value) {\n return chalk.red('Please enter a name for the app');\n } else if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(value)) {\n return chalk.red(\n 'App name must be lowercase and contain only letters, digits, and dashes.',\n );\n }\n return true;\n },\n },\n ]);\n\n const templateDir = paths.resolveOwn('templates/default-app');\n const tempDir = resolvePath(os.tmpdir(), answers.name);\n\n // Use `--path` argument as application directory when specified, otherwise\n // create a directory using `answers.name`\n const appDir = opts.path\n ? resolvePath(paths.targetDir, opts.path)\n : resolvePath(paths.targetDir, answers.name);\n\n Task.log();\n Task.log('Creating the app...');\n\n try {\n if (opts.path) {\n // Template directly to specified path\n\n Task.section('Checking that supplied path exists');\n await checkPathExistsTask(appDir);\n\n Task.section('Preparing files');\n await templatingTask(templateDir, opts.path, answers);\n } else {\n // Template to temporary location, and then move files\n\n Task.section('Checking if the directory is available');\n await checkAppExistsTask(paths.targetDir, answers.name);\n\n Task.section('Creating a temporary app directory');\n await createTemporaryAppFolderTask(tempDir);\n\n Task.section('Preparing files');\n await templatingTask(templateDir, tempDir, answers);\n\n Task.section('Moving to final location');\n await moveAppTask(tempDir, appDir, answers.name);\n }\n\n if (!opts.skipInstall) {\n Task.section('Building the app');\n await buildAppTask(appDir);\n }\n\n Task.log();\n Task.log(\n chalk.green(`🥇 Successfully created ${chalk.cyan(answers.name)}`),\n );\n Task.log();\n Task.section('All set! Now you might want to');\n Task.log(` Run the app: ${chalk.cyan(`cd ${answers.name} && yarn dev`)}`);\n Task.log(\n ' Set up the software catalog: https://backstage.io/docs/features/software-catalog/configuration',\n );\n Task.log(' Add authentication: https://backstage.io/docs/auth/');\n Task.log();\n Task.exit();\n } catch (error) {\n Task.error(String(error));\n\n Task.log('It seems that something went wrong when creating the app 🤔');\n\n Task.error('🔥 Failed to create app!');\n Task.exit(1);\n }\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A CLI that helps you create your own Backstage app\n *\n * @packageDocumentation\n */\n\nimport { program } from 'commander';\nimport { exitWithError } from './lib/errors';\nimport { version } from '../package.json';\nimport createApp from './createApp';\n\nconst main = (argv: string[]) => {\n program\n .name('backstage-create-app')\n .version(version)\n .description('Creates a new app in a new directory or specified path')\n .option(\n '--path [directory]',\n 'Location to store the app defaulting to a new folder with the app name',\n )\n .option(\n '--skip-install',\n 'Skip the install and builds steps after creating the app',\n )\n .action(cmd => createApp(cmd));\n\n program.parse(argv);\n};\n\nprocess.on('unhandledRejection', rejection => {\n if (rejection instanceof Error) {\n exitWithError(rejection);\n } else {\n exitWithError(new Error(`Unknown rejection: '${rejection}'`));\n }\n});\n\nmain(process.argv);\n"],"names":["chalk","root","appDefaults","backendCommon","backendTasks","catalogClient","catalogModel","cli","config","coreAppApi","coreComponents","corePluginApi","errors","integrationReact","pluginApiDocs","pluginAppBackend","pluginAuthBackend","pluginCatalog","pluginCatalogCommon","pluginCatalogReact","pluginCatalogBackend","pluginCatalogGraph","pluginCatalogImport","pluginCircleci","pluginExplore","pluginGithubActions","pluginLighthouse","pluginOrg","pluginPermissionCommon","pluginPermissionNode","pluginPermissionReact","pluginProxyBackend","pluginRollbarBackend","pluginScaffolder","pluginScaffolderBackend","pluginSearch","pluginSearchReact","pluginSearchBackend","pluginSearchBackendModulePg","pluginSearchBackendNode","pluginTechRadar","pluginTechdocs","pluginTechdocsBackend","pluginUserSettings","testUtils","theme","promisify","execCb","ora","recursive","resolvePath","relativePath","fs","dirname","basename","handlebars","findPaths","inquirer","os","program","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACO,MAAM,WAAW,SAAS,KAAK,CAAC;AACvC,EAAE,IAAI,IAAI,GAAG;AACb,IAAI,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;AACjC,GAAG;AACH,CAAC;AACM,MAAM,aAAa,SAAS,WAAW,CAAC;AAC/C,EAAE,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE;AAC7B,IAAI,IAAI,OAAO,GAAG,CAAC,GAAG,IAAI,KAAK;AAC/B,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AACrB,KAAK,CAAC;AACN,IAAI,IAAI,OAAO,EAAE;AACjB,MAAM,OAAO,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/D,KAAK,MAAM;AACX,MAAM,OAAO,CAAC,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAChD,KAAK;AACL,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,GAAG;AACH,CAAC;AACM,SAAS,aAAa,CAAC,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,CAAC;AAClE,GAAG;AACH,CAAC,CAAC,CAAC;AACH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;;"}
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.26-next.2",
4
+ "version": "0.4.27-next.1",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -35,8 +35,8 @@
35
35
  "dependencies": {
36
36
  "@backstage/cli-common": "^0.1.8",
37
37
  "chalk": "^4.0.0",
38
- "commander": "^6.1.0",
39
- "fs-extra": "10.0.1",
38
+ "commander": "^9.1.0",
39
+ "fs-extra": "10.1.0",
40
40
  "handlebars": "^4.7.3",
41
41
  "inquirer": "^8.2.0",
42
42
  "ora": "^5.3.0",
@@ -60,5 +60,5 @@
60
60
  "dist",
61
61
  "templates"
62
62
  ],
63
- "gitHead": "2eca57d93ef1081f4a76a19fc994a8e9e1a19e00"
63
+ "gitHead": "0b3df66a238c66a5498dab85b1ed85a8607289f1"
64
64
  }
@@ -3,3 +3,4 @@ node_modules
3
3
  packages
4
4
  !packages/backend/dist
5
5
  plugins
6
+ *.local.yaml
@@ -0,0 +1 @@
1
+ # Backstage override configuration for your local development environment
@@ -1,8 +1,34 @@
1
1
  app:
2
- # Should be the same as backend.baseUrl when using the `app-backend` plugin
2
+ # Should be the same as backend.baseUrl when using the `app-backend` plugin.
3
3
  baseUrl: http://localhost:7007
4
4
 
5
5
  backend:
6
+ # Note that the baseUrl should be the URL that the browser and other clients
7
+ # should use when communicating with the backend, i.e. it needs to be
8
+ # reachable not just from within the backend host, but from all of your
9
+ # callers. When its value is "http://localhost:7007", it's strictly private
10
+ # and can't be reached by others.
6
11
  baseUrl: http://localhost:7007
7
12
  listen:
8
13
  port: 7007
14
+ # The following host directive binds to all IPv4 interfaces when its value
15
+ # is "0.0.0.0". This is the most permissive setting. The right value depends
16
+ # on your specific deployment. If you remove the host line entirely, the
17
+ # backend will bind on the interface that corresponds to the backend.baseUrl
18
+ # hostname.
19
+ host: 0.0.0.0
20
+
21
+ # config options: https://node-postgres.com/api/client
22
+ database:
23
+ client: pg
24
+ connection:
25
+ host: ${POSTGRES_HOST}
26
+ port: ${POSTGRES_PORT}
27
+ user: ${POSTGRES_USER}
28
+ password: ${POSTGRES_PASSWORD}
29
+ # https://node-postgres.com/features/ssl
30
+ # you can set the sslmode configuration option via the `PGSSLMODE` environment variable
31
+ # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
32
+ # ssl:
33
+ # ca: # if you have a CA file and want to verify it you can uncomment this section
34
+ # $file: <file-path>/ca/server.crt
@@ -15,6 +15,9 @@ backend:
15
15
  baseUrl: http://localhost:7007
16
16
  listen:
17
17
  port: 7007
18
+ # Uncomment the following host directive to bind to all IPv4 interfaces and
19
+ # not just the baseUrl hostname.
20
+ # host: 0.0.0.0
18
21
  csp:
19
22
  connect-src: ["'self'", 'http:', 'https:']
20
23
  # Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
@@ -23,27 +26,11 @@ backend:
23
26
  origin: http://localhost:3000
24
27
  methods: [GET, POST, PUT, DELETE]
25
28
  credentials: true
26
- {{#if dbTypeSqlite}}
29
+ # This is for local developement only, it is not recommended to use this in production
30
+ # The production database configuration is stored in app-config.production.yaml
27
31
  database:
28
32
  client: better-sqlite3
29
33
  connection: ':memory:'
30
- {{/if}}
31
- {{#if dbTypePG}}
32
- # config options: https://node-postgres.com/api/client
33
- database:
34
- client: pg
35
- connection:
36
- host: ${POSTGRES_HOST}
37
- port: ${POSTGRES_PORT}
38
- user: ${POSTGRES_USER}
39
- password: ${POSTGRES_PASSWORD}
40
- # https://node-postgres.com/features/ssl
41
- # you can set the sslmode configuration option via the `PGSSLMODE` environment variable
42
- # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
43
- # ssl:
44
- # ca: # if you have a CA file and want to verify it you can uncomment this section
45
- # $file: <file-path>/ca/server.crt
46
- {{/if}}
47
34
  cache:
48
35
  store: memory
49
36
  # workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir
@@ -51,6 +38,8 @@ backend:
51
38
  integrations:
52
39
  github:
53
40
  - host: github.com
41
+ # This is a Personal Access Token or PAT from GitHub. You can find out how to generate this token, and more information
42
+ # about setting up the GitHub integration here: https://backstage.io/docs/getting-started/configuration#setting-up-a-github-integration
54
43
  token: ${GITHUB_TOKEN}
55
44
  ### Example for how to add your GitHub Enterprise instance using the API:
56
45
  # - host: ghe.example.net
@@ -35,7 +35,7 @@
35
35
  "concurrently": "^6.0.0",
36
36
  "lerna": "^4.0.0",
37
37
  "prettier": "^2.3.2",
38
- "typescript": "~4.5.4"
38
+ "typescript": "~4.6.4"
39
39
  },
40
40
  "resolutions": {
41
41
  "@types/react": "^17",
@@ -25,6 +25,7 @@
25
25
  "@backstage/plugin-permission-react": "^{{version '@backstage/plugin-permission-react'}}",
26
26
  "@backstage/plugin-scaffolder": "^{{version '@backstage/plugin-scaffolder'}}",
27
27
  "@backstage/plugin-search": "^{{version '@backstage/plugin-search'}}",
28
+ "@backstage/plugin-search-react": "^{{version '@backstage/plugin-search-react'}}",
28
29
  "@backstage/plugin-tech-radar": "^{{version '@backstage/plugin-tech-radar'}}",
29
30
  "@backstage/plugin-techdocs": "^{{version '@backstage/plugin-techdocs'}}",
30
31
  "@backstage/plugin-user-settings": "^{{version '@backstage/plugin-user-settings'}}",
@@ -14,8 +14,8 @@ import {
14
14
  SearchResult,
15
15
  SearchType,
16
16
  DefaultResultListItem,
17
- useSearch,
18
17
  } from '@backstage/plugin-search';
18
+ import { useSearch } from '@backstage/plugin-search-react';
19
19
  import {
20
20
  CatalogIcon,
21
21
  Content,
@@ -13,22 +13,22 @@ FROM node:16-bullseye-slim
13
13
 
14
14
  WORKDIR /app
15
15
 
16
+ # install sqlite3 dependencies, you can skip this if you don't use sqlite3 in the image
17
+ RUN apt-get update && \
18
+ apt-get install -y --no-install-recommends libsqlite3-dev python3 build-essential && \
19
+ rm -rf /var/lib/apt/lists/* && \
20
+ yarn config set python /usr/bin/python3
21
+
16
22
  # Copy repo skeleton first, to avoid unnecessary docker cache invalidation.
17
23
  # The skeleton contains the package.json of each package in the monorepo,
18
24
  # and along with yarn.lock and the root package.json, that's enough to run yarn install.
19
25
  COPY yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
20
26
  RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
21
27
 
22
- # install sqlite3 dependencies
23
- RUN apt-get update && \
24
- apt-get install -y libsqlite3-dev python3 cmake g++ && \
25
- rm -rf /var/lib/apt/lists/* && \
26
- yarn config set python /usr/bin/python3
27
-
28
28
  RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
29
29
 
30
30
  # Then copy the rest of the backend bundle, along with any other files we might want.
31
- COPY packages/backend/dist/bundle.tar.gz app-config.yaml ./
31
+ COPY packages/backend/dist/bundle.tar.gz app-config*.yaml ./
32
32
  RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
33
33
 
34
- CMD ["node", "packages/backend", "--config", "app-config.yaml"]
34
+ CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
@@ -30,29 +30,23 @@
30
30
  "@backstage/plugin-proxy-backend": "^{{version '@backstage/plugin-proxy-backend'}}",
31
31
  "@backstage/plugin-scaffolder-backend": "^{{version '@backstage/plugin-scaffolder-backend'}}",
32
32
  "@backstage/plugin-search-backend": "^{{version '@backstage/plugin-search-backend'}}",
33
- {{#if dbTypePG}}
34
33
  "@backstage/plugin-search-backend-module-pg": "^{{version '@backstage/plugin-search-backend-module-pg'}}",
35
- {{/if}}
36
34
  "@backstage/plugin-search-backend-node": "^{{version '@backstage/plugin-search-backend-node'}}",
37
35
  "@backstage/plugin-techdocs-backend": "^{{version '@backstage/plugin-techdocs-backend'}}",
38
36
  "dockerode": "^3.3.1",
39
37
  "express": "^4.17.1",
40
38
  "express-promise-router": "^4.1.0",
41
39
  "luxon": "^2.0.2",
42
- {{#if dbTypePG}}
43
40
  "pg": "^8.3.0",
44
- {{/if}}
45
- {{#if dbTypeSqlite}}
46
- "better-sqlite3": "^7.5.0",
47
- {{/if}}
48
41
  "winston": "^3.2.1"
49
42
  },
50
43
  "devDependencies": {
51
44
  "@backstage/cli": "^{{version '@backstage/cli'}}",
52
45
  "@types/dockerode": "^3.3.0",
53
- "@types/express": "^4.17.6",
54
46
  "@types/express-serve-static-core": "^4.17.5",
55
- "@types/luxon": "^2.0.4"
47
+ "@types/express": "^4.17.6",
48
+ "@types/luxon": "^2.0.4",
49
+ "better-sqlite3": "^7.5.0"
56
50
  },
57
51
  "files": [
58
52
  "dist"
@@ -1,4 +1,8 @@
1
- import { createRouter } from '@backstage/plugin-auth-backend';
1
+ import {
2
+ createRouter,
3
+ providers,
4
+ defaultAuthProviderFactories,
5
+ } from '@backstage/plugin-auth-backend';
2
6
  import { Router } from 'express';
3
7
  import { PluginEnvironment } from '../types';
4
8
 
@@ -11,5 +15,22 @@ export default async function createPlugin(
11
15
  database: env.database,
12
16
  discovery: env.discovery,
13
17
  tokenManager: env.tokenManager,
18
+ providerFactories: {
19
+ ...defaultAuthProviderFactories,
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:
27
+ //
28
+ // https://backstage.io/docs/auth/identity-resolver
29
+ github: providers.github.create({
30
+ // signIn: {
31
+ // resolver: providers.github.resolvers.usernameMatchingUserEntityName(),
32
+ // },
33
+ }),
34
+ },
14
35
  });
15
36
  }
@@ -4,9 +4,6 @@ import {
4
4
  IndexBuilder,
5
5
  LunrSearchEngine,
6
6
  } from '@backstage/plugin-search-backend-node';
7
- {{#if dbTypePG}}
8
- import { PgSearchEngine } from '@backstage/plugin-search-backend-module-pg';
9
- {{/if}}
10
7
  import { PluginEnvironment } from '../types';
11
8
  import { DefaultCatalogCollatorFactory } from '@backstage/plugin-catalog-backend';
12
9
  import { DefaultTechDocsCollatorFactory } from '@backstage/plugin-techdocs-backend';
@@ -17,16 +14,9 @@ export default async function createPlugin(
17
14
  env: PluginEnvironment,
18
15
  ): Promise<Router> {
19
16
  // Initialize a connection to a search engine.
20
- {{#if dbTypeSqlite}}
21
17
  const searchEngine = new LunrSearchEngine({
22
18
  logger: env.logger,
23
19
  });
24
- {{/if}}
25
- {{#if dbTypePG}}
26
- const searchEngine = (await PgSearchEngine.supported(env.database))
27
- ? await PgSearchEngine.from({ database: env.database })
28
- : new LunrSearchEngine({ logger: env.logger });
29
- {{/if}}
30
20
  const indexBuilder = new IndexBuilder({
31
21
  logger: env.logger,
32
22
  searchEngine,