Commit Graph

19 Commits

Author SHA1 Message Date
MT Lewis bd32d5a999 yarn-plugin: add additional check during pack to confirm that all backstage versions have been replaced
Adds an additional check during pack which walks all the
dependencies in the manifest, and verifies that
there are no remaining `backstage:` versions.
I'm not aware of any realistic cases where the
code that does the replacement would be expected
to fail, but since a backstage:^ package in the
manifest will break the release, it seems prudent
to double check and fail fast to allow us to catch
unexpected results.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-09-16 11:44:01 +01:00
Patrik Oldsberg 5eb1c4addf Merge pull request #25804 from backstage/yarn-plugin-get-satisfying
yarn-plugin: implement `BackstageResolver#getSatisfying`
2024-08-07 14:55:07 +02:00
MT Lewis 9e2918640a yarn-plugin: implement BackstageResolver#getSatisfying
It turns out this method is called for
`backstage:` descriptors during `yarn dedupe`, so
we need to implement it.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-07-27 14:29:01 +01:00
MT Lewis b207f69ba1 yarn-plugin: memoize manifest fetching
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-07-27 14:10:15 +01:00
MT Lewis a8bd40162c yarn-plugin: validate version of yarn in yarn plugin
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-07-11 12:10:10 +01:00
github-actions[bot] 18a40424cb Version Packages 2024-06-18 12:37:38 +00:00
github-actions[bot] e83ead9b1a Version Packages (next) 2024-06-11 15:25:17 +00:00
MT Lewis 573e98b352 yarn-plugin: use findPaths from cli-common instead of custom findWorkspaceRoot implementation
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:59 +01:00
MT Lewis 95d7234e91 yarn-plugin: expand error message when package is missing from version manifest
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:59 +01:00
MT Lewis acc7caa715 yarn-plugin: add some explanatory comments to BackstageResolver
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:59 +01:00
MT Lewis c24bc371eb yarn-plugin: add unit tests
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:57 +01:00
MT Lewis 7763950ed5 yarn-plugin: ensure getCurrentBackstageVersion works anywhere in the workspace
Previously this method only worked in the
workspace root. A bit verbose and manual to make
this work, because it needs to be synchronous.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:57 +01:00
MT Lewis 831b0e6314 yarn-plugin: do not attempt to convert backstage: versions in peerDependencies
Yarn does not support protocols other than npm and
workspace for peerDependencies - any other
protocols will produce an error and be converted
to '*' when running yarn. This change matches that
limitation in the beforeWorkspacePacking hook.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:57 +01:00
MT Lewis 97ffd7ec18 yarn-plugin: replace backstage:^ with ^ ranges when packing
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:57 +01:00
MT Lewis 038f851c28 yarn-plugin: support only "backstage:^"
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:56 +01:00
MT Lewis 8fb936d9b0 yarn-plugin: add .gitignore for builder output
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:56 +01:00
MT Lewis 612d471d29 yarn-plugin: handle packing step
This commit introduces a beforeWorkspacePacking
hook which converts `backstage:` versions back
into `npm:`` versions when packages are packed for
publish. This allows the `backstage:` protocol to
be used even for packages that are intended to
themselves be published (such as packages in
third-party Backstage plugin monorepos outside
core).

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:56 +01:00
MT Lewis 197a51625c yarn-plugin: api report
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:56 +01:00
MT Lewis eaa7500130 yarn-plugin: add initial version of plugin
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-06-04 17:03:54 +01:00