-
Notifications
You must be signed in to change notification settings - Fork 110
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
gx use <repo>
#151
Comments
This would be essentially like using the same package.json file for all projects? |
Yeah, essentially. |
What if someone uses a repo (maybe managed by someone else) and then later finds out that a dependency that is outside the repo is also needed? Is it possible to add another dependency that is outside the repo? What happens if the dependency is on a package already in the repo but another version? |
Yeah, I would imagine stuff from the repo would serve as a base, and then you can import more on top of that. Multiple versions becomes an issue though, you would want to ensure the repo contains no conflicts, and the extra packages you import don't cause any |
Yeah, perhaps the multiple version situation can just be forbidden for now. |
Some thoughts on UX (definitely not final):
Would set a field in the package.json pointing to that repo, and note the latest hash of that repo. Then, when running You can still import packages directly, but packages from the repo will take priority in the even of a conflict.
Would re-resolve the repo, note the new hashes, and update things as needed. |
moving my comments from #160 here for deduplication: having worked with tool now for a month or so, as a user - one thing that stands out is that I don't have a convenient way to decide which versions of the dependancies I want: the package owner has to do a release with a named version (sure I can publish custom versions on my own, but it's freaking hard to then navigate the tree and republish all the parents that would be required to depend on those customs cuts, and their parents etc.). If the dependency tree is deep and wide (as we see in libp2p projects) this results in a lot of constraints between compatible versions. Recently, I've been building the un-gxified version of my project without any dependency management, and its more reliable in the sense that I can usually get it to build, whereas if I add a dep or update something i'm in deep trouble with gx. One idea I have is that there could be a command to "freeze" and "update" deps. In this model, when you "freeze", it cuts a brand new version for each dependency - exactly as it is at that moment in your $GOPATH - by following all the The payoff is, I as a user, can adjust my regular un-rewritten libs the way I want for my deps, caring only about the golang compatibility of interfaces, not the full version locking stuff, then run a single command to freeze them, or unfreeze and refreeze as required without any worries about when the package owners/maintainers cut releases. I don't care about interdependencies at all - and I don't need a crummy One possible catch is that, as a user, I have to run ipfs and take responsibility for making sure my custom versions of code are well replicated for the team I am working with - which I do anyway. |
@jvsteiner Thanks a lot for your input! I think we're pretty close to being on the same page here. Could you provide maybe an example or two of the workflow (in terms of hypothetical commands to run) that you think would be good? Semi-related, have you seen gx-workspace? The docs in the readme are out of date, but the tool allows you to fairly easily update a dependency throughout an entire tree of gx deps (it handles all the |
@whyrusleeping - I took a look at |
Alright, so heres something moderately interesting.
I want to be able to have a gx repo (see the readme, nobody uses them yet) full of all my dependencies, that I keep updated, and run all sorts of checks on, etc.
Then, I want to be able to just tell my package to use deps from it. When it does this, it should mark the exact hash of the repo at the point its using it. From there, I can easily update all the deps in the repo at once. This also opens the door to having less strict versioning that i'm okay with. If the deps in your repo get updated, then your package could automatically use the latest. This is a strictly better model because you are explicitly trusting the source of the packages (via the configured repo)
I'm gonna keep thinking about this, and fill it out with more info later. Comments and questions welcome.
The text was updated successfully, but these errors were encountered: