First of all, awesome. Love to see folks playing with new angles on this.
Based on my experience with node/npm, I'd like to see the following capabilities for specifying a "repo" for a component:
- in the component.json, I should be able to specify a repo per component; I will likely want to pull some components from GitHub, but others from a private or otherwise different repo.
- in some cases, I'm developing multiple packages (npm) (now components) at the same time. npm provides "link" capabilities so I can cross-link dependencies, but this isn't great. Since dependencies aren't bundled (I don't think) when you download them from a repo, I think the most straight-forward thing to do in this case is to allow me to stub out a component with a pointer to what I want to use at development time.
re: first point - howsabout the current key in the dependencies object be a URL instead of a :user/:repo string? The default, scheme-less URL, could continue to point to GitHub, but if I used "my-repo://foo-blatz": <some-version-string>, then that would mean "resolve using the my-repo" repo handler. You would of course have to have a repo handler installed in some fashion (and then here comes the chicken-and-egg question :-) ). Would also need to figure out what this means with this gnarly mess of aliasing that's going on - I think at runtime you don't want to see the repo's, just more of a :something-:something-else scheme.
re: second point - the example here would be that I'm developing an app that uses a component which I would also like to publish as an consumable component. Say, I'm developing App A that uses Component B, and I also want to publish Component B for other people to use in their own apps.
npm solves this with "npm link", but it's a bit of a pain to set up. In the example case, what I'd like to do is structure my source code like this:
project/
- app.A
- component.B
where app.A and component.B are both components (both use component.json to access other components). In this case, app.A needs a reference to component.B. I would expect app.A's component.json to look something like this:
dependencies: {
...
"myRepo://component.B": "*",
...
}
But I don't really want to "install", at development time, component.B in app.A/component. What I really want is a "link". I think I'd prefer some kind of actual file, instead of file system link. So, say, I create a directory "linked-dependencies", and in there I plop a file "component.B", in some kind of resolvable name, which has a file reference to the actual component. In this case, it would be "../component.B". Then whenever some code tries to resolve "component.B" - at "component install"time AND at build time / run time, it's resolved as the linked-to directory.