Skip to content
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

Steps to take when updating dependencies #1655

Closed
tlylt opened this issue Aug 21, 2021 · 1 comment · Fixed by #1659
Closed

Steps to take when updating dependencies #1655

tlylt opened this issue Aug 21, 2021 · 1 comment · Fixed by #1659

Comments

@tlylt
Copy link
Contributor

tlylt commented Aug 21, 2021

Hi active devs,

I updated the commander.js version under packages/cli in a recent PR by updating the package.json (and correspondingly the package-lock.json) in packages/cli. Then today I was checking out one of my PR branch on another machine and decided to run npm run setup again to update all relevant dependencies. After running the npm run setup command, the main package-lock.json file in the root directory was modified. I am not sure but it seems like it might be a result of a recent dependency changes.

From the developer guide, I see that it mentions

Hence, instead of manually updating the version numbers in the packages' package.json files, you may consider using the lerna add command to speed things up!".

I did not use lerna add as I was doing a dependency update and wasn't sure if there is a difference between adding and updating in lerna's context.

So my question is:
when adding/updating/deleting dependencies, do we have to rerun npm run setup to verify that the main package-lock.json is updated correctly? And is it correct to run npm commands in sub packages when updating/deleting dependencies? I don't see any lerna commands with regards to this... in fact the following:
image

Wondering if any of the senior devs who are more familiar with lerna could share some of the common commands used and perhaps we can thereafter add them into the developer guide.

Thanks!

@ang-zeyu
Copy link
Contributor

I updated the commander.js version under packages/cli in a recent PR by updating the package.json (and correspondingly the package-lock.json)

Wondering if any of the senior devs who are more familiar with lerna could share some of the common commands used and perhaps we can thereafter add them into the developer guide.

This part is indeed not well documented at the moment, I think we could:

  • add the above instructions in (that's a valid approach (edit package-lock -> re run npm run setup))
  • + maybe update the lerna add section, with --scope (I missed this out when writing that part), or just remove it entirely since there isn't a corresponding lerna remove per your screenshot 😉 (I'm favouring the latter)

Then today I was checking out one of my PR branch on another machine and decided to run npm run setup again to update all relevant dependencies.

Thanks for the catch. That slipped by from another PR, I've removed the extra changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants