-
-
Notifications
You must be signed in to change notification settings - Fork 99
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: Support volta
, asdf
, and package.json engines
for declaring version
#151
base: master
Are you sure you want to change the base?
Conversation
Using the same logic as `actions/setup-node`, we can support `asdf`, `volta` or other version management techniques.
volta
, asdf
, and package.json engines
volta
, asdf
, and package.json engines
for declaring version
const { versionFilePath, packageJsonFile, standalone } = opts | ||
let { version } = opts |
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 weird to destructure it twice. Just use let
for all.
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.
Heh, I agree. I just wanted to change as little as possible from the code I snagged to it was more comparable. I’ll change it though, since that is a less important goal.
version_file_path: | ||
description: "Path to a version file. Eg: '.tool-versions' for asdf or 'package.json' for volta" | ||
required: false |
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.
This is problematic. .tool-versions
and package.json
are completely different formats and should be treated as different features.
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.
Honestly, the only reason I did it this way was to match up with how they do it for node versioning in the referenced lib. I figure if js devs are familiar with any GitHub actions at all, it’s likely that one.
I’ll rethink the inputs throwing out that goal and come back with something else.
Or not. Heh. If I have the time I will.
@zkochan Normally, I only want @happycollision Shouldn't |
I doubt it? I assume the best actions to use for setup are the incredibly common one provided by the GH Actions team for node and then for pnpm, the one maintained by the actual developers of pnpm. 😇 I use a node action to setup node and this pnpm action to set up pnpm in CI (just as described in your docs). But to version control in development I use asdf, sometimes Volta. All I really want is a single, canonical place to declare a version and have it respected by all those tools, rather than assume everyone on my team is familiar enough with all of them to know and remember to update the version in multiple places. So that’s my particular use case. Now, the .tool-versions format is easy enough to dig through with shell scripting, but if you give people an easy way to do it, you’d save people some time and effort. This, I assume, is why the node action offers to read these common version declaration files. I gave my other answers above before reading this comment, so until I hear back from you guys, I’ll sit on this so you can decide what is best for the project. Feel free to close this out if you like. Cheers. Side note: We are in the middle of transitioning from npm to pnpm at my workplace. I am the one doing the work for it, and I am loving the benefits I am seeing. Thanks for the incredible work on this package manager. |
@happycollision Both pnpm initially also didn't have a GH action, so I made one, and proposed with zkochan to move it from my account to the @pnpm org, making it official. |
build
script. Not sure if there is anything else needed.This addresses #109 and #84 and could be extended later to also address #150.
I thought it'd be nice to allow something like this: