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

Publish to NPM #28

Open
jondavidjohn opened this issue Dec 19, 2014 · 12 comments
Open

Publish to NPM #28

jondavidjohn opened this issue Dec 19, 2014 · 12 comments

Comments

@jondavidjohn
Copy link

It would be nice to be able to use this module via npm / browserify

@jondavidjohn
Copy link
Author

Related to #25

@theofidry
Copy link

+1

@stephband
Copy link
Owner

I am in favour of publishing to npm, but I don't know how to do it. So it's waiting until I have time to read about it.

@theofidry
Copy link

Hopefully it's really easy to do it: https://gist.github.com/coolaj86/1318304

So 2 command lines :) you can even automate the process with Travis CI

@stephband
Copy link
Owner

Ok, thanks, that's a useful link. So I just tried it quickly, and it errors out.

npm ERR! publish Failed PUT 403
npm ERR! Error: forbidden user: stephband not authorized to modify jquery.event.swipe

It isn't just 2 command lines, like all computing, it takes time to set this stuff up and maintain. I'll have to do it for the jquery.event.move dependency too. So sometime in the future :)

@theofidry
Copy link

Ah yes true enough, 3 command lines is when there is no problems^^ It possible that there is a level of permissions required or some dependancies lacking. And of course, the Travis automation is by far a better solution for easing the maintenance.

Still, it was worth trying^^

@stephband
Copy link
Owner

Oh weird, I just tried npm install jquery.event.swipe (I thought maybe someone else had bagged the package name) and it works! With dependencies! I have obviously registered it at some point in the past, and I don't know my own user credentials at npm :)

So given that it's already on npm, can I close this ticket, or is there something else that needs done?

@jondavidjohn
Copy link
Author

Looks like someone else published it 8 hours ago.

https://www.npmjs.com/package/jquery.event.swipe

@theofidry
Copy link

Oh shit, I published it in a rush. I thought I hadn't done that since I'm not the maintainer. Anyway now I transferred the ownership to you stephband. If you wish to change it, really simple : https://docs.npmjs.com/cli/owner

I think that's why you failed to publish it a moment ago!

@stephband
Copy link
Owner

Ha! Yes publish works now, thanks.

As a side note, I'm kind of waiting for the whole modules mess to get resolved before diving into package managers and everything. We used requireJS at Cruncher for a while, but it didn't give us much but longer stack traces and more code to maintain, so I ditched it. I'm quite happy using git submodules and managing dependencies myself - as a front-end you have to watch dependencies like a hawk anyway, if you want to keep JS file sizes down, so I'm not yet convinced of their usefulness. When ES6 modules hit the scene I will perk up, because there, hopefully, the community will rally around the One True Way of writing modules and things will get a bit easier.

Hopefully npm will have a hand in that. But my take-away from their recent blog post was "we're not ready yet" (http://blog.npmjs.org/post/101775448305/npm-and-front-end-packaging?utm_source=javascriptweekly&utm_medium=email).

@jondavidjohn
Copy link
Author

*unless you use browserify :D

@stephband
Copy link
Owner

Yeah, maybe. Though there is something to be said for Keep It Simple (yeah, I realise the reason for Browserify is to simplify, but ... och, I've run out of reasons. Truth is, we use a few good libraries - localforage, jQuery.cookie, Angular sometimes ... and build on top of those. I got interested in Angular so I wrote a live data binding library which we use now. Sparky: https://github.com/cruncher/sparky. It's pretty good. Only semi-well documented, though.).

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

3 participants