Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Resolve name as name/name. #586

Closed
antaranian opened this issue Jul 7, 2014 · 7 comments
Closed

Resolve name as name/name. #586

antaranian opened this issue Jul 7, 2014 · 7 comments
Labels

Comments

@antaranian
Copy link

Resolve main repository in organization, when only org-name is provided, where main repository is the one with the same name as organization.

E.g.

$ component install lodash moment

should be equivalent to:

$ component install lodash/lodash moment/moment

Same should work with require, like require('moment').

While using in conjunction with naming conventions introduced by Component v.1 all parties (publishers and users) can release and "require" modules without naming differences across Component and npm.

And require('name') looks better than require('name-name') I think.

@jasonkuhrt
Copy link
Member

@antaranian Expanding lodash to lodash/lodash etc. is not a bad idea. Thanks for suggesting it.

Note however that your motivation is based on some false assumptions I think. You do not need to do this:

require('name-repo')

component knows how to resolve just this:

require('repo')

The only time you would need require('name-repo') is if you have installed two dependencies with the same name. : )

@jasonkuhrt
Copy link
Member

If @jonathanong is cool with it @antaranian feel free to submit a pull-request. You basically just need a small pure function.

Also while we're on this topic here are other wacky possibilities:

component install component/emitter, tip, foobar lodash mnmly/sldr ios7-switch

Personally I don't need this stuff, just sharing.

@stephenmathieson
Copy link
Contributor

@jasonkuhrt the comma thing seems silly, as brace expansion already works ;)

$ component install component/{emitter,tip}

     install : component/emitter@master
     install : component/tip@master
    complete : component/emitter
    complete : component/tip

@jasonkuhrt
Copy link
Member

@stephenmathieson Yup! 👍

@antaranian
Copy link
Author

Wandering if it's more Spec's related and depends on decision guys will make on componentjs/spec#52, as this change may or may not involve changes to dependencies section in manifest file?

@jonathanong
Copy link
Contributor

i don't really see the point since the cases where this would actually be useful is very few

@jonathanong
Copy link
Contributor

it's also needlessly ambiguous

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants