524 Commits

Author SHA1 Message Date
github-actions[bot] b97fcb0a93 Version Packages 2026-05-19 18:28:24 +00:00
github-actions[bot] 1cc86bee1c Version Packages (next) 2026-04-21 15:07:43 +00:00
github-actions[bot] 93e643d142 Version Packages 2026-04-14 14:57:31 +00: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] c1b510cabb Version Packages (next) 2026-03-24 14:54:00 +00:00
github-actions[bot] 5725b5fcfa Version Packages 2026-03-17 21:39:07 +00:00
github-actions[bot] 4bd6a3a1af Version Packages (next) 2026-02-24 19:24:06 +00:00
Patrik Oldsberg 07816d67f3 Address PR review comments
- Refactor targetPaths/findOwnPaths to class-based implementations with
  unified caching and .dir/.rootDir properties alongside resolve methods
- Replace jest.mock with jest.spyOn in plugin-manager.test.ts
- Remove paths compatibility wrapper from repo-tools, migrate all internal
  consumers to use targetPaths from @backstage/cli-common directly
- Fix changeset package name (@techdocs/cli not @backstage/techdocs-cli)
- Add migration examples to cli-common changeset
- Update API report for cli-common

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-23 14:44:11 +01:00
Patrik Oldsberg 70fc178697 Replace findPaths with targetPaths and findOwnPaths
Split the path resolution API in @backstage/cli-common into
targetPaths (cwd-based singleton) and findOwnPaths (package-relative).
Migrate all consumers across the repo away from the deprecated findPaths.

Rename TargetPaths/OwnPaths properties to resolve/resolveRoot,
removing the redundant type prefix from property names.

Make findOwnPaths calls lazy in modules - called inside functions
rather than at module scope.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 14:44:10 +01:00
Andre Wanlin 4541817031 Updated API reports due to the package change
Signed-off-by: Andre Wanlin <awanlin@spotify.com>
2026-02-23 06:29:04 -06:00
github-actions[bot] e6df5d52ce Version Packages 2026-02-17 16:06:18 +00:00
github-actions[bot] d4b85dddee Version Packages (next) 2026-01-27 15:51:11 +00:00
Fredrik Adelöw 7455dae884 require the use of node prefix on native imports
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-01-26 13:22:53 +01:00
github-actions[bot] c24788d5bb Version Packages 2025-12-16 14:08:20 +00:00
Johan Persson e70ff47db3 chore: migrate three packages to MSW v2
Migrates test files in config-loader, events-node and kubernetes-react
packages from MSW 1.x to MSW 2.x API to fix compatibility issues with
Jest 30 and JSDOM v26.

Changes:
- Updated msw dependency from ^1.0.0 to ^2.0.0
- Changed imports from `rest` to `http` and `HttpResponse`
- Converted handler syntax from `res(ctx.*)` to `HttpResponse.*`
- Changed `toStrictEqual` to `toEqual` for response assertions

Affected packages:
- @backstage/config-loader
- @backstage/plugin-events-node
- @backstage/plugin-kubernetes-react

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:07:00 +01:00
Johan Persson cd0b8a11a3 chore: make jest a peer dependency with v29/v30 support
Move jest from dependencies to peer dependencies, allowing users to
choose between Jest 29 and Jest 30.

The CLI now detects the Jest version at runtime and uses the
appropriate environment:
- Jest 29: Uses standard jest-environment-jsdom
- Jest 30: Uses a custom environment based on @jest/environment-jsdom-abstract
  with fixes for Web API globals (fetch, streams, Error, etc.)

The cross-fetch polyfill is only injected for Jest 29, as with Jest 30+
our patched Jest environment is used. The network request blocker is made
MSW-compatible by checking if fetch was wrapped before blocking.

Jest 30 (with jsdom v27) fixes `Could not parse CSS stylesheet`
warnings/errors when testing components from @backstage/ui or other
packages using CSS `@layer` declarations.

New peer dependencies (install based on your Jest version):
- jest (required, ^29 or ^30)
- Jest 29 requires: jest-environment-jsdom
- Jest 30 requires: @jest/environment-jsdom-abstract, jsdom

Production code changes for jsdom 27 testability:
- AppIdentityProxy: extract navigateToUrl method for spying
- LiveReloadAddon: export utils.reloadPage for spying
- collect.ts: export internal.resolvePackagePath for mocking

MockFetchApi: evaluate global.fetch at call time instead of construction
time, allowing MSW to patch fetch after MockFetchApi is constructed.

Test adaptations for jsdom 27:
- Use RGB values instead of named colors in CSS assertions
- Update error format expectations (hyphenated type names, SyntaxError
  instead of FetchError for JSON parse errors)
- Simplify URL error assertions for cross-version compatibility
- Fix accessible name whitespace handling for external links
- Use history.replaceState for location mocking (non-configurable)
- Use fireEvent.blur for contentEditable elements
- Move async assertions inside waitFor for race conditions
- Remove Blob.prototype.text polyfill (now native)
- Remove test case using credentials in plugin:// URLs

Test adaptations for Jest 30:
- Replace `expect.objectContaining([...])` with direct array equality
- Replace `expect.objectContaining({ length: N })` with
  `expect.any(Array)` + separate `toHaveLength()` assertions
- Use child process for native Node.js module resolution in
  collect.test.ts to work around Jest 30's resolver behavior
- Update snapshot headers for new Jest format

Also removes the jest-haste-map patch which is no longer needed.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:06:55 +01:00
github-actions[bot] e08f48a9b5 Version Packages (next) 2025-12-09 15:00:09 +00:00
renovate[bot] 741c47a38b fix(deps): update dependency typescript-json-schema to ^0.67.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-05 12:30:46 +00:00
github-actions[bot] 756986e5e7 Version Packages (next) 2025-11-25 16:21:32 +00:00
github-actions[bot] 792f4d7e3d Version Packages 2025-11-18 12:23:09 +00:00
github-actions[bot] 807af8ce0e Version Packages (next) 2025-10-21 16:14:43 +00:00
Patrik Oldsberg b436f73803 Merge pull request #31166 from schultzp2020/constructor-parameters
refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility
2025-10-15 18:56:42 +02:00
github-actions[bot] d6ce2db9ca Version Packages 2025-10-14 15:29:54 +00:00
Paul Schultz 05f60e1e0a refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility
Signed-off-by: Paul Schultz <pschultz@pobox.com>
2025-10-14 08:29:21 -05:00
github-actions[bot] ffb5b44d86 Version Packages (next) 2025-09-30 14:42:12 +00:00
github-actions[bot] c2c60546d2 Version Packages (next) 2025-09-24 12:57:42 +00:00
Hellgren Heikki b45b0945dd fix(config): allow colon to be in the config key
Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-09-24 07:29:37 +03:00
github-actions[bot] b799a2d07f Version Packages 2025-09-16 13:22:58 +00:00
github-actions[bot] 020d484ac4 Version Packages (next) 2025-09-09 15:00:36 +00:00
Andre Wanlin 1d15f6b01b Removed references to Lerna as it's not used
Signed-off-by: Andre Wanlin <awanlin@spotify.com>
2025-09-09 11:37:03 +02:00
Hellgren Heikki 5798d2566f chore: change to BACKSTAGE_ENV
as per review

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-09-08 08:48:53 +03:00
Hellgren Heikki b321dd9040 feat: add support for local env specific config files
Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-08-11 14:47:53 +03:00
Hellgren Heikki a73f495840 feat(config): allow specifying env specific config files
this change allows to specify loading of environment specific config
files based on `BACKSTAGE_ENVIRONMENT` environment variable.

relates to #30716

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-08-01 15:45:22 +03:00
github-actions[bot] 9a7cae26c9 Version Packages 2025-07-15 14:26:41 +00:00
github-actions[bot] 952cefedd8 Version Packages (next) 2025-07-01 11:50:02 +00:00
aramissennyeydd b3a705f3cd allow x-2 in config
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2025-06-10 11:53:15 -04:00
aramissennyeydd f1f21b8cd7 fix: loosen regex requirements for config keys
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2025-06-10 11:18:21 -04:00
github-actions[bot] 389d265b60 Version Packages 2025-05-20 08:25:02 +00:00
Patrik Oldsberg 83656f8999 .github/CODEOWNERS: adjust ownership for new project areas
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-05-05 14:19:45 +02:00
github-actions[bot] 125d09682e Version Packages (next) 2025-04-29 14:27:15 +00:00
Gabriel Dugny 72d019d663 chore(typos): Fix low-impact typos
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2025-04-23 17:56:22 +02:00
github-actions[bot] 127408219b Version Packages 2025-03-18 12:55:57 +00:00
Fredrik Adelöw d81cdcc45d Merge pull request #28682 from Pike/sanitize-dependencies
Remove unused dependencies from backend-app-api and backend-defaults.
2025-03-16 16:06:21 +01:00
github-actions[bot] 68af69b2b8 Version Packages (next) 2025-03-11 16:50:56 +00:00
Patrik Oldsberg 2fd73aa5f8 config-loader: only apply include transform to known keys
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-03-05 23:31:35 +01:00
github-actions[bot] 0df84b6ae4 Version Packages 2025-02-18 15:19:53 +00:00
Axel Hecht f422984a53 Remove unused dependencies from backend-app-api and backend-defaults.
Also adjust the dependencies of config-loader to continue building.

Signed-off-by: Axel Hecht <axel@pike.org>
2025-01-30 17:43:27 +01:00
github-actions[bot] 132173b897 Version Packages (next) 2025-01-21 14:07:39 +00:00
Patrik Oldsberg e57fd0c63d Merge pull request #28308 from backstage/rugvip/modules
cli: add support for native ESM in Node.js packages
2025-01-16 14:07:54 +01:00