millermedeiros / js-signals

Custom Event/Messaging system for JavaScript inspired by AS3-Signals
http://millermedeiros.github.com/js-signals/
1.97k stars 179 forks source link

Make package publishable via NPM #21

Closed tomyan closed 13 years ago

tomyan commented 13 years ago

Hi Miller

Here are some changes that will make it possible to publish the js-signals with NPM. There are a few ways to do this - this proposal involves the smallest amount of change to the existing structure and build that I could think of. NPM expects a tar.gz with a package.json file in the root. This change creates a version of the module in common js format in the dist folder and a package.json meta-data file in the root. With these changes, publishing to NPM would be achieved by running the following after the tag has been pushed to github (once you've set npm up to be able to publish):

npm publish https://github.com/millermedeiros/js-signals/tarball/vVERSION

Let me know if you can think of a better way to achieve this, or would prefer not to do the publishing to NPM yourself.

Thanks

Tom

timoxley commented 13 years ago

Awesome work! Though should probably just call the package 'signals'.

tomyan commented 13 years ago

Sounds good to me - I'd prefer to write:

var signals = require('signals');

If you add:

"keywords" : [ "js-signals" ]

..into the package.json meta-data file, then it will still come up when people search for "js-signals" in npm.

Tom

millermedeiros commented 13 years ago

thanks a lot, I will merge it later this week and add the keywords as well..

I will keep the package name as signals as @secoif noted to match the namespace - maybe I should even change the name of the distribution files to signals.js so if you are loading it as an AMD module you can just require('signals') the same way you would do with the common JS module.

timoxley commented 13 years ago

Nice. Yes, would be best to keep it as consistent as possible.

millermedeiros commented 13 years ago

ready to be used! http://search.npmjs.org/#/signals

I would delay forever to look into how to publish to npm without the request... thanks.

tomyan commented 13 years ago

Very cool - thank you.

Tom

timoxley commented 13 years ago

Awesome, I'm really looking forward to seeing signals in more libraries now. Yeehaw.