Commit Graph

85 Commits

Author SHA1 Message Date
renovate[bot] 2bc7595dfa chore(deps): update dependency snyk-nodejs-lockfile-parser to v2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-11 12:41:43 +00: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 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
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] c24788d5bb Version Packages 2025-12-16 14:08:20 +00:00
github-actions[bot] 756986e5e7 Version Packages (next) 2025-11-25 16:21:32 +00:00
Hellgren Heikki 606f2c1f71 chore: use BACKSTAGE_VERSIONS_BASE_URL instead
Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
2025-09-17 09:00:02 +03:00
Hellgren Heikki d4b682feaf feat(yarn-plugin): custom manifest location
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>
2025-09-12 08:18:33 +03:00
Riley Martine 6474b04936 Add detail in error messages when yarn plugin can't detect backstage version
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>
2025-09-03 14:58:40 -06:00
github-actions[bot] 9a7cae26c9 Version Packages 2025-07-15 14:26:41 +00:00
github-actions[bot] 952cefedd8 Version Packages (next) 2025-07-01 11:50:02 +00:00
Przemek d6c4e64431 do not check the message content when verifying if console.info was called in tests
Update packages/yarn-plugin/src/handlers/afterWorkspaceDependencyAddition.test.ts

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: Przemek <32961666+eipc16@users.noreply.github.com>
2025-06-26 08:59:24 +02:00
eipc16 d6084b8a05 fix: resolved issue that caused add & replace dependency hook to always fall silently
+ 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>
2025-06-25 13:28:06 +02:00
github-actions[bot] 58558ef2c1 Version Packages 2025-06-17 12:45:56 +00:00
Cory Steers a353f9364c implement sugested changes
Signed-off-by: Cory Steers <cory.steers.gmu9@statefarm.com>
2025-06-16 10:42:52 -05:00
Cory Steers 348f82edd2 Merge branch 'master' into address_yarn_add 2025-06-16 10:03:24 -05:00
Cory Steers 52f5f431d0 update to include 3rd hooks import
Signed-off-by: Cory Steers <cory.steers.gmu9@statefarm.com>
2025-05-30 12:41:39 -05:00
Cory Steers 1115791e35 formatting fixes
Signed-off-by: Cory Steers <cory.steers.gmu9@statefarm.com>
2025-05-30 12:37:22 -05:00
Cory Steers 95955c21f2 update with doc on new hooks added
Signed-off-by: Cory Steers <cory.steers.gmu9@statefarm.com>
2025-05-30 10:47:15 -05:00
Cory Steers 797688a944 enhance logic to make sure backstage can manage the version of the dependency before changing the range
Signed-off-by: Cory Steers <cory.steers.gmu9@statefarm.com>
2025-05-30 10:23:28 -05:00
Cory Steers a0f9e4efce first cut at addressing bug with adding backstage dependencies to a package maintained by the backstage plugin
Signed-off-by: Cory Steers <cory.steers.gmu9@statefarm.com>
2025-05-29 15:21:37 -05:00
github-actions[bot] 389d265b60 Version Packages 2025-05-20 08:25:02 +00:00
github-actions[bot] 1c0cb7be17 Version Packages (next) 2025-05-13 13:52:18 +00: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] ce2cf32847 Version Packages (next) 2025-04-22 12:36:56 +00:00
Vincenzo Scamporlino 9f6d8c557f yarn-plugin: clarify errors
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-04-22 13:42:11 +02:00
Vincenzo Scamporlino f20e3ba235 yarn-plugin: fix docs typo
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-04-22 13:41:41 +02:00
Vincenzo Scamporlino 7555776ed7 yarn-plugin: add tests for BackstageNpmResolver
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-04-22 13:41:11 +02:00
Vincenzo Scamporlino d67ea76f04 yarn-plugin: update deps and patch @yarnpkg/plugin-npm
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-04-22 13:41:11 +02:00
MT Lewis e400827873 yarn-plugin: add architecture overview to readme
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2025-04-22 13:40:48 +02:00
MT Lewis fd70d8661e yarn-plugin: include both backstage: and npm:
ranges in lockfile

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2025-04-22 13:40:47 +02:00
MT Lewis 3ebbc6b48f yarn-plugin: add failing test for snyk lockfile parsing issue
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>
2025-04-22 13:40:25 +02:00
Axel Hecht 45c37538f5 Add missing reports, only skip canon
Canon uses a different setup for storybook

Signed-off-by: Axel Hecht <axel@pike.org>
2025-01-20 15:32:35 +01:00
MT Lewis 15de7a09c9 yarn-plugin: set timout to 30s for all tests and hooks in index suite
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2025-01-07 12:31:45 +00:00
MT Lewis 43566de4e9 yarn-plugin: add integration test suite
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>
2025-01-07 12:31:45 +00:00
MT Lewis d1fd317e32 yarn-plugin: document local development of yarn plugin
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2025-01-07 01:12:08 +00:00
github-actions[bot] cfdf107d34 Version Packages 2024-12-17 10:54:05 +00:00
MT Lewis 58c27def47 yarn-plugin: refactor retrieval of workspace root portable path for testability
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-12-16 20:04:17 +00:00
MT Lewis 7d83df0ad6 yarn-plugin: memoize loading of backstage.json
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-12-16 20:04:17 +00:00
MT Lewis ac91864de3 yarn-plugin: rewrite using reduceDependency hook
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>
2024-12-16 20:04:17 +00:00
davidgiga1993 ee49cb4af9 fix: wrong usage of fslib causes wrong paths to be used on windows
Signed-off-by: davidgiga1993 <davidgiga1993@gmail.com>
2024-12-16 11:22:56 +01:00
github-actions[bot] d8f9e72384 Version Packages (next) 2024-12-03 13:18:49 +00:00
Patrik Oldsberg 9d80ffc6fe Merge pull request #27938 from backstage/yarn-plugin-http-utils
yarn-plugin: use yarn's httpUtils to fetch release manifests
2024-12-02 12:32:40 +01:00
MT Lewis 48cc7c5245 yarn-plugin: use yarn's httpUtils to fetch release manifests
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>
2024-12-01 18:11:45 +00:00
MT Lewis 97490f1f75 yarn-plugin: backfill changelog
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>
2024-12-01 18:02:02 +00:00
github-actions[bot] b86975e7fb Version Packages (next) 2024-11-26 11:10:07 +00:00