Skip to content

update Lerna to v7#8062

Closed
turadg wants to merge 3 commits intomasterfrom
ta/lerna-7
Closed

update Lerna to v7#8062
turadg wants to merge 3 commits intomasterfrom
ta/lerna-7

Conversation

@turadg
Copy link
Member

@turadg turadg commented Jul 18, 2023

closes: #4660

Description

Instead of removing Lerna, double down. Upgrade to v7.

https://github.com/lerna/lerna/blob/main/CHANGELOG.md#700-2023-06-08 lists breaking changes:

  • node v14 support is dropped because it is end of life
    • fine
  • legacy package management commands have been removed
    • unused
  • Workspaces are used by default and useWorkspaces has been removed
    • updated
  • lerna init can no longer be run on an existing lerna repo
    • unused
  • long deprecated options have been removed
    • unused

The two local patches are no longer necessary because they have been fixed.

Security Considerations

Adopting NX could be problematic but this disables it.

Scaling Considerations

n/a

Documentation Considerations

Should work exactly the same.

Testing Considerations

I don't know how to safely validate the MAINTAINERS.md instructions. Looking to @gibson042 for what he'd want to see for confidence it will work.

The lerna publish commands are tested by some CI integration tests.

@turadg turadg requested review from kriskowal and michaelfig July 18, 2023 21:01
@michaelfig

This comment was marked as resolved.

michaelfig

This comment was marked as resolved.

@turadg turadg mentioned this pull request Jul 24, 2023
1 task
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 7, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 62bcab8
Status: ✅  Deploy successful!
Preview URL: https://3a0041c5.agoric-sdk.pages.dev
Branch Preview URL: https://ta-lerna-7.agoric-sdk.pages.dev

View logs

@turadg turadg marked this pull request as ready for review October 7, 2024 20:30
@turadg turadg requested a review from a team as a code owner October 7, 2024 20:30
@turadg turadg requested review from gibson042 and michaelfig October 7, 2024 20:30
Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@turadg turadg added the force:integration Force integration tests to run on PR label Oct 8, 2024
@gibson042
Copy link
Member

gibson042 commented Oct 8, 2024

Looking to @gibson042 for what he'd want to see for confidence it will work.

Hmm, that's a good question. I guess I'd want a head-to-head comparison of the non-publish lerna commands in MAINTAINERS.md (particularly yarn lerna version and ./scripts/npm-dist-tag.sh [--dry-run] lerna add <TAG>) against an appropriate HEAD that includes vs. does not include these changes, and a subsequent verification that they have exactly the same effects on the git repository and equivalent output/results.

Also adding @mhofman for further feedback.

@gibson042 gibson042 requested a review from mhofman October 8, 2024 17:27
@mhofman
Copy link
Member

mhofman commented Oct 8, 2024

Hmm, that's a good question. I guess I'd want a head-to-head comparison of the non-publish lerna commands in MAINTAINERS.md (particularly yarn lerna version and ./scripts/npm-dist-tag.sh [--dry-run] lerna add <TAG>) against an appropriate HEAD that includes vs. does not include these changes, and a subsequent verification that they have exactly the same effects on the git repository and equivalent output/results.

This exactly.

I also remember a previous attempt at upgrading lerna that had to be reverted / abandoned. Might be worth digging that out to see what went wrong then.

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into it, the previous issue when upgrading to 5 was with pre-release semver, which was addressed by a patch we're removing here. I'd like to see some validation of that the behavior we want is preserved.

Comment on lines -9 to -17
+ // Don't gratuitously break compatibility with clients using `^0.x.y`.
+ if (semver.major(pkg.version) === 0) {
+ if (releaseType === "major") {
+ releaseType = "minor";
+ } else if (releaseType === "minor") {
+ releaseType = "patch";
+ }
+ }
+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change no longer necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That check is only applicable for non pre-release, which is the problem we had with lerna 5, See #8242

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I elected to ramp all packages into non-zero major versions rather than maintain the Lerna patch going forward.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the problem that lerna will elect to use a new 1.x version for pre-release but when cutting the final release it will keep using a 0.x version?

"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-require-extensions": "^0.1.3",
"lerna": "^5.6.2",
"lerna": "^7.4.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why stop at 7 and not go all the way to 8 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not wanting to take additional risk. v7 has enough to drop the patches.

https://github.com/lerna/lerna/blob/main/CHANGELOG.md#breaking-changes seems like it wouldn't require more work but it also isn't compelling

@turadg turadg marked this pull request as draft October 16, 2024 21:17
@turadg turadg mentioned this pull request May 29, 2025
@turadg
Copy link
Member Author

turadg commented Jul 24, 2025

Superseded by #11503

@turadg turadg closed this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

force:integration Force integration tests to run on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove Lerna

5 participants