-
Notifications
You must be signed in to change notification settings - Fork 1k
Idea: Allow creation of aliases in Manifest.json #191
Comments
Thanks for making the suggestion :) I quite understand the impulse for it, and have had a similar thought myself. Unfortunately, though, I don't think this would be workable. There's a few things I could point to, but one is most clearly disqualifying: conflicts. There are (at least) four classes of conflict such aliases would allow. Let's think about how this would have to work. A manifest declares an alias, which is basically a mapping from a project root ( For ubiquity of the aliasing to be enforced and this backdoor avoided, it means the solver would have to hoist aliases from dependent projects' manifests up globally, anywhere That's two conflict classes. The third is, if you alias to Import paths provide considerable canonicality of names; it's a useful property, and one we should maintain as much as possible. Also, let's not forget that we have to construct an on-disk representation of your deps in So, yeah - nifty idea, but I can't see it working well. It's a superset of the problems that specifying an alternate source has, but with much less benefit - whereas alternate sources let you transparently swap in e.g. a fork, or more (#174). I can't think of a problem this solves apart from typing fewer chars. I'm going to close this as a clear signal it won't work, but again, thanks for the idea, and please don't be discouraged from posting more ideas if you have them! |
You've raised great points that in my haste I didn't consider (partially the conflicts in /vendor). Your explanation has taught me a lot about the complication model, and I'm really thankful for that ❤️. |
Make sure you close files after opening them.
First of, thank you so much for your hard work on this project. Y'all are doing great work on this issue. Second of all, my apologies is this isn't the right place to open this issue.
My idea is to an introduce an
alias
keyword inmanifest.json
. For instance:This command would place the
chi
package under/vendor/chi
instead of/vendor/github.com/pressly/chi
. Therefore, packages could be imported as:Since golang/dep treating third-party packages as first-class citizens, I believe that import syntax should reflect this cultural change. Of course, there are many issues that I did not consider and could make this difficult. All that being said, thank you for your time and for listening to this idea!
The text was updated successfully, but these errors were encountered: