-
Notifications
You must be signed in to change notification settings - Fork 258
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
Tool specs and fetch/install/pin refactoring #234
Conversation
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.
Looks great! So much tool-specific code deleted!
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.
Awesome work! I have a few questions about some of the type structure. It might help to chat about some of them -- ping me on discord whenever.
@mikrostew and I spent some time thinking about how to make it more static and it was nonobvious enough that I think it's better to go with the enum for now and file a code quality issue for making it more static later. |
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.
Looks great!
I was planning to only do #173, but some of that was also tangled up with #174, so I combined both into this PR.
Notes
First thing I implemented was
tool::ToolSpec
, to encapsulate a tool (Node/Yarn/Npm/Npx/Package) and aVersionSpec
. This makes it easy to use for fetch/install/pin, which I abstracted to general-purpose functions instead of having things likeinstall_node
andinstall_yarn
andinstall_xxx
. That in turn made the command implementation simpler, since they no longer have to parse out the tool and figure out which function to call.I also initially implemented a
tool::Tool
enum (like in #173), but didn't need it for anything so I took it back out.I didn't move the
shim
code intotool::ToolSpec
as mentioned in #173. It didn't seem to fit at this point, but that may need to be part of #175.Bonus
Fixed a bug in
notion-core/src/toolchain/mod.rs
where the platform file had been changed to using JSON (in #220), but saving an empty platform instance would result in[platform]
being written to the file.Closes #173
Closes #174
Closes #87