Remove @alpha tags from translation-related types and switch all
translation API imports in new frontend system packages to use stable
paths from @backstage/frontend-plugin-api instead of
@backstage/core-plugin-api/alpha.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
- 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>
Strengthens BgPropsConstraint to also check that children is
present and non-optional in the OwnProps type of bg provider
components. This ensures children can only flow through
childrenWithBgProvider, preventing silent bypasses of the bg
context system.
Box and Accordion OwnProps updated to comply — children is now
required. BoxProps updated to Omit children from
React.HTMLAttributes to avoid an incompatible duplicate property
declaration. Storybook stories updated accordingly.
Signed-off-by: Johan Persson <johanopersson@gmail.com>
Extract prop-splitting and responsive resolution with default
fallbacks from `useDefinition` into a new `resolveDefinitionProps`
helper. This makes `propDefs.default` the single authoritative
source of truth for default values.
Previously, `useBgProvider` had a separate manual default lookup
(`props.bg ?? (definition.propDefs as any).bg?.default`) that
duplicated the main resolution loop.
Signed-off-by: Johan Persson <johanopersson@gmail.com>
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>
- 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>
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>
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>
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>
Each module now has a local paths.ts that calls findPaths(__dirname) directly.
This makes modules fully independent of lib/paths.ts, and the pattern will
continue to work when modules are extracted into separate packages since each
package's __dirname will resolve to its own root.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Fix whitespace alignment in CLI command summary, improve export command
description to clarify it operates from an app context, and update the
corresponding docs section.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- 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>