- 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>
- 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>
added two environment variables that can be used to control the location
of backstage manifest file used by the yarn plugin. this helps using the
plugin in restricted environments without direct or access at all to the
internet.
closes#31101
Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
I was confused for ~15 minutes today when updating to using the yarn
plugin. It was failing in docker but not locally, and I didn't know why.
It turned out to be because I forgot to copy the backstage.json into the
docker image. This was confusing, because the error seemed to indicate I
was failing the semver checks. This change propagates error detail down
the line, so people will see the actual cause. (i.e. missing file, no
version field, semver wrong)
Signed-off-by: Riley Martine <rmartine@integralads.com>
+ existing implementation did not do anything, because executing `getPackageVersion` always resulted in an error that was then silently suppressed
Signed-off-by: eipc16 <pprzemek.312@gmail.com>
A recent change reintroduced the issue previously
fixed by #27727. To ensure this doesn't regress
again, I'm introducing a test that specifically
checks that lockfile parsing works as expected.
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
The new test suite fully exercises the plugin,
including onboarding and offboarding from the
plugin and the effect on lockfiles.
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
Switching to using the reduceDependency hook
simplifies the plugin, since we can do all the
work in one go. It also means that the yarn.lock
file doesn't need to change when adding and
removing the yarn plugin, which avoids
unintentionally unlocking packages versions.
As part of this change, the descriptor emitted by
the plugin has been changed from
`npm:<manifest-version>` to
`npm:^<manifest-version>`, to match the range
emitted when packing packages. This ensures good
interoperability with the `backstage-cli
build-workspace`, which packs packages into a new
workspace and copies yarn.lock across.
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This allows us to leverage yarn's built in proxy
configuration when making the request. The yarn
HTTP utilities handle caching of GET
requests, so we can remove our memoization of the
request, too.
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
Realised that even though we don't release this
package via npm, it'll still be useful to have an
accurate changelog. With that in mind, this commit
backfills the changes for previous releases, and
I'm proposing that we include changesets for
changes in this package going forward.
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>