Closed jasonkuhrt closed 10 years ago
user-repo
, repo
, and name
should all work. i just fixed a bug with just using .name
though, so you'll have to update all your deps.
@jonathanong a bug that has yet to be rolled into component/component?
Are you saying that if a component.json
has .name
of "foobar"
that downstream should be able to just require('foobar')
?
yeah. ex. visionmedia/page.js
. you should be able to do require('visionmedia-page.js')
, require('page.js')
, or require('page')
(its name according to component.json
). otherwise, it's a bug.
it's a builder bug, so i just published it to builder. just update builder and you should be good. not pinning deps here yet.
@jonathanong Ok sweet seems to be working now!
I need some clarity on
component.json .name
vs the projectuser/repo
.It seems that the
.name
field is not used downstream byrequire
ing apps; instead downstreamrequire
ers mustrequire('<repo-name>');
If true, and it seems so, this is a bit problematic. Here's the scenario:
Organization
forg
with repofoobar
that is both anpm
andcomponent
module.They want the URI to this repo to be
forg/foobar
and the moudle name to beforg-foobar
. This way in a registry they get to collect modules under:This is easy with
npm
becausenpm
uses thename
field ofpackage.json
as the thing downstream willrequire
. This is wherecomponent
differs? It appears thatcomponent
relies on the remote repo name._MOST_ of the time a repo name that matches module name is the standard but this breaks down in the organization context when you want _modules_ to be prefixed with the organization name.