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

jspm api add support for external package managers #752

Closed
XVincentX opened this Issue May 12, 2015 · 16 comments

Comments

Projects
None yet
3 participants
@XVincentX

XVincentX commented May 12, 2015

It would be great to plug external loaders (such as bower) using the api and not only with the cli.

@guybedford

This comment has been minimized.

Member

guybedford commented May 12, 2015

This is what the custom registry API is designed to provide.

@XVincentX

This comment has been minimized.

XVincentX commented May 12, 2015

Thank you for the prompt reply. Perhaps am I missing something...where should I start to read?

Auto answer:
Here, for example

@guybedford

This comment has been minimized.

Member

guybedford commented May 12, 2015

An example to construct a bower registry is at https://github.com/2fd/jspm-bower-endpoint/blob/master/bower.js. I don't suggest this though as we already have the github registry, which does read the main from the bower.json when it can.

@XVincentX

This comment has been minimized.

XVincentX commented May 12, 2015

@guybedford I do not get the thing, sorry. You mean that jspm can automatically download out of the box bower packages?

@XVincentX

This comment has been minimized.

XVincentX commented May 12, 2015

Oh I understand, do you mean that github registry will try to read an eventual bower.json file from the repository and use it to export the library?

@guybedford

This comment has been minimized.

Member

guybedford commented May 13, 2015

Yes exactly - the github registry adapter will check the bower.json if the main entry point is not found from the package.json.

@XVincentX

This comment has been minimized.

XVincentX commented May 13, 2015

How about the dependencies? Looks like they do not get followed.

@guybedford

This comment has been minimized.

Member

guybedford commented May 13, 2015

Bower dependencies aren't followed because jspm won't know how to resolve them.

@codylindley

This comment has been minimized.

codylindley commented May 13, 2015

fyi, by using https://www.npmjs.com/package/jspm-bower-endpoint you can use bower names and it will install dependencies.

@XVincentX

This comment has been minimized.

XVincentX commented May 18, 2015

@guybedford How does it behaves when main section of bower file contains multiple entries? Looks like actually it is "not working".

@guybedford

This comment has been minimized.

Member

guybedford commented May 19, 2015

@XVincentX yes it will use the first main in that case if it exists. Note that the package.json main takes preference over the bower.json though so it's just a fallback. You can see the code here - https://github.com/jspm/github/blob/master/github.js#L651.

@XVincentX

This comment has been minimized.

XVincentX commented May 19, 2015

Got it.
This could be a problem when some bower packages have got a javascript and a css file. Any idea about how to handle that?

@guybedford

This comment has been minimized.

Member

guybedford commented May 19, 2015

You can add the CSS plugin call as a dependency in the shim as well. There are some examples in https://github.com/jspm/registry/tree/master/package-overrides.

@guybedford

This comment has been minimized.

Member

guybedford commented May 19, 2015

@XVincentX

This comment has been minimized.

XVincentX commented May 19, 2015

@guybedford This is great. Can I submit a pull request for a package that I am using?

@guybedford

This comment has been minimized.

Member

guybedford commented May 19, 2015

Yes exactly, feel free to do so.

@XVincentX XVincentX closed this Jun 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment