Skip to content
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

How do we use this endpoint with jspm? #5

Open
trusktr opened this issue Oct 10, 2014 · 32 comments
Open

How do we use this endpoint with jspm? #5

trusktr opened this issue Oct 10, 2014 · 32 comments

Comments

@trusktr
Copy link

trusktr commented Oct 10, 2014

?

@guybedford
Copy link
Collaborator

Note the endpoint API has changed since this was last worked on so that it isn't currently working.

The process to add a custom endpoint is through endpoint create.

@matthewp
Copy link
Owner

Thanks @guybedford I'll try and update this soon.

@kristianmandrup
Copy link

Please update this ASAP. We want to switch to JSPM, but this is holding us back ;(

@matthewp
Copy link
Owner

@kristianmandrup Interesting. Is there a particular reason? Do you use dependencies on Bower that aren't also on NPM?

@kristianmandrup
Copy link

@guybedford Please be more specific on the command to install a new endpoint.

jspm endpoint <command>            Manage endpoints
  endpoint config <name>           Configure an existing endpoint
  endpoint create <name> <pkg>     Create a new custom endpoint instance

Would like to see real examples for what goes in <name> and <pkg>.
I would assume that you need to install jspm-bower globally via:

npm install -g jspm-bower

And then add a new endpoint as follows:

$ jspm endpoint create bower jspm-bower

Please confirm :) Thanks!

@matthewp
Copy link
Owner

@kristianmandrup This endpoint uses an older api and needs to be updated. I can't promise on a date when I can do this but will try to get to it when I have some free time. I'd like to learn the new api anyways.

@matthewp
Copy link
Owner

Or if you would like to tackle it that would be good too, i'd give you collaborator access.

@kristianmandrup
Copy link

Cool :) Will do ASAP. Thanks!

@guybedford
Copy link
Collaborator

@kristianmandrup I'd be interested to hear what specifically you need from the Bower endpoint that you can't through the github endpoint?

Endpoint docs are at https://github.com/jspm/jspm-cli/wiki/Endpoints.

@kristianmandrup
Copy link

Yeah, I used github workaround for now, but would be nice to use the main bower repo as well, similar to npm. Thanks anyways, I will look at the docs ;)

@guybedford
Copy link
Collaborator

@kristianmandrup if you need the bower.json main, there is an issue to support that at jspm/github#21, can implement very easily.

@kristianmandrup
Copy link

Let's do it :) I mean, please add it, thanks!

@guybedford
Copy link
Collaborator

@kristianmandrup sure, implemented in jspm-github@0.10.5.

@guybedford
Copy link
Collaborator

(sorry didn't mean to close!)

@matthewp
Copy link
Owner

I'm still thinking this endpoint could be useful to people who depend on libraries that only publish to bower (there are a few).

@guybedford
Copy link
Collaborator

@matthewp does Bower host code?

@matthewp
Copy link
Owner

No, that's true. How does the GitHub endpoint handle ignoring files/directories?

@guybedford
Copy link
Collaborator

@matthewp unfortunately we still have to download them as we use the GitHub tarballs. But Bower does exactly the same as far as I'm aware.

@matthewp
Copy link
Owner

@guybedford It might download them but it doesn't store them. This is important to companies that vendor and a lot do.

@kristianmandrup
Copy link

So what is the conclusion here? How do we move ahead on this? I forked the repo.

@guybedford
Copy link
Collaborator

Well if you want the bower-main functionality that is in the endpoint - npm update -g jspm should give it I think.

@matthewp jspm removes the ignore and non files names entirely from the filesystem if that's what you mean?

Do let me know if there is other functionality that is needed here. Goal is for github: to be as good as a bower:.

@matthewp
Copy link
Owner

@guybedford What do you mean it removes ignore? It checks for bower.json files and removes the values in their ignore? If so then it is a replacement as far as I'm concerned.

@matthewp
Copy link
Owner

@guybedford if they are at parity why not alias bower: to github:?

@guybedford
Copy link
Collaborator

@matthewp ahh right, it only does this for the package.json - we can add the bower.json ignore and files handling as well.

@guybedford
Copy link
Collaborator

@matthewp GitHub because that's who you rely on for uptime if using the packages.

@matthewp
Copy link
Owner

@guybedford

@matthewp GitHub because that's who you rely on for uptime if using the packages.

I don't understand what you mean. Let me rephrase my proposal. Make it so that if a user does:

jspm install bower:jquery

It will be the same (aliased to)

jspm install github:jquery

Or... if you're against that for some reason (i'd love to know why) spit out a warning saying to use github: instead. And I can put a deprecation notice on this project.

@matthewp
Copy link
Owner

Oh, nm, bower does have a registry. Well you could pull down their registry... I can see why you wouldn't want to though.

@guybedford
Copy link
Collaborator

@matthewp we could create a bower endpoint which just is a redirecting endpoint, since endpoints are allowed to redirect to other endpoints. This way jspm install bower:jquery would automatically direct to jspm install github:components/jquery. The appropriate part of the endpoint API is https://github.com/jspm/jspm-cli/wiki/Endpoint-API#locatepackagename-optional.

If the Bower endpoint just did that, I would happily include it in core and add necessary changes to the GitHub endpoint to support metadata.

@matthewp
Copy link
Owner

@kristianmandrup if you want to take this (above suggestion) please submit a PR. Otherwise I'll get to it eventually, not sure when.

@kristianmandrup
Copy link

I'll see what I can do when I have time... does github:components/jquery really relate to bower?
I thought Component was YAPM?

@guybedford
Copy link
Collaborator

Yes that's the Bower repo. Try searching for components/jquery.git in http://bower.herokuapp.com/packages to see. Creating a Bower endpoint would effectively be about caching that JSON with an eTag in the tmp folder before 304-cache-checking it and referencing it in locate.

@kristianmandrup
Copy link

I would like to tackle this, however I don't have time now unfortunately. Sounds like you know exactly how it should be done... could you write some pseudo code or basic kinda "algorithm" for how it should be done? I never used an ETag.

http://en.wikipedia.org/wiki/HTTP_ETag

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

No branches or pull requests

4 participants