cli: Rename frontend plugin templates and add auto-detection

Renamed the CLI templates for frontend plugins:
- new-frontend-plugin → frontend-plugin
- new-frontend-plugin-module → frontend-plugin-module
- frontend-plugin (legacy) → legacy-frontend-plugin

Added auto-detection logic that checks packages/app/package.json to
determine which frontend system the app uses. When using default
templates, only the appropriate frontend plugin template is shown:
- Apps with @backstage/frontend-defaults see the new system templates
- Apps with @backstage/app-defaults see the legacy template

Both templates display as "frontend-plugin" to users, so existing
workflows are preserved while automatically using the correct template.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-02-05 13:55:06 +01:00
parent a6735c33b1
commit 08d9770715
42 changed files with 168 additions and 99 deletions
@@ -0,0 +1,16 @@
---
'@backstage/cli': minor
---
**BREAKING**: The CLI templates for frontend plugins have been renamed:
- `new-frontend-plugin``frontend-plugin`
- `new-frontend-plugin-module``frontend-plugin-module`
- `frontend-plugin` (legacy) → `legacy-frontend-plugin`
To smooth out this breaking change, the CLI now auto-detects which frontend system your app uses based on the dependencies in `packages/app/package.json`. When using the default templates (no explicit `templates` configuration):
- Apps using `@backstage/frontend-defaults` will see the new frontend system templates (`frontend-plugin`, `frontend-plugin-module`)
- Apps using `@backstage/app-defaults` will see the legacy template (displayed as `frontend-plugin`)
This means existing projects that haven't migrated to the new frontend system will continue to create legacy plugins by default, while new projects will get the new frontend system templates. If you have explicit template configuration in your `package.json`, it will be used as-is without any auto-detection.