122 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
Jon Koops 46ff47034c refactor(cli-common): deprecate bootstrapEnvProxyAgents() in favor of Node.js built-in proxy support
Node.js 22.21.0+ and 24.5.0+ support proxy configuration natively
via NODE_USE_ENV_PROXY=1 and --use-env-proxy, making the legacy
global-agent and undici proxy workarounds unnecessary.

Rather than removing the function immediately, deprecate it with
context-aware runtime warnings that guide users based on their
current configuration:

- Users with GLOBAL_AGENT_* vars are told to switch to standard
  HTTP_PROXY/HTTPS_PROXY and set NODE_USE_ENV_PROXY=1.
- Users with HTTP_PROXY/HTTPS_PROXY but no NODE_USE_ENV_PROXY are
  told to set it.
- Users who have already opted in to Node.js built-in proxy see no
  warning, and the legacy bootstrap is skipped entirely.

See #33444

Signed-off-by: Jon Koops <jonkoops@gmail.com>
2026-04-10 16:53:33 +02: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
dependabot[bot] e928e7387c chore(deps): bump undici from 7.22.0 to 7.24.0
Bumps [undici](https://github.com/nodejs/undici) from 7.22.0 to 7.24.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v7.22.0...v7.24.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.24.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-20 09:24:58 +00:00
github-actions[bot] 5725b5fcfa Version Packages 2026-03-17 21:39:07 +00:00
github-actions[bot] ed7c4e3bef Version Packages (next) 2026-03-10 17:34:12 +00:00
Fredrik Adelöw 918b697cbd Add test verifying runCheck does not leak stdio
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-04 17:41:08 +01:00
Fredrik Adelöw 9361965db9 Fix runCheck to ignore stdio of spawned process
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-04 17:33:29 +01:00
github-actions[bot] db0d171511 Version Packages (next) 2026-03-03 14:16:49 +00:00
Gabriel Dugny 3187a7a441 Merge remote-tracking branch 'origin/master' into package-workspaces 2026-02-27 12:05:03 +01:00
Patrik Oldsberg a92ae1eb42 Merge pull request #32987 from backstage/rugvip/cli-common-path-cleanup
cli-common: clean up path utils follow-up
2026-02-25 14:27:29 +01:00
Gabriel Dugny 8ea65069f1 Merge branch 'master' into package-workspaces
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>

# Conflicts:
#	packages/cli-node/src/pacman/yarn/Yarn.test.ts
#	packages/cli-node/src/pacman/yarn/Yarn.ts
2026-02-25 09:11:36 +01:00
Patrik Oldsberg e44b6a9079 cli-common: Remove unused findOwnDir and validate findOwnRootDir
Addresses review feedback from PR #32939:
- Remove the `findOwnDir` function which is no longer needed
- Add validation to `findOwnRootDir` to verify the resolved path
  actually contains a monorepo root with a `package.json` that has
  a `workspaces` field

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-24 21:56:35 +01:00
github-actions[bot] 4bd6a3a1af Version Packages (next) 2026-02-24 19:24:06 +00:00
Patrik Oldsberg ebc01ef04d Add overrideTargetPaths test utility and fix rebase issues
Adds `overrideTargetPaths` to `@backstage/cli-common/testUtils` for
cleanly mocking `targetPaths` in tests without `jest.mock` or
`jest.spyOn`. Migrates all existing test mocks to use the new utility.

Also fixes translations module imports broken by the rebase.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 17:25:31 +01:00
Patrik Oldsberg 553e727d5f Fix lint errors: add eslint-disable for __dirname, fix no-use-before-define
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-23 14:44:11 +01: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
Patrik Oldsberg 29e91e9159 Give each CLI module its own paths instead of importing from lib/
Split the paths API in @backstage/cli-common into targetPaths (a lazily
initialized singleton for cwd-based paths) and findOwnPaths (a cached function
for package-relative paths). Most CLI module files only need target paths, which
can now be imported directly without __dirname. The few files that need own paths
use findOwnPaths(__dirname).

Added hierarchical caching to findOwnDir so the filesystem walk only happens
once per package. targetPaths re-resolves automatically if process.cwd() changes.

The deprecated findPaths function is preserved for backward compatibility,
delegating to the new primitives internally.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 14:44:10 +01:00
Patrik Oldsberg 56bd494b0c Give each CLI module its own paths instead of importing from lib/
Each module file that needs paths now calls findPaths(__dirname) directly from
@backstage/cli-common. This removes the coupling between modules and lib/paths,
and will continue to work when modules are extracted into separate packages since
each package's __dirname resolves to its own root.

Added hierarchical caching to findOwnDir in cli-common so that the filesystem
walk only happens once per package - subsequent calls from sibling directories
hit the cache at a common ancestor.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 14:44:10 +01:00
Gabriel Dugny 0e5fd0fd27 Revert most changes
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-02-22 17:07:00 +01:00
Gabriel Dugny b2d9d78c27 fix: defensive package.json reading
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-02-22 16:50:55 +01:00
Gabriel Dugny a9d23c4a32 fix: Support workspaces in CLIs
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-02-22 16:50:55 +01: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] 2e902e7b43 Version Packages 2026-01-20 16:40:05 +00:00
Ben Lambert ae4dd5d157 Merge commit from fork 2026-01-20 16:04:33 +01:00
github-actions[bot] c24788d5bb Version Packages 2025-12-16 14:08:20 +00:00
github-actions[bot] e08f48a9b5 Version Packages (next) 2025-12-09 15:00:09 +00: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
github-actions[bot] 336db00d21 Version Packages (next) 2025-12-02 15:37:41 +00:00
Patrik Oldsberg 6359995329 cli-common: cleanup and polish waitForExit
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-30 10:44:36 +01:00
Patrik Oldsberg 788ed91649 cli-common: cover run utils with tests
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-30 10:41:06 +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 5cfb2a4ea8 cli-common: add unified run utils
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-30 10:22:58 +01:00
github-actions[bot] 756986e5e7 Version Packages (next) 2025-11-25 16:21:32 +00:00
enyineer 1a483ed02f Remove undici and old mocks
Signed-off-by: enyineer <nico.enking@gmail.com>
2025-11-19 10:11:12 +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
enyineer 235c67ae99 Add API doc for maybeBootstrapProxy
Signed-off-by: enyineer <nico.enking@gmail.com>
2025-10-10 10:38:34 +02:00
enyineer f553c56556 Add undici and global-agent as dependencies
Signed-off-by: enyineer <nico.enking@gmail.com>
2025-10-10 10:14:38 +02:00
enyineer cdbec2e0d5 Add proxy to create-app tasks
Signed-off-by: enyineer <nico.enking@gmail.com>
2025-10-10 10:14:38 +02: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] 1552f03186 Version Packages 2024-11-19 11:21:20 +00:00
github-actions[bot] 7ffb8eedd7 Version Packages (next) 2024-10-28 13:06:13 +00:00
Andre Wanlin 702f41dd01 Updated to Node 20 and 22
Signed-off-by: Andre Wanlin <awanlin@spotify.com>
Co-authored-by: Patrik Oldsberg <patriko@spotify.com>
2024-10-22 22:02:30 +02:00