Commit Graph

149 Commits

Author SHA1 Message Date
Gabriel Dugny 3187a7a441 Merge remote-tracking branch 'origin/master' into package-workspaces 2026-02-27 12:05:03 +01:00
Patrik Oldsberg 09eb6b5187 Address further review feedback
- Rename hasYarnPlugin -> hasBackstageYarnPlugin for clarity
- Change SuccessCache.create to accept an options object

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-25 20:17:47 +01:00
Patrik Oldsberg 968570bbb5 Address review feedback
- Remove cli changeset, piggy-back on existing ones
- Rename getHasYarnPlugin -> hasYarnPlugin(workspaceDir?)
- Make SuccessCache constructor private, add static create()
- Consolidate duplicate @backstage/cli-node imports

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-25 20:17:47 +01:00
Patrik Oldsberg 3c811bf8a9 cli-node, cli: move yarnPlugin and SuccessCache to cli-node
Move `getHasYarnPlugin` and `SuccessCache` from `@backstage/cli` internal
modules to `@backstage/cli-node` as public exports, making them available
for reuse by other CLI tooling.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-25 20:17:22 +01:00
Patrik Oldsberg 5033936401 Keep versioning utilities internal to CLI migrate module
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-25 14:09:25 +01:00
Patrik Oldsberg 61cb976207 Consolidate Lockfile classes: move toString() and versioning utils to cli-node
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-25 11:59:30 +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
github-actions[bot] 4bd6a3a1af Version Packages (next) 2026-02-24 19:24:06 +00:00
Patrik Oldsberg 641d88cb07 Address PR review comments
- Remove cli-node/src/paths.ts compat layer, migrate all cli-node
  internal usage to import targetPaths from @backstage/cli-common
- Use single-arg overrideTargetPaths('/root') where dir === rootDir
- Scope mockDir to each describe block in bump.test.ts to avoid
  shared state issues with overrideTargetPaths
- Remove unnecessary overrideTargetPaths from plugin-manager.test.ts
- Remove stale findPaths mock from createApp.test.ts
- Use overrideTargetPaths in getWorkspaceRoot.test.ts and cli-node tests

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 21:01:27 +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 f467a4126e Return object from runWorkerQueueThreads
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 11:38:23 +01:00
Patrik Oldsberg 90ffb54552 Rename parallel/ to concurrency/ and split into separate files
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 11:21:51 +01:00
Patrik Oldsberg 67958e2d6c Fix prettier formatting
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 10:59:43 +01:00
Patrik Oldsberg 4f0c7ec86a Address PR review feedback
- Rename runParallelWorkers to runConcurrentTasks, return void
- Rename ParallelWorkerOptions to ConcurrentTasksOptions
- Rename parallelismFactor to concurrencyFactor
- Remove unused runWorkerThreads and WorkerThreadsOptions
- Rename workerData to context in WorkerQueueThreadsOptions
- Drop threadCount from public API types
- Rename env var to BACKSTAGE_CLI_CONCURRENCY
- Make cli-node changeset a patch

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 00:41:17 +01:00
Gabriel Dugny bc6c024a4c chore: remove PackageManager getMonorepoPackages
Unused, prefer @manypkg/get-packages's getPackages instead.

Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-02-22 17:26:35 +01:00
Patrik Oldsberg c8237e212d Rename parallelism env var to BACKSTAGE_CLI_PARALLELISM
Renames from BACKSTAGE_CLI_BUILD_PARALLEL to the more general
BACKSTAGE_CLI_PARALLELISM. The old name is still supported but
logs a one-time deprecation warning.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-22 17:20:16 +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
Patrik Oldsberg 649d3ca3b6 Remove dead parallelism options and narrow public API
The parallelism fields on bundler types (BundlingOptions, BuildOptions,
BackendBundlingOptions) and createDistWorkspace Options were defined but
never read — fully dead code. Likewise the parallelismSetting option on
ParallelWorkerOptions was never passed by any caller.

Also narrows the cli-node public API to only export the three runner
functions and their option types, keeping getEnvironmentParallelism and
parseParallelismOption as internal utilities.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-22 16:49:55 +01:00
Patrik Oldsberg 06c2015e5b Move parallel worker utilities to @backstage/cli-node
Moves `runParallelWorkers`, `runWorkerQueueThreads`, `runWorkerThreads`,
`parseParallelismOption`, and `getEnvironmentParallelism` from the CLI
internal lib to the shared `@backstage/cli-node` package.

This is part of the ongoing effort to make CLI modules independent of
each other and the shared lib code.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-22 16:19:49 +01:00
github-actions[bot] e6df5d52ce Version Packages 2026-02-17 16:06:18 +00:00
github-actions[bot] 1ea737c1e2 Version Packages (next) 2026-02-03 14:24:29 +00:00
Patrik Oldsberg 5e3ef57e4e switch from backstage.integrationFor to backstage.peerModules
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-02 22:57:06 +01:00
Patrik Oldsberg f5d56be363 Update API report for cli-node
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-02 22:48:05 +01:00
Patrik Oldsberg 7bd7ed5b31 Add integrationFor validation to repo fix command
- Added integrationFor field to BackstagePackageJson type
- Created fixIntegrationFor validator that ensures:
  - Field is only used on module packages
  - Value is an array of strings
  - All entries are valid package names
- Added validator to the publish fixers list

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-02 22:48:05 +01:00
github-actions[bot] d4b85dddee Version Packages (next) 2026-01-27 15:51:11 +00:00
Fredrik Adelöw f02219a054 Merge pull request #32516 from backstage/freben/nodecolon
Add a rule for the use of `node:` prefix on native imports
2026-01-27 14:17:14 +01:00
Fredrik Adelöw 69d880e171 Bump to latest zod
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-01-26 13:52:02 +01: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
github-actions[bot] 336db00d21 Version Packages (next) 2025-12-02 15:37:41 +00:00
Patrik Oldsberg 4e8c7261e9 cli-node: update to use new run utils from cli-common
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-30 10:22:59 +01: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
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
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
github-actions[bot] b93a3471c2 Version Packages 2025-08-19 13:01:39 +00:00
MT Lewis d9a78351b4 cli-node: add get and keys methods to Lockfile class
There are a few of these classes floating around
the codebase - my hope by adding these methods
here is that we can start unifying around this
shared implementation.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2025-08-08 22:11:58 +01: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] 0df84b6ae4 Version Packages 2025-02-18 15:19:53 +00:00
github-actions[bot] 5aa499b953 Version Packages (next) 2025-02-04 12:36:25 +00:00
Harrison Hogg f54eed0a7a Add default feature type information to backstage metadata
Signed-off-by: Harrison Hogg <hhogg@spotify.com>
2025-01-31 14:58:01 +00: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
github-actions[bot] 43f666371b Version Packages 2025-01-14 12:23:31 +00:00
github-actions[bot] 0980e400a0 Version Packages (next) 2025-01-07 15:04:17 +00:00