Commit Graph

3169 Commits

Author SHA1 Message Date
Fredrik Adelöw 05fb5f23aa Merge pull request #32275 from meganide/feat/cli-pattern
feat: add --include and --output-file to backstage-cli-info
2026-01-20 15:34:30 +01:00
Johan Persson f6a5d2f07f fix(cli): use content-based hashing for CSS module class names
Replace the default path-based CSS module hash with a content-based
hash derived from the CSS content. This prevents class name collisions
when multiple versions of packages are loaded simultaneously.

Uses 10 characters of hex-encoded MD5 hash for safe, readable class
name suffixes.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-01-20 13:13:48 +01:00
Renas 863444a504 feat: change JSON format for dependency versions to array of objects
Change the info command's JSON output to use an array of objects for
dependency versions instead of comma-separated strings, making the
format more parseable and extensible.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Renas <renash@spotify.com>
2026-01-19 15:43:04 +01:00
Renas 4399328c37 feat: replace --output-file with --format
Signed-off-by: Renas <renash@spotify.com>
2026-01-19 15:43:04 +01:00
Renas f59cb84d34 chore: build api reports
Signed-off-by: Renas <renash@spotify.com>
2026-01-19 15:43:04 +01:00
Renas 9aa8fd9c84 chore: revert changes to cli-report
Signed-off-by: Renas <renash@spotify.com>
2026-01-19 15:43:04 +01:00
Renas 563035ffe8 chore: run prettier
Signed-off-by: Renas <renash@spotify.com>
2026-01-19 15:43:03 +01:00
Renas fd4439a8b8 feat: add --output-file option to backstage-cli info for JSON export
Signed-off-by: Renas <renash@spotify.com>
2026-01-19 15:43:03 +01:00
Renas a6cd70a5b2 feat: add --include to backstage-cli info
Signed-off-by: Renas <renash@spotify.com>
2026-01-19 15:43:03 +01:00
Patrik Oldsberg 140cbc2a20 cli: add missing backend-test-utils deps to templates
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-19 10:48:39 +01:00
Jon Koops 4eeba9ed61 Upgrade zod-validation-error to version 4
Signed-off-by: Jon Koops <jonkoops@gmail.com>
2026-01-14 14:46:55 +01:00
Backstage Service Account 9f1ee3e667 Version Packages (next) (#32222)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-30 16:06:20 +01:00
Backstage Service Account fea3e3972d Version Packages (next) (#32150) 2025-12-23 18:22:06 +01:00
Ben Lambert 9ee5996d4b Revert "microsite: pin swc"
Signed-off-by: benjdlambert <ben@blam.sh>

chore: bump minimum required swc

Signed-off-by: benjdlambert <ben@blam.sh>

chore: add chantgeset

Signed-off-by: benjdlambert <ben@blam.sh>
2025-12-18 08:16:33 +01:00
Hellgren Heikki 320c6a91ed fix(cli): bump swc core version for es2023/2024 support
fixes issues with backstage 1.46.0 if the
@swc/core version is resolved to lower than 1.8.0

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-12-17 08:49:18 +02:00
github-actions[bot] c24788d5bb Version Packages 2025-12-16 14:08:20 +00:00
Patrik Oldsberg a0de7cf2b7 Merge pull request #31933 from backstage/upgrade-jsdom
chore: upgrade jsdom to v27 and Jest to v30
2025-12-15 16:01:01 +01:00
Fredrik Adelöw 65e3fd3b25 Merge pull request #31772 from elaine-mattos/fix/frontend-plugin-template-dependencies
Fix frontend plugin template dependencies
2025-12-13 19:29:49 +01:00
Patrik Oldsberg b34128e8e0 Merge pull request #32075 from backstage/sennyeya/node-snapshot
feat(cli): provide --no-node-snapshot by default
2025-12-12 16:54:56 +01:00
Johan Persson a169d7f6e9 fix(cli): add helpful error message for missing jest dependency
Since jest is now a peer dependencies, users must add it as a
devDependency themselves. This commit adds early detection and
a helpful error message when jest is missing, directing users
to the migration guide.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:07:01 +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
Patrik Oldsberg c07af9f966 cli: move back to ES2022 in tsconfig
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-10 20:46:08 +01:00
aramissennyeydd 51a4cd3b76 fix type error
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2025-12-10 13:58:45 -05:00
aramissennyeydd d78945eff9 fix test errors by adding to repo test as well
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2025-12-09 17:52:18 -05:00
github-actions[bot] e08f48a9b5 Version Packages (next) 2025-12-09 15:00:09 +00:00
aramissennyeydd 238852ca7d fix build
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2025-12-08 17:44:53 -05:00
aramissennyeydd 0def824b4d remove --no-node-snapshots flag
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2025-12-08 17:28:19 -05:00
aramissennyeydd ed2ca0efc7 feat: provide --no-node-snapshot by default
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2025-12-08 17:01:39 -05:00
Fredrik Adelöw 2bae83ab2e Version Policy Update - Node 22 to 24
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2025-12-08 10:53:38 +01:00
renovate[bot] 122664749c fix(deps): update dependency esbuild to ^0.27.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-05 11:07:28 +00:00
renovate[bot] 2b81751407 chore(deps): update dependency webpack to ~5.103.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-03 11:09:06 +00:00
Patrik Oldsberg 2c6ea33a74 Merge pull request #31946 from backstage/rugvip/tsbumps
cli: switch tsconfig to default to bundler resolution
2025-12-02 23:31:11 +01:00
Patrik Oldsberg f8dff944fd cli: switch tsconfig to default to bundler resolution
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-02 22:25:00 +01:00
Patrik Oldsberg fafd9e10e1 cli: fix yargs usage
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-02 22:24:59 +01:00
Fredrik Adelöw 7684908dfc Merge pull request #31614 from backstage/renovate/pmmmwh-react-refresh-webpack-plugin-0.x
chore(deps): update dependency @pmmmwh/react-refresh-webpack-plugin to ^0.6.0
2025-12-02 21:40:12 +01:00
Fredrik Adelöw ca4a40d0a8 Merge pull request #31928 from backstage/dependabot/npm_and_yarn/express-4.22.0
chore(deps): bump express from 4.21.2 to 4.22.0
2025-12-02 21:14:00 +01:00
dependabot[bot] de96a60f7a chore(deps): bump express from 4.21.2 to 4.22.0
Bumps [express](https://github.com/expressjs/express) from 4.21.2 to 4.22.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.22.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.2...4.22.0)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 4.22.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 20:33:46 +01:00
github-actions[bot] 336db00d21 Version Packages (next) 2025-12-02 15:37:41 +00:00
Patrik Oldsberg e750be29b5 cli: remove redundant util
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-30 10:44:37 +01:00
Patrik Oldsberg ab13a89744 cli-common: polish API surface for run
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-30 10:41:06 +01:00
Patrik Oldsberg 7fbac5cfac cli: update to use new run utils from cli-common
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-30 10:41:05 +01:00
renovate[bot] f89a074d86 chore(deps): update dependency @pmmmwh/react-refresh-webpack-plugin to ^0.6.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-29 03:01:58 +00:00
ElaineDeMattosSilvaB 35002fb261 fix: add react-router-dom to peer deps
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
2025-11-26 13:15:09 +01:00
github-actions[bot] 756986e5e7 Version Packages (next) 2025-11-25 16:21:32 +00:00
Ben Lambert e2c6671a03 Merge pull request #31381 from enyineer/fix/create-app-with-proxy
Allow configuration of Proxy when using create-app CLI
2025-11-25 10:25:23 +01:00
github-actions[bot] 792f4d7e3d Version Packages 2025-11-18 12:23:09 +00:00
ElaineDeMattosSilvaB 3acce8c969 fix(cli): add react-dom to peer and dev dependencies in frontend plugin template
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
2025-11-15 07:56:41 +01:00
ElaineDeMattosSilvaB 8e04d757d9 fix(tests): add test case for scopes starting with @
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
2025-11-15 07:20:46 +01:00
ElaineDeMattosSilvaB 35074cae19 fix(cli): prevent double @ prefix when using --scope flag
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
2025-11-15 06:56:43 +01:00
enyineer 84a0dff66f Refactor naming of proxy bootstrapping function
Signed-off-by: enyineer <nico.enking@gmail.com>
2025-11-12 15:02:04 +01:00