-
Notifications
You must be signed in to change notification settings - Fork 650
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
Distribute on NPM? #656
Comments
That would be cool. I am thinking we hold off for v4 to do this, because then we will have cross platform support via mono. |
I have never done any npm packaging, is this something that is simple to do? |
@JakeGinnivan fair enough. :) |
@MeirionHughes what about the gulp-gitversion portion? Is this something that we would want to take ownership of? |
I think we should take ownership of it, to be honest there is little friction in maintaining it. There is a lot more when someone else has to play catch up all the time. Once appveyor allows us to have command line deployment tasks then I can automate NPM, Gulp and Ruby deployments |
Edit; thinking about it. May well not need a gulp task anyway unless you do something special. |
Yip, I was thinking the same, just wanted to make sure we are on the same page 😛 |
FYI just looking at this, I would simply be creating a lightweight NPM package with a node api. I dont see us creating a gulp package, if you are using gulp you can still call node APIs and there are plenty of bridge projects. Personally I just use NPM scripts |
Fair enough, its easy enough to run your own code in a gulp task anyway. To implement this, it might be easily done by simply calling the .net library/executable via https://github.com/tjanczuk/edge |
Being able to execute gitversion as a gulp task, could tie in to #647 - i.e you could update the project.json file also. Debatable whether gitversion would actually need to handle updating the project.json file itself, or whether we could just document a gulp task that pipes the git version supplied version number to another gulp tool to update the file.. |
This would be great. I've just put together a SPA proof of concept that uses gulp. I want to create a nupkg of the gulp output to push to Octopus Deploy. Being able to update the version of the nuspec via GitVersion would be very handy. |
I got around this by using the GitVersion task in VSTS build vNext to populate the version details into build variables. I then used the nuget package build step which supports assigning the version from a build variable. Job done :) |
If we did this, which variant of GitVersion should we base it on? Is it OK to require .NET Core installed in order to run an |
Or we could create a cloud service... push your git branch to our own git server in the cloud then make an http request to get its version. The only two dependencies for that to work are git, and a http client like curl. Then charge a small subscription fee.. #justanidea :-) |
.. And then watch as we get zero customers - because everyone is fine using the dotnet cli global tool for gitversion that runs locally :-) |
Haha, that sounds like a completely water-tight business plan, @dazinator! Will you do the setup? I'll join once the millions are pouring in to help alleviate you of all the excessive cash. 💵 😄 |
had another look and it seems someone has attempted to mimic how this lib works but for node packages: https://www.npmjs.com/package/git-semver-info Doesn't look like its being maintained though. could invite them to transfer into GitTools org and join. ;) |
There is an interesting global tool I found https://github.com/dgiagio/warp. We can basically wrap the .net core version into a single executable for each platform. Then we can use that executable for npx, or homebrew, or chocolatey, ruby gem. What do you think? |
@arturcic Yeah I have stumbled accross warp. |
Warp looks very interesting. Since it's only a simple command line, it shouldn't be hard to extend our build process to start producing some executables. We can then run that executable through most of our command line tests. |
@asbjornu there is also a Cake.Warp addin that can be used 😄 |
Haha, that doesn't surprise me at all, @gep13. And by mentioning it, didn't you just volunteer to implement a spike for this? 😄 |
Hmmm.... wait... did I?!?! 😄 Honestly, I would love to, but right now, I don't have the bandwidth to take this on. Already juggling quite a few things just now, and I have a couple work trips coming up, so I can't commit to doing anything here. Happy to advice on any Cake related questions though. |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
any update on the status of this ? |
if this happens , adding the automatic file patching would be really nice feature to add for package.json files |
I'm wondering if the following might suffice:
This approach wouldnt require any special distribution of gitversion, just that gitversion command is available on your environment. Not as convenient as pulling in gitversion as an npm package I grant, but it's less work (for gittools!) |
My solution I was thinking of is the following:
|
It's similar in approach to the azure devops extension and Github action, but instead of the global tool it will use the native executable |
@arturcic - Yeah, installing the native self contained executable is nice, as then there is no pre-requisite on the user to install anything. Few questions though:
My suggestion wasn't really a solution ;-) - I was just attempting to bypass these questions by saying, let the user install the tool where they want, and then all we'd need to do initially is just document how to call gitversion executable from node and get back version information. However your solution I agree is the more fully fledged one - i.e automatically installing gitversion onto the environment! |
@arturcic oh also:
|
to be honest I'd prefer not to embed as it will be too big. Better if we can download the platform specific version. As for the the script, it will be as an npm package that you can install and then call. I will be using typescript and then compile it to javascript. It's still in the ideas phase. |
well the tar.gz contains only one file, I guess it will go in the node_modules/bin folder, so no need to install |
Yeah I guess it's a tradeoff. If its a package that you are installing once globally, a larger initial download size would be weighed against the fact that we would be eliminating a class of potential run-time errors with downloads failing at execution time. For example if an organisation has allowed npm traffic through the firewall, consuming the npm package may be fine - if the npm package fails to install well that's an npm issue nothing to do with git version. However with the seperate download approach, the npm package may succeed but then when you execute the script the download (from github releases?) may fail. Or, there might be some other transient network fault that causes the download to fail etc. That would now become a GitVersion issue. This may be unlikely - but possible! That's all I can think of at the moment - either way you decide! One last thought - I assume with the download approach, the script would be pinned to a specific release of gitversion? (i.e we wouldn't want it to just download the latest gitversion release, it would download gitversion from the same release as the package release right?) |
already do this now was hoping to not have to do it for every project any more , if your installing it as an npm package , i would think you would follow the same methodology as any other npm package , generally your bins deploy inside the package , and your entry command gets added to the .bin directory in node_modules |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
FWIW there is an npm package semantic-release that appears to be similar, and makes use of conventionalcommits.org. |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
stale bots are evil |
It might be nice to be able to run gitversion in Node and then from there we can have gulp-gitversion.
The text was updated successfully, but these errors were encountered: