Closed NthTensor closed 1 week ago
Agreed! This would be a fab addition. I like the suggested gleam deps update <package_1> <package_2>
CLI.
I have an interest in seeing this feature implemented. @NthTensor were you able to get anywhere on this?
I'd like to help land this feature. Before I take a swing (knowing nothing about rust ;), are there any "gotchas" I need to be aware of?
Motivation behind this feature: https://github.com/renovatebot/renovate/pull/31002
Couple thoughts after taking a look under the hood:
gleam update
and gleam deps update
.The previously proposed command was:
gleam update <package names>
gleam deps update <package names>
This retains compatibility with the existing 1.x CLI, and allows the original gleam deps update
command to continue updating all available dependencies. However, this proposal exposes some potential problems for script writers.
Consider the following scenario:
gleam deps update ${PACKAGES}
Where ${PACKAGES}
is undefined. This will result in the Gleam CLI interpreting this command as-if the user intended to update all available dependencies. Instead, we should throw an error of some kind.
This leads me to propose the following CLI:
# updates all available deps
# retained for compatibility, perhaps to be deprecated and eventually removed?
gleam deps update
# explicitly updates all available deps
gleam deps update --all
# update the list of packages
gleam deps update --packages <list of packages>
Effectively, gleam deps update
would become an alias of the more explicit command, gleam deps update --all
.
Then, gleam deps update --packages <packages>
would allow users to safely do something like gleam deps update --packages ${PACKAGES}
. In the event ${PACKAGES}
is undefined or empty, we would throw an error instead of proceeding against the user's intentions.
@lpil Thoughts?
Let's go with the API extension NthTensor suggested.
This would be implemented by unlocking the dependencies specified along with any dependencies they bring in.
Can this issue be closed now that #3602 is merged?
I think this issue is fully covered by #3602. Good to close from in my opinion! :100:
Yes, thank you!
It would be nice to be able to use
gleam deps update <package_1> <package_2>
to update specific packages.Use case: When local dependencies get merged we will have to update them with
gleam deps update
or similar. Unfortunately, this also updates all the other packages.Happy to add this if it seems useful.