Commit Graph

2270 Commits

Author SHA1 Message Date
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] be21c5c822 fix(deps): update rjsf monorepo to v5.24.13
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-08 13:05:02 +00:00
Patrik Oldsberg f85dafa7f2 update API reports for moduleResolution: bundler
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-02 22:25:00 +01:00
github-actions[bot] 756986e5e7 Version Packages (next) 2025-11-25 16:21:32 +00:00
Patrik Oldsberg 395ff1c43b plugins: remove unused dependencies on core-compat-api
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-23 14:36:02 +01:00
Patrik Oldsberg 1c7ea4a3e8 plugins: remove unnecessary use of convertLegacyRouteRef(s)
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-23 14:36:02 +01:00
Patrik Oldsberg d02db50b42 plugins: cleanup unnecessary use of compatWrapper
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-23 12:56:54 +01:00
Patrik Oldsberg ebe5538d55 update API reports for core/frontend inversion
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-23 01:59:07 +01:00
github-actions[bot] 792f4d7e3d Version Packages 2025-11-18 12:23:09 +00:00
Patrik Oldsberg a1c58124a7 sync API reports
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-17 10:35:43 +01: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 161999e837 fix tsc issues
Signed-off-by: Paul Schultz <pschultz@pobox.com>
2025-10-14 08:29:22 -05: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] 316d0774b8 Version Packages (next) 2025-10-07 15:00:59 +00:00
Fredrik Adelöw acac5b81e4 Merge pull request #31312 from OSfrog/disable-owned-entity-picker
fix(OwnedEntityPicker): forward ui:disabled prop to EntityPicker
2025-10-06 15:15:45 +02:00
Tommy Le 90496fe472 fix: forward disabled prop
Signed-off-by: Tommy Le <tommy_le@outlook.com>
2025-09-30 17:10:30 +02:00
github-actions[bot] ffb5b44d86 Version Packages (next) 2025-09-30 14:42:12 +00:00
Ben Lambert b003d08e8b Merge pull request #31253 from drodil/nfs_scaffolder_fields
feat(scaffolder): add missing form fields for the nfs
2025-09-26 13:38:38 +02:00
github-actions[bot] c2c60546d2 Version Packages (next) 2025-09-24 12:57:42 +00:00
Hellgren Heikki 4ee97cf3ab chore(scaffolder): clean up api report from schemas and validators
Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-09-24 11:22:45 +03:00
Hellgren Heikki 48d409f4ab fix: correct year for copyright headers
Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-09-24 10:28:42 +03:00
Hellgren Heikki 075e0648b8 feat(scaffolder): add missing form fields for the nfs
Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-09-24 10:28:41 +03:00
github-actions[bot] c73bfa46d4 Version Packages (next) 2025-09-23 15:00:29 +00:00
Ben Lambert 572845d2e5 Merge pull request #31077 from gauravagrawal01/fix/scaffolder-router-templatingExtensions
fix(scaffolder): add missing templatingExtensions option to RouterProps contextMenu
2025-09-23 14:42:10 +02:00
github-actions[bot] b799a2d07f Version Packages 2025-09-16 13:22:58 +00:00
Paul Schultz 133ac7ad66 fix(repo-tools): resolve knip-reports failure with spaces in workspace paths
Signed-off-by: Paul Schultz <pschultz@pobox.com>
2025-09-15 12:34:26 -05:00
Alec Jacobs 7151260d27 fix(scaffolder): prevent MultiEntityPicker from removing existing options from form data
Signed-off-by: Alec Jacobs <cajacobs5401@gmail.com>
2025-09-12 14:34:03 -07:00
github-actions[bot] 020d484ac4 Version Packages (next) 2025-09-09 15:00:36 +00:00
Fredrik Adelöw 0f3f1fa462 Merge pull request #30988 from dfl-aeb/dfl/fix-scaffolder-techdocs-view
fix(scaffolder): show “View TechDocs” link when template has backstage.io/techdocs-entity and backstage.io/techdocs-entity-path
2025-09-09 13:44:40 +02:00
Gaurav Agrawal 443c0e4348 fix: add api report
Signed-off-by: Gaurav Agrawal <gaurav.agrawal01@nagarro.com>
2025-09-07 19:51:00 +00:00
Gaurav Agrawal e0ffe84d55 fix(scaffolder): add missing templatingExtensions flag to RouterProps contextMenu
Signed-off-by: Gaurav Agrawal <gaurav.agrawal01@nagarro.com>
2025-09-07 18:05:57 +00:00
github-actions[bot] ac48eeb3ba Version Packages (next) 2025-09-02 12:17:03 +00:00
David Fankhänel 5b64169384 fix(TemplateListPage): fix tsc error
Signed-off-by: David Fankhänel <david.fankhaenel@aeb.com>
2025-08-27 10:28:28 +02:00
David Fankhänel 0d415ae014 fix(scaffolder): render TechDocs link on Template List page for TechDocs annotations
Show “View TechDocs” link when template has backstage.io/techdocs-ref or backstage.io/techdocs-entity.
Append backstage.io/techdocs-entity-path when set.
Use buildTechDocsURL from @backstage/plugin-techdocs-react.
Add tests covering both annotations and path handling.
Update dependencies to include @backstage/plugin-techdocs-common and @backstage/plugin-techdocs-react.
Add sample TechDocs scaffolding to notifications-demo template.
Closes #29076.

Signed-off-by: David Fankhänel <david.fankhaenel@aeb.com>
2025-08-26 15:08:55 +02:00
github-actions[bot] 9c441f9a78 Version Packages (next) 2025-08-25 15:09:39 +00:00
github-actions[bot] b93a3471c2 Version Packages 2025-08-19 13:01:39 +00:00
Patrik Oldsberg 12b6db78eb frontend-plugin-api: add OverridableFrontendPlugin type
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-08-15 20:29:04 +02:00
github-actions[bot] 571280f19c Version Packages (next) 2025-08-12 15:33:11 +00:00
Ben Lambert 9869424ffa Merge pull request #30456 from stephenglass/feat/add-adjustable-panels-template-editor
feat(scaffolder): adjustable panels width in template editor layouts
2025-08-11 10:27:44 +02:00
github-actions[bot] 1e8a013c67 Version Packages (next) 2025-08-05 13:45:29 +00:00
Patrik Oldsberg 948de17c19 frontend-plugin-api: avoid forwarding ConfigurableExtensionDataRef
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-08-05 15:12:13 +02:00
Patrik Oldsberg 147482b700 frontend-plugin-api: switch naming recommendation from define to defineParams
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-08-04 17:17:05 +02:00
Patrik Oldsberg e4ddf22854 frontend-plugin-api,catalog-react: remove default* prefix from blueprint params
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-08-04 16:46:55 +02:00
Stephen Glass b1c06969b6 Add resizable panel width feature to template editor layout
Signed-off-by: Stephen Glass <stephen@stephen.glass>
2025-07-29 23:27:17 -04:00
github-actions[bot] 531a48848c Version Packages (next) 2025-07-29 14:40:44 +00:00
Ben Lambert 1315a825cf Merge pull request #27771 from solimant/23819_scaffolder_openapi
Move Scaffolder API to OpenAPI
2025-07-29 14:36:47 +02:00
Ben Lambert cf6fb4b5aa Merge pull request #30670 from backstage/export
Export `FormField` type from Scaffolder
2025-07-29 14:08:29 +02:00