New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: migrate from lerna
to lerna-lite
#13097
Conversation
@ghiscoding I'm trying to publish, but I get This is a typical diff - changing the versions of (dev) deps, but not the Prompt before publish, fwiw: |
(I'm happy to discuss this over in your repo, btw) |
@SimenB So can you post the lerna-lite notice === Tarball Details ===
lerna-lite notice name: @lerna-lite/cli
lerna-lite notice version: 1.4.2
lerna-lite notice filename: lerna-lite-cli-1.4.2.tgz
lerna-lite notice package size: 14.9 kB
lerna-lite notice unpacked size: 68.2 kB
lerna-lite notice shasum: 10fa5b50f555adc46f2c651e579cda8d04037370
lerna-lite notice integrity: sha512-0hsvQ+NI0URkX[...]8hS6KLOWh5flA==
lerna-lite notice total files: 39
lerna-lite notice --- dry-run details ---
lerna-lite notice temp location: C:\Temp\16f72185-bd88-499d-89d2-1b5756b00df1\lerna-lite-cli-1.4.2.tgz
lerna-lite notice package name: @lerna-lite/cli
lerna-lite notice dependencies:
lerna-lite notice @lerna-lite/core | ^1.4.2
lerna-lite notice @lerna-lite/info | 1.4.2
lerna-lite notice @lerna-lite/init | ^1.4.2
lerna-lite notice @lerna-lite/publish | 1.4.2
lerna-lite notice @lerna-lite/version | ^1.4.2
lerna-lite notice dedent | ^0.7.0
lerna-lite notice dotenv | ^16.0.1
lerna-lite notice import-local | ^3.1.0
lerna-lite notice npmlog | ^6.0.2
lerna-lite notice yargs | ^17.5.1
lerna-lite notice
lerna-lite info dry-run> git checkout -- package.json packages\cli\package.json packages\core\package.json packages\exec\package.json packages\info\package.json packages\init\package.json packages\list\package.json packages\optional-cmd-common\package.json packages\publish\package.json packages\run\package.json packages\version\package.json
Successfully published:
- @lerna-lite/cli@1.4.2 BTW, the bump is coming from Lerna's default code, I didn't change that behavior but I'm not sure why it doesn't work in your use case. In this old Lerna issue the maintainer asked if he had lifecycle script that could interfere? though it was fixed few years back. What you could try maybe is to rollback 1 of the There's also this commit from evocateur, I know it's for canary but perhaps you tried from multiple branches and have name clashing?
I cloned the Jest repo and ran these 2 commands shown below (it might be helpful to see which command you ran) and it seems fine in npx lerna version --git-dry-run and the publish npx lerna publish from-package --git-dry-run |
done some more testing with the Jest repo and I tried couple of commands, still be nice to see which command you ran. I see that this command, identifies all packages to be bumped in the prompt but answering Yes really only update 5x package "version" property, it does however update all package dependencies and that is where the mismatch happens. npx lerna publish --git-dry-run --preid alpha --dist-tag next prerelease however if we use the 2 separate command ( Are you really expecting all packages to be updated as the prompt is showing? or only a few to be updated? |
Hi! Thanks for looking into this 😀 Command I'm running is
Yeah, that seems consistent with the diff in the repo after publishing fails.
No, I pasted the diff thing after running with Which seems somewhat reasonable looking at the diff in |
Yeah I counted them and there were 43 indeed, so I'm not sure why the prompt says 43 (which seems fair) and then it only applies the change to "version" on just 5 of them. It's this mismatch that I need to find where that comes from and again I wouldn't be surprised that it's only happening on prerelease. I downgraded the version of Lerna-Lite down to Also just to be clear, I assume you used this command in the past for prerelease? I assume you did since there was an
That was on the first try before you contacted me, right? Perhaps you can check their "version" property and see if they got bumped, it's a bit weird that you got more than 5 but it might be because you used the force publish flag. I checked 1 of them that didn't appear in the list of 5 I saw, the one I checked was So in summary, I'll look into this with the clone of Jest that I currently have, it does replicate the issue consistently (that is the mismatch between prompt and what it applies). However, I'm not sure how long that will take me to find it because there's a lot of code that I don't understand well in Lerna, so we'll see. I would suggest you keep using the |
@SimenB after troubleshooting with the Jest project, I finally found the problem to be caused by this Lerna PR 2874 - drastically reduce time taken to check for cycles that I replicated in Lerna-Lite (PR 7). I will apply a fix and release a minor version shortly. 😉 |
@SimenB Cheers and happy coding
https://github.com/facebook/jest/blob/6d19139964fa3a422e4b7d31d85d0443adcefc22/lerna.json#L7-L9 Scratch that I just found that you are using indeed Yarn 3.x. so it should be all good then :) |
thanks, was able to publish now! |
Regarding |
glad to see that the fork I worked on doesn't delay Jest releases 🙈
indeed it seems to have no effect as well in Lerna-Lite itself where I enabled it too. I think that it would probably only update the lock file if you have a mix of deps using Cheers |
Thanks for a minimal lerna just for publishing (and no forced |
indeed forcing Nx seems like a bad, but expected, marketing decision, it will remain totally optional in Lerna-Lite so no worries 😉 |
Nice to see lerna-lite adoption from jest! Such a crucial project for whole javascript world. Keep pushing lerna-lite, @ghiscoding 🚀 |
@SimenB |
Ah, good catch 👍 made into prerelease now |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This allows us to use
workspace
protocol.I tried to update to
lerna@5
(without the second commit), but it doesn't likeworkspace
in any workspace, not just the packages to be published (probably due to the newuseWorkspaces: true
flag which then picks out a bunch more workspaces).Test plan
I've played a bit around locally, but I'll publish a new alpha after landing