emberjs/ember.js — pull request #771 by viatropos (2012-05-01 22:20:08+00:00)
Title: added npm support with build script

Added to the `Assetfile` so when you run `rake dist` it will add the following packages ready to be published to NPM:

```
./dist/npm
./dist/npm/ember-metal
./dist/npm/ember-metal/index.js
./dist/npm/ember-metal/package.json
./dist/npm/ember-runtime
./dist/npm/ember-runtime/index.js
./dist/npm/ember-runtime/package.json
./dist/npm/ember-states
./dist/npm/ember-states/index.js
./dist/npm/ember-states/package.json
```

The `ember-states` library also works in Node.js, definitely been using it myself.

From there you can publish the libraries like this:

```
cd dist/npm/ember-metal ; npm publish ; cd ../../..
cd dist/npm/ember-runtime ; npm publish ; cd ../../..
cd dist/npm/ember-states ; npm publish ; cd ../../..
```

I'll add this to a `publish` rake task in another pull request if you'd like, let me know.

Also note, NPM only accepts patch versions formatted with a dash: `0.9.7-1`. It fails with `0.9.7.1`. So had to change that.