@backstage/cli 0.18.0 → 0.18.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 +23 -0
- package/config/eslint-factory.js +1 -1
- package/dist/cjs/{Lockfile-48dc675e.cjs.js → Lockfile-72b7072e.cjs.js} +25 -9
- package/dist/cjs/{PackageGraph-1d7b086a.cjs.js → PackageGraph-7ea22294.cjs.js} +17 -9
- package/dist/cjs/{build-52ba70a2.cjs.js → build-688edcd3.cjs.js} +26 -15
- package/dist/cjs/{buildBackend-55985c84.cjs.js → buildBackend-ac6c633b.cjs.js} +61 -36
- package/dist/cjs/{buildWorkspace-d663903d.cjs.js → buildWorkspace-76f958f0.cjs.js} +7 -7
- package/dist/cjs/{bump-1a3769e9.cjs.js → bump-db89c0f3.cjs.js} +88 -33
- package/dist/cjs/{clean-9a8c294a.cjs.js → clean-68c34bfd.cjs.js} +2 -2
- package/dist/cjs/{config-de1bf46a.cjs.js → config-9d64a562.cjs.js} +15 -11
- package/dist/cjs/{create-b0ca2add.cjs.js → create-94a20b19.cjs.js} +80 -32
- package/dist/cjs/{createDistWorkspace-fc94c796.cjs.js → createDistWorkspace-0412df70.cjs.js} +137 -65
- package/dist/cjs/{createPlugin-4d7e1b01.cjs.js → createPlugin-02079f81.cjs.js} +69 -30
- package/dist/cjs/{diff-a561bee3.cjs.js → diff-f68eaf29.cjs.js} +68 -16
- package/dist/cjs/{docs-bd70b38e.cjs.js → docs-1527b730.cjs.js} +9 -5
- package/dist/cjs/{fix-47eb8dc4.cjs.js → fix-56a6d092.cjs.js} +17 -7
- package/dist/cjs/{index-27d57881.cjs.js → index-025feb83.cjs.js} +10 -10
- package/dist/cjs/{index-bb24147b.cjs.js → index-16fe1d27.cjs.js} +39 -12
- package/dist/cjs/{index-4f4a8498.cjs.js → index-4f8f2562.cjs.js} +58 -38
- package/dist/cjs/{index-7e13cc9d.cjs.js → index-b7ce30d9.cjs.js} +151 -50
- package/dist/cjs/{info-29f0ee36.cjs.js → info-88431720.cjs.js} +20 -6
- package/dist/cjs/{install-fea0e3f5.cjs.js → install-4d423030.cjs.js} +44 -17
- package/dist/cjs/{lint-0db8937c.cjs.js → lint-2fd53d5f.cjs.js} +4 -4
- package/dist/cjs/{lint-81a75364.cjs.js → lint-bd7b9e13.cjs.js} +37 -11
- package/dist/cjs/{lint-1711bbbb.cjs.js → lint-da011116.cjs.js} +5 -3
- package/dist/cjs/{list-deprecations-cea8fad3.cjs.js → list-deprecations-268e1d6b.cjs.js} +3 -3
- package/dist/cjs/{pack-8ab429c0.cjs.js → pack-ce12d4b7.cjs.js} +17 -11
- package/dist/cjs/packageLintConfigs-9f3b0766.cjs.js +83 -0
- package/dist/cjs/packageRole-582e0558.cjs.js +59 -0
- package/dist/cjs/{packageRoles-a310f84c.cjs.js → packageRoles-fec3121b.cjs.js} +5 -3
- package/dist/cjs/packageScripts-04ac9bc2.cjs.js +98 -0
- package/dist/cjs/{packages-ea5c38ec.cjs.js → packages-24759dcb.cjs.js} +17 -12
- package/dist/cjs/parallel-a8f6219c.cjs.js +187 -0
- package/dist/cjs/{paths-d98c9d0c.cjs.js → paths-13d8625f.cjs.js} +102 -57
- package/dist/cjs/{print-4cbe70e7.cjs.js → print-58fe18ba.cjs.js} +4 -4
- package/dist/cjs/{run-5e05ba2c.cjs.js → run-f4586ef6.cjs.js} +2 -2
- package/dist/cjs/{schema-2c842cbe.cjs.js → schema-65c31be1.cjs.js} +9 -5
- package/dist/cjs/{tasks-b054c9ce.cjs.js → tasks-16da761b.cjs.js} +29 -12
- package/dist/cjs/{test-b5969f53.cjs.js → test-464a46fe.cjs.js} +3 -3
- package/dist/cjs/{validate-8a03d402.cjs.js → validate-3231ba7d.cjs.js} +4 -4
- package/dist/index.cjs.js +1 -1
- package/package.json +12 -12
- package/dist/cjs/packageLintConfigs-77b71b79.cjs.js +0 -74
- package/dist/cjs/packageRole-d1e7c7d6.cjs.js +0 -53
- package/dist/cjs/packageScripts-6731503e.cjs.js +0 -96
- package/dist/cjs/parallel-8286d3fa.cjs.js +0 -171
|
@@ -20,7 +20,9 @@ class CustomError extends Error {
|
|
|
20
20
|
}
|
|
21
21
|
class ExitCodeError extends CustomError {
|
|
22
22
|
constructor(code, command) {
|
|
23
|
-
super(
|
|
23
|
+
super(
|
|
24
|
+
command ? `Command '${command}' exited with code ${code}` : `Child exited with code ${code}`
|
|
25
|
+
);
|
|
24
26
|
this.code = code;
|
|
25
27
|
}
|
|
26
28
|
}
|
|
@@ -44,9 +46,9 @@ class NotFoundError extends CustomError {
|
|
|
44
46
|
|
|
45
47
|
const paths = cliCommon.findPaths(__dirname);
|
|
46
48
|
|
|
47
|
-
var version$a = "0.
|
|
49
|
+
var version$a = "0.15.0";
|
|
48
50
|
|
|
49
|
-
var version$9 = "0.18.
|
|
51
|
+
var version$9 = "0.18.1";
|
|
50
52
|
var dependencies = {
|
|
51
53
|
"@backstage/cli-common": "^0.1.9",
|
|
52
54
|
"@backstage/config": "^1.0.1",
|
|
@@ -67,10 +69,10 @@ var dependencies = {
|
|
|
67
69
|
"@spotify/eslint-config-typescript": "^14.0.0",
|
|
68
70
|
"@sucrase/jest-plugin": "^2.1.1",
|
|
69
71
|
"@sucrase/webpack-loader": "^2.0.0",
|
|
70
|
-
"@svgr/plugin-jsx": "6.
|
|
71
|
-
"@svgr/plugin-svgo": "6.
|
|
72
|
-
"@svgr/rollup": "6.
|
|
73
|
-
"@svgr/webpack": "6.
|
|
72
|
+
"@svgr/plugin-jsx": "6.3.x",
|
|
73
|
+
"@svgr/plugin-svgo": "6.3.x",
|
|
74
|
+
"@svgr/rollup": "6.3.x",
|
|
75
|
+
"@svgr/webpack": "6.3.x",
|
|
74
76
|
"@types/webpack-env": "^1.15.2",
|
|
75
77
|
"@typescript-eslint/eslint-plugin": "^5.9.0",
|
|
76
78
|
"@typescript-eslint/parser": "^5.9.0",
|
|
@@ -143,13 +145,13 @@ var dependencies = {
|
|
|
143
145
|
zod: "^3.11.6"
|
|
144
146
|
};
|
|
145
147
|
var devDependencies = {
|
|
146
|
-
"@backstage/backend-common": "^0.
|
|
148
|
+
"@backstage/backend-common": "^0.15.0",
|
|
147
149
|
"@backstage/config": "^1.0.1",
|
|
148
|
-
"@backstage/core-app-api": "^1.0.
|
|
149
|
-
"@backstage/core-components": "^0.
|
|
150
|
-
"@backstage/core-plugin-api": "^1.0.
|
|
151
|
-
"@backstage/dev-utils": "^1.0.
|
|
152
|
-
"@backstage/test-utils": "^1.1.
|
|
150
|
+
"@backstage/core-app-api": "^1.0.5",
|
|
151
|
+
"@backstage/core-components": "^0.11.0",
|
|
152
|
+
"@backstage/core-plugin-api": "^1.0.5",
|
|
153
|
+
"@backstage/dev-utils": "^1.0.5",
|
|
154
|
+
"@backstage/test-utils": "^1.1.3",
|
|
153
155
|
"@backstage/theme": "^0.2.16",
|
|
154
156
|
"@types/diff": "^5.0.0",
|
|
155
157
|
"@types/express": "^4.17.6",
|
|
@@ -176,19 +178,19 @@ var devDependencies = {
|
|
|
176
178
|
|
|
177
179
|
var version$8 = "1.0.1";
|
|
178
180
|
|
|
179
|
-
var version$7 = "1.0.
|
|
181
|
+
var version$7 = "1.0.5";
|
|
180
182
|
|
|
181
|
-
var version$6 = "0.
|
|
183
|
+
var version$6 = "0.11.0";
|
|
182
184
|
|
|
183
|
-
var version$5 = "1.0.
|
|
185
|
+
var version$5 = "1.0.5";
|
|
184
186
|
|
|
185
|
-
var version$4 = "1.0.
|
|
187
|
+
var version$4 = "1.0.5";
|
|
186
188
|
|
|
187
|
-
var version$3 = "1.1.
|
|
189
|
+
var version$3 = "1.1.3";
|
|
188
190
|
|
|
189
191
|
var version$2 = "0.2.16";
|
|
190
192
|
|
|
191
|
-
var version$1 = "1.
|
|
193
|
+
var version$1 = "1.5.0";
|
|
192
194
|
|
|
193
195
|
const packageVersions = {
|
|
194
196
|
"@backstage/backend-common": version$a,
|
|
@@ -220,7 +222,9 @@ function createPackageVersionProvider(lockfile) {
|
|
|
220
222
|
if (name.startsWith("@types/") && (lockfileEntries == null ? void 0 : lockfileEntries.some((entry) => entry.range === "*"))) {
|
|
221
223
|
return "*";
|
|
222
224
|
}
|
|
223
|
-
const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter(
|
|
225
|
+
const validRanges = lockfileEntries == null ? void 0 : lockfileEntries.filter(
|
|
226
|
+
(entry) => semver__default["default"].satisfies(targetVersion, entry.range)
|
|
227
|
+
);
|
|
224
228
|
const highestRange = validRanges == null ? void 0 : validRanges.slice(-1)[0];
|
|
225
229
|
if (highestRange == null ? void 0 : highestRange.range) {
|
|
226
230
|
return highestRange == null ? void 0 : highestRange.range;
|
|
@@ -243,46 +247,143 @@ const configOption = [
|
|
|
243
247
|
];
|
|
244
248
|
function registerRepoCommand(program) {
|
|
245
249
|
const command = program.command("repo [command]").description("Command that run across an entire Backstage project");
|
|
246
|
-
command.command("build").description(
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
command.command("build").description(
|
|
251
|
+
"Build packages in the project, excluding bundled app and backend packages."
|
|
252
|
+
).option(
|
|
253
|
+
"--all",
|
|
254
|
+
"Build all packages, including bundled app and backend packages."
|
|
255
|
+
).option(
|
|
256
|
+
"--since <ref>",
|
|
257
|
+
"Only build packages and their dev dependents that changed since the specified ref"
|
|
258
|
+
).action(lazy(() => Promise.resolve().then(function () { return require('./build-688edcd3.cjs.js'); }).then((m) => m.command)));
|
|
259
|
+
command.command("lint").description("Lint all packages in the project").option(
|
|
260
|
+
"--format <format>",
|
|
261
|
+
"Lint report output format",
|
|
262
|
+
"eslint-formatter-friendly"
|
|
263
|
+
).option(
|
|
264
|
+
"--since <ref>",
|
|
265
|
+
"Only lint packages that changed since the specified ref"
|
|
266
|
+
).option("--fix", "Attempt to automatically fix violations").action(lazy(() => Promise.resolve().then(function () { return require('./lint-2fd53d5f.cjs.js'); }).then((m) => m.command)));
|
|
267
|
+
command.command("list-deprecations", { hidden: true }).description("List deprecations. [EXPERIMENTAL]").option("--json", "Output as JSON").action(
|
|
268
|
+
lazy(() => Promise.resolve().then(function () { return require('./list-deprecations-268e1d6b.cjs.js'); }).then((m) => m.command))
|
|
269
|
+
);
|
|
249
270
|
}
|
|
250
271
|
function registerScriptCommand(program) {
|
|
251
272
|
const command = program.command("package [command]").description("Lifecycle scripts for individual packages");
|
|
252
|
-
command.command("start").description("Start a package for local development").option(...configOption).option("--role <name>", "Run the command with an explicit package role").option("--check", "Enable type checking and linting if available").option("--inspect", "Enable debugger in Node.js environments").option(
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
command.command("
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
273
|
+
command.command("start").description("Start a package for local development").option(...configOption).option("--role <name>", "Run the command with an explicit package role").option("--check", "Enable type checking and linting if available").option("--inspect", "Enable debugger in Node.js environments").option(
|
|
274
|
+
"--inspect-brk",
|
|
275
|
+
"Enable debugger in Node.js environments, breaking before code starts"
|
|
276
|
+
).action(lazy(() => Promise.resolve().then(function () { return require('./index-4f8f2562.cjs.js'); }).then((m) => m.command)));
|
|
277
|
+
command.command("build").description("Build a package for production deployment or publishing").option("--role <name>", "Run the command with an explicit package role").option(
|
|
278
|
+
"--minify",
|
|
279
|
+
"Minify the generated code. Does not apply to app or backend packages."
|
|
280
|
+
).option(
|
|
281
|
+
"--experimental-type-build",
|
|
282
|
+
"Enable experimental type build. Does not apply to app or backend packages."
|
|
283
|
+
).option(
|
|
284
|
+
"--skip-build-dependencies",
|
|
285
|
+
"Skip the automatic building of local dependencies. Applies to backend packages only."
|
|
286
|
+
).option(
|
|
287
|
+
"--stats",
|
|
288
|
+
"If bundle stats are available, write them to the output directory. Applies to app packages only."
|
|
289
|
+
).option(
|
|
290
|
+
"--config <path>",
|
|
291
|
+
"Config files to load instead of app-config.yaml. Applies to app packages only.",
|
|
292
|
+
(opt, opts) => opts ? [...opts, opt] : [opt],
|
|
293
|
+
Array()
|
|
294
|
+
).action(lazy(() => Promise.resolve().then(function () { return require('./index-025feb83.cjs.js'); }).then((m) => m.command)));
|
|
295
|
+
command.command("lint [directories...]").option(
|
|
296
|
+
"--format <format>",
|
|
297
|
+
"Lint report output format",
|
|
298
|
+
"eslint-formatter-friendly"
|
|
299
|
+
).option("--fix", "Attempt to automatically fix violations").description("Lint a package").action(lazy(() => Promise.resolve().then(function () { return require('./lint-da011116.cjs.js'); }).then((m) => m.default)));
|
|
300
|
+
command.command("test").allowUnknownOption(true).helpOption(", --backstage-cli-help").description("Run tests, forwarding args to Jest, defaulting to watch mode").action(lazy(() => Promise.resolve().then(function () { return require('./test-464a46fe.cjs.js'); }).then((m) => m.default)));
|
|
301
|
+
command.command("fix", { hidden: true }).description("Applies automated fixes to the package. [EXPERIMENTAL]").option("--deps", "Only fix monorepo dependencies in package.json").action(lazy(() => Promise.resolve().then(function () { return require('./fix-56a6d092.cjs.js'); }).then((m) => m.command)));
|
|
302
|
+
command.command("clean").description("Delete cache directories").action(lazy(() => Promise.resolve().then(function () { return require('./clean-68c34bfd.cjs.js'); }).then((m) => m.default)));
|
|
303
|
+
command.command("prepack").description("Prepares a package for packaging before publishing").action(lazy(() => Promise.resolve().then(function () { return require('./pack-ce12d4b7.cjs.js'); }).then((m) => m.pre)));
|
|
304
|
+
command.command("postpack").description("Restores the changes made by the prepack command").action(lazy(() => Promise.resolve().then(function () { return require('./pack-ce12d4b7.cjs.js'); }).then((m) => m.post)));
|
|
260
305
|
}
|
|
261
306
|
function registerMigrateCommand(program) {
|
|
262
307
|
const command = program.command("migrate [command]").description("Migration utilities");
|
|
263
|
-
command.command("package-roles").description(`Add package role field to packages that don't have it`).action(lazy(() => Promise.resolve().then(function () { return require('./packageRole-
|
|
264
|
-
command.command("package-scripts").description("Set package scripts according to each package role").action(
|
|
265
|
-
|
|
308
|
+
command.command("package-roles").description(`Add package role field to packages that don't have it`).action(lazy(() => Promise.resolve().then(function () { return require('./packageRole-582e0558.cjs.js'); }).then((m) => m.default)));
|
|
309
|
+
command.command("package-scripts").description("Set package scripts according to each package role").action(
|
|
310
|
+
lazy(() => Promise.resolve().then(function () { return require('./packageScripts-04ac9bc2.cjs.js'); }).then((m) => m.command))
|
|
311
|
+
);
|
|
312
|
+
command.command("package-lint-configs").description(
|
|
313
|
+
"Migrates all packages to use @backstage/cli/config/eslint-factory"
|
|
314
|
+
).action(
|
|
315
|
+
lazy(() => Promise.resolve().then(function () { return require('./packageLintConfigs-9f3b0766.cjs.js'); }).then((m) => m.command))
|
|
316
|
+
);
|
|
266
317
|
}
|
|
267
318
|
function registerCommands(program) {
|
|
268
|
-
program.command("create").storeOptionsAsProperties(false).description(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
319
|
+
program.command("create").storeOptionsAsProperties(false).description(
|
|
320
|
+
"Open up an interactive guide to creating new things in your app"
|
|
321
|
+
).option(
|
|
322
|
+
"--select <name>",
|
|
323
|
+
"Select the thing you want to be creating upfront"
|
|
324
|
+
).option(
|
|
325
|
+
"--option <name>=<value>",
|
|
326
|
+
"Pre-fill options for the creation process",
|
|
327
|
+
(opt, arr) => [...arr, opt],
|
|
328
|
+
[]
|
|
329
|
+
).option("--scope <scope>", "The scope to use for new packages").option(
|
|
330
|
+
"--npm-registry <URL>",
|
|
331
|
+
"The package registry to use for new packages"
|
|
332
|
+
).option("--no-private", "Do not mark new packages as private").action(lazy(() => Promise.resolve().then(function () { return require('./create-94a20b19.cjs.js'); }).then((m) => m.default)));
|
|
333
|
+
program.command("create-plugin").option(
|
|
334
|
+
"--backend",
|
|
335
|
+
"Create plugin with the backend dependencies as default"
|
|
336
|
+
).description("Creates a new plugin in the current repository").option("--scope <scope>", "npm scope").option("--npm-registry <URL>", "npm registry URL").option("--no-private", "Public npm package").action(
|
|
337
|
+
lazy(() => Promise.resolve().then(function () { return require('./createPlugin-02079f81.cjs.js'); }).then((m) => m.default))
|
|
338
|
+
);
|
|
339
|
+
program.command("plugin:diff").option("--check", "Fail if changes are required").option("--yes", "Apply all changes").description("Diff an existing plugin with the creation template").action(lazy(() => Promise.resolve().then(function () { return require('./diff-f68eaf29.cjs.js'); }).then((m) => m.default)));
|
|
340
|
+
program.command("test").allowUnknownOption(true).helpOption(", --backstage-cli-help").description(
|
|
341
|
+
"Run tests, forwarding args to Jest, defaulting to watch mode [DEPRECATED]"
|
|
342
|
+
).action(lazy(() => Promise.resolve().then(function () { return require('./test-464a46fe.cjs.js'); }).then((m) => m.default)));
|
|
343
|
+
program.command("config:docs").option(
|
|
344
|
+
"--package <name>",
|
|
345
|
+
"Only include the schema that applies to the given package"
|
|
346
|
+
).description("Browse the configuration reference documentation").action(lazy(() => Promise.resolve().then(function () { return require('./docs-1527b730.cjs.js'); }).then((m) => m.default)));
|
|
347
|
+
program.command("config:print").option(
|
|
348
|
+
"--package <name>",
|
|
349
|
+
"Only load config schema that applies to the given package"
|
|
350
|
+
).option("--lax", "Do not require environment variables to be set").option("--frontend", "Print only the frontend configuration").option("--with-secrets", "Include secrets in the printed configuration").option(
|
|
351
|
+
"--format <format>",
|
|
352
|
+
"Format to print the configuration in, either json or yaml [yaml]"
|
|
353
|
+
).option(...configOption).description("Print the app configuration for the current package").action(lazy(() => Promise.resolve().then(function () { return require('./print-58fe18ba.cjs.js'); }).then((m) => m.default)));
|
|
354
|
+
program.command("config:check").option(
|
|
355
|
+
"--package <name>",
|
|
356
|
+
"Only load config schema that applies to the given package"
|
|
357
|
+
).option("--lax", "Do not require environment variables to be set").option("--frontend", "Only validate the frontend configuration").option("--deprecated", "Output deprecated configuration settings").option(...configOption).description(
|
|
358
|
+
"Validate that the given configuration loads and matches schema"
|
|
359
|
+
).action(lazy(() => Promise.resolve().then(function () { return require('./validate-3231ba7d.cjs.js'); }).then((m) => m.default)));
|
|
360
|
+
program.command("config:schema").option(
|
|
361
|
+
"--package <name>",
|
|
362
|
+
"Only output config schema that applies to the given package"
|
|
363
|
+
).option(
|
|
364
|
+
"--format <format>",
|
|
365
|
+
"Format to print the schema in, either json or yaml [yaml]"
|
|
366
|
+
).description("Print configuration schema").action(lazy(() => Promise.resolve().then(function () { return require('./schema-65c31be1.cjs.js'); }).then((m) => m.default)));
|
|
276
367
|
registerRepoCommand(program);
|
|
277
368
|
registerScriptCommand(program);
|
|
278
369
|
registerMigrateCommand(program);
|
|
279
|
-
program.command("versions:bump").option(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
370
|
+
program.command("versions:bump").option(
|
|
371
|
+
"--pattern <glob>",
|
|
372
|
+
"Override glob for matching packages to upgrade"
|
|
373
|
+
).option(
|
|
374
|
+
"--release <version|next|main>",
|
|
375
|
+
"Bump to a specific Backstage release line or version",
|
|
376
|
+
"main"
|
|
377
|
+
).description("Bump Backstage packages to the latest versions").action(lazy(() => Promise.resolve().then(function () { return require('./bump-db89c0f3.cjs.js'); }).then((m) => m.default)));
|
|
378
|
+
program.command("versions:check").option("--fix", "Fix any auto-fixable versioning problems").description("Check Backstage package versioning").action(lazy(() => Promise.resolve().then(function () { return require('./lint-bd7b9e13.cjs.js'); }).then((m) => m.default)));
|
|
379
|
+
program.command("clean").description("Delete cache directories [DEPRECATED]").action(lazy(() => Promise.resolve().then(function () { return require('./clean-68c34bfd.cjs.js'); }).then((m) => m.default)));
|
|
380
|
+
program.command("build-workspace <workspace-dir> [packages...]").description("Builds a temporary dist workspace from the provided packages").action(lazy(() => Promise.resolve().then(function () { return require('./buildWorkspace-76f958f0.cjs.js'); }).then((m) => m.default)));
|
|
381
|
+
program.command("create-github-app <github-org>").description("Create new GitHub App in your organization.").action(lazy(() => Promise.resolve().then(function () { return require('./index-16fe1d27.cjs.js'); }).then((m) => m.default)));
|
|
382
|
+
program.command("info").description("Show helpful information for debugging and reporting bugs").action(lazy(() => Promise.resolve().then(function () { return require('./info-88431720.cjs.js'); }).then((m) => m.default)));
|
|
383
|
+
program.command("install [plugin-id]", { hidden: true }).option(
|
|
384
|
+
"--from <packageJsonFilePath>",
|
|
385
|
+
"Install from a local package.json containing the installation recipe"
|
|
386
|
+
).description("Install a Backstage plugin [EXPERIMENTAL]").action(lazy(() => Promise.resolve().then(function () { return require('./install-4d423030.cjs.js'); }).then((m) => m.default)));
|
|
286
387
|
}
|
|
287
388
|
function lazy(getActionFunc) {
|
|
288
389
|
return async (...args) => {
|
|
@@ -326,4 +427,4 @@ exports.devDependencies = devDependencies;
|
|
|
326
427
|
exports.paths = paths;
|
|
327
428
|
exports.version = version;
|
|
328
429
|
exports.version$1 = version$9;
|
|
329
|
-
//# sourceMappingURL=index-
|
|
430
|
+
//# sourceMappingURL=index-b7ce30d9.cjs.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-b7ce30d9.cjs.js');
|
|
4
4
|
var os = require('os');
|
|
5
|
-
var run = require('./run-
|
|
6
|
-
var Lockfile = require('./Lockfile-
|
|
5
|
+
var run = require('./run-f4586ef6.cjs.js');
|
|
6
|
+
var Lockfile = require('./Lockfile-72b7072e.cjs.js');
|
|
7
7
|
require('minimatch');
|
|
8
8
|
require('@manypkg/get-packages');
|
|
9
9
|
require('chalk');
|
|
10
|
+
var fs = require('fs-extra');
|
|
10
11
|
require('commander');
|
|
11
|
-
require('fs-extra');
|
|
12
12
|
require('semver');
|
|
13
13
|
require('@backstage/cli-common');
|
|
14
14
|
require('@backstage/errors');
|
|
@@ -20,15 +20,29 @@ require('@yarnpkg/lockfile');
|
|
|
20
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
21
|
|
|
22
22
|
var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
|
|
23
|
+
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
23
24
|
|
|
24
25
|
var info = async () => {
|
|
25
26
|
await new Promise(async () => {
|
|
27
|
+
var _a;
|
|
26
28
|
const yarnVersion = await run.runPlain("yarn --version");
|
|
27
|
-
const isLocal =
|
|
29
|
+
const isLocal = fs__default["default"].existsSync(index.paths.resolveOwn("./src"));
|
|
30
|
+
const backstageFile = index.paths.resolveTargetRoot("backstage.json");
|
|
31
|
+
let backstageVersion = "N/A";
|
|
32
|
+
if (fs__default["default"].existsSync(backstageFile)) {
|
|
33
|
+
try {
|
|
34
|
+
const backstageJson = await fs__default["default"].readJSON(backstageFile);
|
|
35
|
+
backstageVersion = (_a = backstageJson.version) != null ? _a : "N/A";
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.warn('The "backstage.json" file is not in the expected format');
|
|
38
|
+
console.log();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
28
41
|
console.log(`OS: ${os__default["default"].type} ${os__default["default"].release} - ${os__default["default"].platform}/${os__default["default"].arch}`);
|
|
29
42
|
console.log(`node: ${process.version}`);
|
|
30
43
|
console.log(`yarn: ${yarnVersion}`);
|
|
31
44
|
console.log(`cli: ${index.version$1} (${isLocal ? "local" : "installed"})`);
|
|
45
|
+
console.log(`backstage: ${backstageVersion}`);
|
|
32
46
|
console.log();
|
|
33
47
|
console.log("Dependencies:");
|
|
34
48
|
const lockfilePath = index.paths.resolveTargetRoot("yarn.lock");
|
|
@@ -43,4 +57,4 @@ var info = async () => {
|
|
|
43
57
|
};
|
|
44
58
|
|
|
45
59
|
exports["default"] = info;
|
|
46
|
-
//# sourceMappingURL=info-
|
|
60
|
+
//# sourceMappingURL=info-88431720.cjs.js.map
|
|
@@ -4,12 +4,12 @@ var fs = require('fs-extra');
|
|
|
4
4
|
require('semver');
|
|
5
5
|
require('@yarnpkg/parsers');
|
|
6
6
|
require('@yarnpkg/lockfile');
|
|
7
|
-
var packages = require('./packages-
|
|
8
|
-
var index = require('./index-
|
|
7
|
+
var packages = require('./packages-24759dcb.cjs.js');
|
|
8
|
+
var index = require('./index-b7ce30d9.cjs.js');
|
|
9
9
|
var chalk = require('chalk');
|
|
10
10
|
var sortBy = require('lodash/sortBy');
|
|
11
11
|
var groupBy = require('lodash/groupBy');
|
|
12
|
-
var run = require('./run-
|
|
12
|
+
var run = require('./run-f4586ef6.cjs.js');
|
|
13
13
|
require('minimatch');
|
|
14
14
|
require('@manypkg/get-packages');
|
|
15
15
|
require('commander');
|
|
@@ -39,7 +39,10 @@ class AppRouteStep {
|
|
|
39
39
|
const appTsxPath = index.paths.resolveTargetRoot("packages/app/src/App.tsx");
|
|
40
40
|
const contents = await fs__default["default"].readFile(appTsxPath, "utf-8");
|
|
41
41
|
let failed = false;
|
|
42
|
-
const contentsWithRoute = contents.replace(
|
|
42
|
+
const contentsWithRoute = contents.replace(
|
|
43
|
+
/(\s*)<\/FlatRoutes>/,
|
|
44
|
+
`$1 <Route path="${path}" element={${element}} />$1</FlatRoutes>`
|
|
45
|
+
);
|
|
43
46
|
if (contentsWithRoute === contents) {
|
|
44
47
|
failed = true;
|
|
45
48
|
}
|
|
@@ -47,13 +50,18 @@ class AppRouteStep {
|
|
|
47
50
|
if (!componentName) {
|
|
48
51
|
throw new Error(`Could not find component name in ${element}`);
|
|
49
52
|
}
|
|
50
|
-
const contentsWithImport = contentsWithRoute.replace(
|
|
51
|
-
import
|
|
53
|
+
const contentsWithImport = contentsWithRoute.replace(
|
|
54
|
+
/^import /m,
|
|
55
|
+
`import { ${componentName} } from '${packageName}';
|
|
56
|
+
import `
|
|
57
|
+
);
|
|
52
58
|
if (contentsWithImport === contentsWithRoute) {
|
|
53
59
|
failed = true;
|
|
54
60
|
}
|
|
55
61
|
if (failed) {
|
|
56
|
-
console.log(
|
|
62
|
+
console.log(
|
|
63
|
+
"Failed to automatically add a route to package/app/src/App.tsx"
|
|
64
|
+
);
|
|
57
65
|
console.log(`Action needed, add the following:`);
|
|
58
66
|
console.log(`1. import { ${componentName} } from '${packageName}';`);
|
|
59
67
|
console.log(`2. <Route path="${path}" element={${element}} />`);
|
|
@@ -95,12 +103,16 @@ class DependenciesStep {
|
|
|
95
103
|
pkgJson[dep.type][dep.name] = dep.query;
|
|
96
104
|
}
|
|
97
105
|
for (const depType of depTypes) {
|
|
98
|
-
pkgJson[depType] = Object.fromEntries(
|
|
106
|
+
pkgJson[depType] = Object.fromEntries(
|
|
107
|
+
sortBy__default["default"](Object.entries(pkgJson[depType]), ([key]) => key)
|
|
108
|
+
);
|
|
99
109
|
}
|
|
100
110
|
await fs__default["default"].writeJson(pkgPath, pkgJson, { spaces: 2 });
|
|
101
111
|
}
|
|
102
112
|
console.log();
|
|
103
|
-
console.log(
|
|
113
|
+
console.log(
|
|
114
|
+
`Running ${chalk__default["default"].blue("yarn install")} to install new versions`
|
|
115
|
+
);
|
|
104
116
|
console.log();
|
|
105
117
|
await run.run("yarn", ["install"]);
|
|
106
118
|
}
|
|
@@ -128,7 +140,9 @@ const message = createStepDefinition({
|
|
|
128
140
|
deserialize(obj) {
|
|
129
141
|
const { message: msg } = obj;
|
|
130
142
|
if (!msg || typeof msg !== "string" && !Array.isArray(msg)) {
|
|
131
|
-
throw new Error(
|
|
143
|
+
throw new Error(
|
|
144
|
+
"Invalid install step, 'message' must be a string or array"
|
|
145
|
+
);
|
|
132
146
|
}
|
|
133
147
|
return new MessageStep({ message: [msg].flat().join("") });
|
|
134
148
|
},
|
|
@@ -149,7 +163,9 @@ async function fetchPluginPackage(id) {
|
|
|
149
163
|
const searchNames = [`@backstage/plugin-${id}`, `backstage-plugin-${id}`, id];
|
|
150
164
|
for (const name of searchNames) {
|
|
151
165
|
try {
|
|
152
|
-
const packageInfo = await packages.fetchPackageInfo(
|
|
166
|
+
const packageInfo = await packages.fetchPackageInfo(
|
|
167
|
+
name
|
|
168
|
+
);
|
|
153
169
|
return packageInfo;
|
|
154
170
|
} catch (error) {
|
|
155
171
|
if (error.name !== "NotFoundError") {
|
|
@@ -157,7 +173,9 @@ async function fetchPluginPackage(id) {
|
|
|
157
173
|
}
|
|
158
174
|
}
|
|
159
175
|
}
|
|
160
|
-
throw new index.NotFoundError(
|
|
176
|
+
throw new index.NotFoundError(
|
|
177
|
+
`No matching package found for '${id}', tried ${searchNames.join(", ")}`
|
|
178
|
+
);
|
|
161
179
|
}
|
|
162
180
|
class PluginInstaller {
|
|
163
181
|
constructor(steps) {
|
|
@@ -205,8 +223,13 @@ async function installPluginAndPeerPlugins(pkg) {
|
|
|
205
223
|
console.log(`Installing ${pkg.name} AND any peer plugin dependencies.`);
|
|
206
224
|
for (const [_pluginDepName, pluginDep] of pluginDeps.entries()) {
|
|
207
225
|
const { pkg: pluginDepPkg, versionToInstall } = pluginDep;
|
|
208
|
-
console.log(
|
|
209
|
-
|
|
226
|
+
console.log(
|
|
227
|
+
`Installing plugin: ${pluginDepPkg.name}: ${versionToInstall || pluginDepPkg.version}`
|
|
228
|
+
);
|
|
229
|
+
const steps = await PluginInstaller.resolveSteps(
|
|
230
|
+
pluginDepPkg,
|
|
231
|
+
versionToInstall
|
|
232
|
+
);
|
|
210
233
|
const installer = new PluginInstaller(steps);
|
|
211
234
|
await installer.run();
|
|
212
235
|
}
|
|
@@ -219,7 +242,9 @@ async function loadPackageJson(plugin) {
|
|
|
219
242
|
}
|
|
220
243
|
async function loadPeerPluginDeps(pkg, pluginMap) {
|
|
221
244
|
var _a, _b;
|
|
222
|
-
for (const [pluginId, pluginVersion] of Object.entries(
|
|
245
|
+
for (const [pluginId, pluginVersion] of Object.entries(
|
|
246
|
+
(_b = (_a = pkg.experimentalInstallationRecipe) == null ? void 0 : _a.peerPluginDependencies) != null ? _b : {}
|
|
247
|
+
)) {
|
|
223
248
|
const depPkg = await loadPackageJson(pluginId);
|
|
224
249
|
if (!pluginMap.get(depPkg.name)) {
|
|
225
250
|
pluginMap.set(depPkg.name, {
|
|
@@ -233,11 +258,13 @@ async function loadPeerPluginDeps(pkg, pluginMap) {
|
|
|
233
258
|
var install = async (pluginId, cmd) => {
|
|
234
259
|
const from = pluginId || (cmd == null ? void 0 : cmd.from);
|
|
235
260
|
if (!from) {
|
|
236
|
-
throw new Error(
|
|
261
|
+
throw new Error(
|
|
262
|
+
"Missing both <plugin-id> or a package.json file path in the --from flag."
|
|
263
|
+
);
|
|
237
264
|
}
|
|
238
265
|
const pkg = await loadPackageJson(from);
|
|
239
266
|
await installPluginAndPeerPlugins(pkg);
|
|
240
267
|
};
|
|
241
268
|
|
|
242
269
|
exports["default"] = install;
|
|
243
|
-
//# sourceMappingURL=install-
|
|
270
|
+
//# sourceMappingURL=install-4d423030.cjs.js.map
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
4
|
var path = require('path');
|
|
5
|
-
var PackageGraph = require('./PackageGraph-
|
|
6
|
-
var parallel = require('./parallel-
|
|
7
|
-
var index = require('./index-
|
|
5
|
+
var PackageGraph = require('./PackageGraph-7ea22294.cjs.js');
|
|
6
|
+
var parallel = require('./parallel-a8f6219c.cjs.js');
|
|
7
|
+
var index = require('./index-b7ce30d9.cjs.js');
|
|
8
8
|
require('@manypkg/get-packages');
|
|
9
9
|
require('@backstage/errors');
|
|
10
10
|
require('child_process');
|
|
@@ -88,4 +88,4 @@ async function command(opts) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
exports.command = command;
|
|
91
|
-
//# sourceMappingURL=lint-
|
|
91
|
+
//# sourceMappingURL=lint-2fd53d5f.cjs.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Lockfile = require('./Lockfile-
|
|
3
|
+
var Lockfile = require('./Lockfile-72b7072e.cjs.js');
|
|
4
4
|
require('minimatch');
|
|
5
5
|
require('@manypkg/get-packages');
|
|
6
|
-
require('./run-
|
|
6
|
+
require('./run-f4586ef6.cjs.js');
|
|
7
7
|
require('chalk');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-b7ce30d9.cjs.js');
|
|
9
9
|
var partition = require('lodash/partition');
|
|
10
10
|
require('fs-extra');
|
|
11
11
|
require('semver');
|
|
@@ -41,24 +41,50 @@ var lint = async (cmd) => {
|
|
|
41
41
|
const result = lockfile.analyze({
|
|
42
42
|
filter: includedFilter
|
|
43
43
|
});
|
|
44
|
-
logArray(
|
|
44
|
+
logArray(
|
|
45
|
+
result.invalidRanges,
|
|
46
|
+
"The following packages versions are invalid and can't be analyzed:",
|
|
47
|
+
(e) => ` ${e.name} @ ${e.range}`
|
|
48
|
+
);
|
|
45
49
|
if (fix) {
|
|
46
50
|
lockfile.replaceVersions(result.newVersions);
|
|
47
51
|
await lockfile.save();
|
|
48
52
|
} else {
|
|
49
|
-
const [newVersionsForbidden, newVersionsAllowed] = partition__default["default"](
|
|
53
|
+
const [newVersionsForbidden, newVersionsAllowed] = partition__default["default"](
|
|
54
|
+
result.newVersions,
|
|
55
|
+
({ name }) => forbiddenDuplicatesFilter(name)
|
|
56
|
+
);
|
|
50
57
|
if (newVersionsForbidden.length && !fix) {
|
|
51
58
|
success = false;
|
|
52
59
|
}
|
|
53
|
-
logArray(
|
|
54
|
-
|
|
60
|
+
logArray(
|
|
61
|
+
newVersionsForbidden,
|
|
62
|
+
"The following packages must be deduplicated, this can be done automatically with --fix",
|
|
63
|
+
(e) => ` ${e.name} @ ${e.range} bumped from ${e.oldVersion} to ${e.newVersion}`
|
|
64
|
+
);
|
|
65
|
+
logArray(
|
|
66
|
+
newVersionsAllowed,
|
|
67
|
+
"The following packages can be deduplicated, this can be done automatically with --fix",
|
|
68
|
+
(e) => ` ${e.name} @ ${e.range} bumped from ${e.oldVersion} to ${e.newVersion}`
|
|
69
|
+
);
|
|
55
70
|
}
|
|
56
|
-
const [newRangesForbidden, newRangesAllowed] = partition__default["default"](
|
|
71
|
+
const [newRangesForbidden, newRangesAllowed] = partition__default["default"](
|
|
72
|
+
result.newRanges,
|
|
73
|
+
({ name }) => forbiddenDuplicatesFilter(name)
|
|
74
|
+
);
|
|
57
75
|
if (newRangesForbidden.length) {
|
|
58
76
|
success = false;
|
|
59
77
|
}
|
|
60
|
-
logArray(
|
|
61
|
-
|
|
78
|
+
logArray(
|
|
79
|
+
newRangesForbidden,
|
|
80
|
+
"The following packages must be deduplicated by updating dependencies in package.json",
|
|
81
|
+
(e) => ` ${e.name} @ ${e.oldRange} should be changed to ${e.newRange}`
|
|
82
|
+
);
|
|
83
|
+
logArray(
|
|
84
|
+
newRangesAllowed,
|
|
85
|
+
"The following packages can be deduplicated by updating dependencies in package.json",
|
|
86
|
+
(e) => ` ${e.name} @ ${e.oldRange} should be changed to ${e.newRange}`
|
|
87
|
+
);
|
|
62
88
|
if (!success) {
|
|
63
89
|
throw new Error("Failed versioning check");
|
|
64
90
|
}
|
|
@@ -78,4 +104,4 @@ function logArray(arr, header, each) {
|
|
|
78
104
|
exports["default"] = lint;
|
|
79
105
|
exports.forbiddenDuplicatesFilter = forbiddenDuplicatesFilter;
|
|
80
106
|
exports.includedFilter = includedFilter;
|
|
81
|
-
//# sourceMappingURL=lint-
|
|
107
|
+
//# sourceMappingURL=lint-bd7b9e13.cjs.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-b7ce30d9.cjs.js');
|
|
4
4
|
var eslint = require('eslint');
|
|
5
5
|
require('commander');
|
|
6
6
|
require('chalk');
|
|
@@ -15,7 +15,9 @@ var lint = async (directories, opts) => {
|
|
|
15
15
|
fix: opts.fix,
|
|
16
16
|
extensions: ["js", "jsx", "ts", "tsx", "mjs", "cjs"]
|
|
17
17
|
});
|
|
18
|
-
const results = await eslint$1.lintFiles(
|
|
18
|
+
const results = await eslint$1.lintFiles(
|
|
19
|
+
directories.length ? directories : ["."]
|
|
20
|
+
);
|
|
19
21
|
if (opts.fix) {
|
|
20
22
|
await eslint.ESLint.outputFixes(results);
|
|
21
23
|
}
|
|
@@ -31,4 +33,4 @@ var lint = async (directories, opts) => {
|
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
exports["default"] = lint;
|
|
34
|
-
//# sourceMappingURL=lint-
|
|
36
|
+
//# sourceMappingURL=lint-da011116.cjs.js.map
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
4
|
var eslint = require('eslint');
|
|
5
5
|
var path = require('path');
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var PackageGraph = require('./PackageGraph-
|
|
6
|
+
var index = require('./index-b7ce30d9.cjs.js');
|
|
7
|
+
var PackageGraph = require('./PackageGraph-7ea22294.cjs.js');
|
|
8
8
|
require('commander');
|
|
9
9
|
require('fs-extra');
|
|
10
10
|
require('semver');
|
|
@@ -79,4 +79,4 @@ async function command(opts) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
exports.command = command;
|
|
82
|
-
//# sourceMappingURL=list-deprecations-
|
|
82
|
+
//# sourceMappingURL=list-deprecations-268e1d6b.cjs.js.map
|