Add @backstage/cli-defaults package

Introduces a new `@backstage/cli-defaults` package that re-exports all
standard CLI modules as a single array, simplifying dependency management
for consumers. The CLI's `CliInitializer` is updated to support array
exports alongside single module exports. The create-app template,
changesets, and CLI fallback are updated to use `@backstage/cli-defaults`
instead of listing 11 individual modules.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-15 15:01:35 +01:00
parent 7db7ca5714
commit 7781ae5911
14 changed files with 172 additions and 61 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli-defaults': minor
---
Introduced `@backstage/cli-defaults`, a convenience package that bundles all standard Backstage CLI modules. Install this single package as a `devDependency` to get the full default set of CLI commands without listing each module individually.
+17 -7
View File
@@ -4,7 +4,23 @@
The CLI now automatically discovers CLI modules from the project root's `dependencies` and `devDependencies`. Any installed package with the `cli-module` Backstage role will be loaded automatically without needing to be hardcoded in the CLI itself.
If no CLI modules are found in the project dependencies, the CLI falls back to the built-in set of modules and prints a deprecation warning. This fallback will be removed in a future release. To prepare for this, add the following CLI modules as `devDependencies` in your root `package.json`:
If no CLI modules are found in the project dependencies, the CLI falls back to the built-in set of modules and prints a deprecation warning. This fallback will be removed in a future release. To prepare for this, add `@backstage/cli-defaults` as a `devDependency` in your root `package.json`:
```json
{
"devDependencies": {
"@backstage/cli-defaults": "backstage:^"
}
}
```
If you are not using the Backstage Yarn plugin, run the following instead:
```sh
yarn workspace root add --dev @backstage/cli-defaults
```
For fine-grained control you can instead install individual CLI modules:
```json
{
@@ -23,9 +39,3 @@ If no CLI modules are found in the project dependencies, the CLI falls back to t
}
}
```
If you are not using the Backstage Yarn plugin, run the following instead:
```sh
yarn workspace root add --dev @backstage/cli-module-auth @backstage/cli-module-build @backstage/cli-module-config @backstage/cli-module-create-github-app @backstage/cli-module-info @backstage/cli-module-lint @backstage/cli-module-maintenance @backstage/cli-module-migrate @backstage/cli-module-new @backstage/cli-module-test-jest @backstage/cli-module-translations
```
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/create-app': patch
---
The create-app templates now include all standard `@backstage/cli-module-*` packages as `devDependencies`, enabling the CLI's automatic module discovery for newly created projects.
The create-app templates now include `@backstage/cli-defaults` as a `devDependency`, enabling the CLI's automatic module discovery for newly created projects.