-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Is there a way to install the tool using go get? #66
Comments
Adding a go.mod file is a step in the right direction, but unfortunately
That makes sense because all of the source files are contained in
(Just checking...)
Unfortunately, Go Modules has what you might call a lack of support for import paths that do not begin with a domain (the Go Team wants to reserve such domain-less imports for the standard library). The first segment of the import path has to have a Thus, while esbuild has started to use Go Modules 🎉 the best way to enable Note that because There are a couple of examples available of how to do this. Note that if the author is concerned about folks using the code as a library, it can be placed in a directory called Appendix:
|
Having this available as a Go tool would be a real boon. Lack of speed isn't the only issue with JavaScript build systems. It would be great to be able to reduce JS dependencies to only those required by the actual project. Currently, those account for about 1% of the stuff in most of my |
I wrote a web browser application using Go to run a HTTP server and supply a REST API. It would be great being able to use Go for bundling the static assets too. I would not need Node.js as a build tool to at all. Just Go :-) @evanw, how about moving
|
Well, I was too naive to say, that just moving
In the end I was able to successfully build and test the package. When I tested it externally, I had to rename the package in my fork, but if you imagine
I kept the change in a separate branch. Would you be interested in a PR? Of course, that that branch will work only with your change d71e126, which I forked. I am not sure if rebase on a newer state of your repository will work with so many moved files. If you were interested, I would make the changes again to your latest sources, whenever you were ready. |
Ok I attempted to do this. Can someone confirm if this works? I'm not familiar with Go modules, so I'm not sure what to test. |
It does. You may need to run |
Thanks for confirming! I'll consider this issue fixed then. As an additional data point, I was also able to successfully download an esbuild executable from https://gobinaries.com. It appeared to be around the correct size. I didn't run it though. |
Thank you, @evanw, it works perfectly! When running in a Go module directory using Go 1.14, the binary
Beware of git tags, though. You have not tagged any commit in your repository yet. That is why if I run You can work without tags on the road to MVP. If somebody wants to stay with a particular change, they can refer to it by its commit hash, when they install the tool. For example:
As soon as you decide to start tagging your commits, people who install Thanks again for the quick implementation! |
About downloading binaries - you can have a look at GoReleaser too. If you write a By the way, NPM releases can be automated in a similar way with Both |
Stupendous; can confirm this works. @evanw It would be nice, when you do a version bump on NPM, to add a git tag for the same version. |
I'll add tags for future releases. I want esbuild's command-line tool to be usable for real things, so I don't think downloading master is an appropriate default. Unfortunately semantic versioning doesn't really apply before 1.0.0. The semver docs say this:
However, during the MVP phase I'd like to be a bit more rigorous about this. I'm planning to use patch releases for backwards-compatible changes and bug fixes, and minor releases for either major features or backwards-incompatible changes. So if you stick to just patch releases than the command-line interface should remain pretty stable. |
Awesome, thanks.
That's fine, users of Go Modules will understand that things may break before 1.0. From https://blog.golang.org/v2-go-modules:
|
As always evanw, thank you for your hard work. Wanted to chime in, I was hoping this would work. It would be nice, but not a big deal.
Instead, I needed something like this:
(I have GOPATH set while also using mod. I like the organization of the "old ways", but GOPATH isn't required here.) |
I think you want |
@tooolbox Yes, that would be great. |
I believe the command I gave should work. Not at my dev machine to try right now, but please give it a shot, and report the exact error if any. |
With the edit, yes that works. Thank you! |
It would be good to install it using simple go get instead of installing it as npm package.
With this service,(https://gobinaries.com/) you can get binary without golang at all
The text was updated successfully, but these errors were encountered: