-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(cli): add lb4 update command to check/update project dependencies #4080
Conversation
de24daa
to
f53d351
Compare
cbc6ae9
to
3e288c6
Compare
@raymondfeng this will be useful feature. |
@MarkOfSine Thank you for chiming in.
The version of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👇
docs/site/Version-generator.md
Outdated
|
||
### Synopsis | ||
|
||
The `lb4 version` command runs against a LoopBack 4 project and checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the name version
problematic, it does not communicate the fact that it can be used to update dependencies. We already have lb4 --version
to print the version of LoopBack dependencies installed in the project.
I am proposing:
(1)
Improve lb4 --version
to include information about packages that are outdated. At the moment, we print output like this:
$ lb4 --version
@loopback/cli version: 1.24.0
@loopback/* dependencies:
- @loopback/authentication: ^3.2.1
- @loopback/boot: ^1.5.10
...
I am proposing to add a short text after each outdated version, possibly highlighted using chalk.red
:
$ lb4 --version
@loopback/cli version: 1.24.0
@loopback/* dependencies:
- @loopback/authentication: ^3.0.1 (outdated)
- @loopback/boot: ^1.5.10
(2)
Rename the new command to something like lb4 update
or lb4 update-deps
. Personally, I prefer lb4 update
, because it's short and in line with npm update
command that most developers are hopefully familiar with.
This opens a question though - what is the benefit of this LB-specific update command when compared to npm update
? Why (or when?) should our users use this new command instead of npm update
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the benefit of this LB-specific update command when compared to npm update? Why (or when?) should our users use this new command instead of npm update?
It would be awesome if lb4 update
could run scripts to automatically apply changes necessary to migrate the codebase to newer conventions. That would be a perfect explanation why to run lb4 update
instead of npm update
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good to have lb4 update
. The key benefit of lb4 update
over npm update
is that lb4 update
honors the collection of compatible LB4 packages that released with the current lb4
command from @loopback/cli
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please --version
is implemented at cli.js
level without a yeoman generator.
3e288c6
to
9c25402
Compare
@bajtos I have refactored the code to use |
4881a7b
to
6f0f35d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed at high level, will review implementation details next week.
6f0f35d
to
f52a50b
Compare
@bajtos PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any blocking problems, but please consider my comments below.
I am approving this PR to not block the progress, please get at least one person to approve the final patch before landing.
f52a50b
to
5af527b
Compare
Adding
lb4 version
for https://loopback.io/doc/en/lb4/Command-line-interface.html#upgrading-loopback-dependencies:lb4 update
runs against a LB4 project and checks dependencies against the installed@loopback/cli
.lb4 update
checks for exact match. Use--semver
option to check compatibility using semver semantics.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈