64 Commits

Author SHA1 Message Date
github-actions[bot] b97fcb0a93 Version Packages 2026-05-19 18:28:24 +00:00
github-actions[bot] 7295193bb6 Version Packages (next) 2026-04-28 15:53:09 +00:00
Fredrik Adelöw e9b78e9698 Remove uuid dependency in favor of crypto.randomUUID()
The uuid package dropped its CommonJS entry point in v14, making it
incompatible with Backstage's CJS build output and Jest test runner.
Rather than working around the ESM-only issue, replace all usage with
the built-in crypto.randomUUID() which has been available in Node.js
since v16.7 and in all major browsers since March 2022.

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-23 10:51:43 +02:00
github-actions[bot] 1cc86bee1c Version Packages (next) 2026-04-21 15:07:43 +00:00
Fredrik Adelöw 8e7f7249e7 chore: regenerate knip reports
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-16 12:14:47 +02:00
github-actions[bot] 93e643d142 Version Packages 2026-04-14 14:57:31 +00:00
Aramis Sennyey 2b4f97adf7 docs: frontend plugin golden path (#33541)
* docs: frontend plugin golden path guide

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* add changeset

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* Apply suggestion from @aramissennyeydd

Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* fix template

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* fix template test

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* print stderr on failure

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* try writing directly

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* maybe this?

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* address feedback

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* fix: avoid destructuring FetchApi and fix template issues

- Use fetchApi.fetch() instead of destructuring to preserve this binding
- Add discoveryApi and fetchApi to useAsync dependency array
- Use react-use/esm/useAsync to match repo conventions
- Replace waitFor + getAllByText with findByText in error test
- Update HTTP client doc to match template changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* fix: address docs review feedback

- Use stronger guidance tone in scaffolding guide intro
- Slim down file tree to show folder structure only
- Mention that plugin path depends on chosen plugin ID
- Link to installation docs for non-discovery case
- Quote page:todo YAML key to avoid parse errors
- Remove "new" from "new frontend system" in template README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* fix: improve error handling in e2e plugin creation

- Narrow error to non-null object before using in operator
- Also write error.stdout since tools like Jest report to stdout
- Avoid variable shadowing with outer scope stdout/stderr

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* revert: keep destructured fetch from FetchApi

Destructuring fetch from FetchApi is fine — revert to original
pattern while keeping the dependency array and other fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* feat: use @backstage/ui components in frontend plugin template

Replace core-components layout and table with @backstage/ui equivalents:
- Use HeaderPage and Container instead of Page, Header, Content, ContentHeader
- Use BUI Table with useTable and CellText instead of core-components Table
- Add @backstage/ui to template package.json dependencies
- Update poking-around docs to reflect BUI component usage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* fix: add example data when backend request fails

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* better logging setup

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* address feedback

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* better config driven example

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* debug logs

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* fix build failure related to unknown version

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* revert e2e run changes

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>

* skip the discovery api for now

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* remove another ref

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>

---------

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-10 14:00:55 -04:00
github-actions[bot] 6c10d88c13 Version Packages (next) 2026-04-07 15:30:58 +00:00
Patrik Oldsberg b2319ffe45 errors: add toError utility and migrate assertError usages
Add a `toError` utility function to `@backstage/errors` that converts
unknown values to `ErrorLike` objects. If the value is already error-like
it is returned as-is. Strings are used directly as the error message, and
other values are stringified with a fallback to JSON.stringify to avoid
unhelpful `[object Object]` messages.

Non-error causes passed to `CustomErrorBase` are now converted and stored
using `toError` rather than discarded. Existing `assertError` call sites
across the codebase are migrated to `toError`.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-03 10:16:23 +02:00
github-actions[bot] a2cb332e25 Version Packages (next) 2026-03-31 15:30:51 +00:00
Vincenzo Scamporlino 3964163dce Fix export path in frontend plugin module template
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-31 14:36:58 +02:00
Vincenzo Scamporlino e38bcefb99 Fix template name collision between new and legacy frontend plugin templates
The legacy frontend plugin template had the same name (`frontend-plugin`) as
the new frontend plugin template, causing a conflict error when both were shown
(e.g. when the frontend system could not be auto-detected). Rename the legacy
template to `frontend-plugin-legacy` so both can coexist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-31 14:36:53 +02:00
Patrik Oldsberg 9bfa74bbb5 Merge pull request #33446 from Sarabadu/patch-2
Rename frontend-plugin to legacy-frontend-plugin
2026-03-31 10:30:13 +02:00
github-actions[bot] c1b510cabb Version Packages (next) 2026-03-24 14:54:00 +00:00
Juan Pablo Garcia Ripa 64a91d0005 Rename frontend-plugin to legacy-frontend-plugin
rename the template to not get naming conficts with the nfs template

Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
2026-03-19 21:57:48 +01:00
github-actions[bot] 5725b5fcfa Version Packages 2026-03-17 21:39:07 +00:00
Patrik Oldsberg b46970c880 Move known plugin package constants from cli-common to cli-internal
The known plugin package ID mappings don't need to be part of the
public API surface. Move them to @internal/cli and update consumers.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 21:35:25 +01:00
Vincenzo Scamporlino a0bc38b83c Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:58 +01:00
Vincenzo Scamporlino aaf97bdccb Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:58 +01:00
Patrik Oldsberg 6ae0f41c56 Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-03-17 21:34:58 +01:00
Vincenzo Scamporlino 00328c1321 Add tests to auto-fill pluginPackage for catalog plugins without prompting
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:58 +01:00
Vincenzo Scamporlino db13e5f52f Fix plugin package handling by trimming and validating input; add .node-version file
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:58 +01:00
Vincenzo Scamporlino 733dd3447e Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:58 +01:00
Vincenzo Scamporlino e6675123d8 Refactor plugin package validation to trim and check for valid npm package names
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:58 +01:00
Vincenzo Scamporlino 58fb21967a Include additional parameters in answers
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:58 +01:00
Vincenzo Scamporlino 769cb030b9 Enhance plugin package input handling by clearing empty/invalid values and updating pre-population logic
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 11060e329a Add centralized known plugin package exports and update imports
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 5f0daba1d5 Enhance plugin package handling by pre-populating known packages in collectPortableTemplateInput
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 7f8daf93fb Add centralized mapping for known plugin packages in knownPluginPackages.ts
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino f22a0822ab Rename knownFrontendPluginPackages to knownFrontendPluginPackageNameByPluginId for consistency
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 5c7186b5d4 Refactor plugin package name handling to use a centralized mapping for backend plugins
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 1b1f7a87aa Update packages/cli/src/modules/new/lib/preparation/collectPortableTemplateInput.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 194d4b1149 Add pluginPackage field to package.json template for frontend plugin module
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 5ebd4800d7 Remove pluginPackage from portable-template.yaml
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino e8ed881fca Update package name validation regex to support additional characters
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 9b261e37ba Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino 994b82ca84 Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:57 +01:00
Vincenzo Scamporlino a84b9e91df Added missing pluginPackage
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:56 +01:00
Vincenzo Scamporlino 7191abef86 Add support for pluginPackage to frontend modules
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:56 +01:00
Vincenzo Scamporlino 971cc9457a cli: Add pluginPackage support to backend-plugin-module template
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2026-03-17 21:34:56 +01:00
Patrik Oldsberg 60e3dcb098 Merge pull request #32700 from backstage/rugvip/new-frontend-system-default
Make the new frontend system the default for new apps
2026-03-17 21:24:11 +01:00
Gabriel Dugny ffaded0b30 chore: lint & changeset
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-03-17 16:48:43 +01:00
Gabriel Dugny a49a40d314 Proper /v3 usage everywhere
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-03-17 16:48:42 +01:00
Gabriel Dugny 49171c9de4 chore: Update all imports to zod/v3
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-03-17 16:48:42 +01:00
Patrik Oldsberg 9603f9c6c0 cli: fix frontend plugin template dev dependency
Add the missing frontend dev utils package so newly scaffolded frontend plugins compile in the create-app E2E flow.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:17:59 +01:00
Patrik Oldsberg 35686dc9f7 cli: add frontend template filtering coverage
Clarify the legacy frontend plugin template label and lock in template selection behavior for legacy and new frontend system apps.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:17:18 +01:00
Patrik Oldsberg 08d9770715 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>
2026-03-17 16:17:17 +01:00
Patrik Oldsberg d6742bb1fe Exclude templates from lint in cli-module-new
The templates directory was excluded from linting in the @backstage/cli
package but the ignore pattern was not carried over to cli-module-new.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:28:10 +01:00
Patrik Oldsberg ea90ab0590 Move yarn new templates from @backstage/cli to @backstage/cli-module-new
The built-in templates used by `yarn new` are moved from `packages/cli/templates/`
to `packages/cli-module-new/templates/`, colocating them with the code that
consumes them.

A backwards compatibility rewrite in the template resolution ensures that
existing `@backstage/cli/templates/*` references in root `package.json`
configurations continue to work by transparently resolving them to
`@backstage/cli-module-new/templates/*`.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:10:24 +01:00
Patrik Oldsberg edf2b77581 cli-module-new: add template for CLI module packages
Add a new `cli-module` template to the Backstage CLI that scaffolds
CLI module packages. This includes adding the `cli-module` role to the
template system, with proper naming conventions and prompts.

The generated package includes:
- A bin entry point for standalone execution
- An index.ts with createCliModule setup
- An example command using cleye
- Standard package.json with cli-module role

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 10:54:26 +01:00