jquery.event.swipe icon indicating copy to clipboard operation
jquery.event.swipe copied to clipboard

Publish to NPM

Open jondavidjohn opened this issue 9 years ago • 12 comments

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

jondavidjohn avatar Dec 19 '14 16:12 jondavidjohn

Related to #25

jondavidjohn avatar Dec 19 '14 17:12 jondavidjohn

+1

theofidry avatar Jan 07 '15 14:01 theofidry

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.

stephband avatar Jan 07 '15 21:01 stephband

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

theofidry avatar Jan 07 '15 21:01 theofidry

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 :)

stephband avatar Jan 07 '15 21:01 stephband

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^^

theofidry avatar Jan 07 '15 21:01 theofidry

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?

stephband avatar Jan 07 '15 22:01 stephband

Looks like someone else published it 8 hours ago.

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

jondavidjohn avatar Jan 07 '15 22:01 jondavidjohn

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!

theofidry avatar Jan 07 '15 22:01 theofidry

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).

stephband avatar Jan 07 '15 23:01 stephband

*unless you use browserify :D

jondavidjohn avatar Jan 07 '15 23:01 jondavidjohn

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.).

stephband avatar Jan 07 '15 23:01 stephband