Skip to content
uupaa edited this page Aug 11, 2014 · 29 revisions

for WebModule Developers

Initialize

  1. Install Homebrew and Node.js.

    $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    $ brew -v
    
    > Homebrew 0.9.5
    
    $ brew install -g node
    $ npm -v
    
    > 1.4.6
  2. Add a NODE_PATH.

    $ echo 'export NODE_PATH="/usr/local/lib/node_modules"' >> ${HOME}/.zshrc
    
    $ source ${HOME}/.zshrc
    $ env | grep NODE_PATH
    
    > NODE_PATH=/usr/local/lib/node_modules
  3. Install dependency npm modules.

    $ npm install -g plato
    $ npm install -g jshint
    $ npm install -g http-server
    $ npm install -g uupaa.compile.js

Create or Clone WebModule repository

Create

TBD

Clone

$ git clone [email protected]:uupaa/{{WebModuleName}}.js.git
$ cd {{WebModuleName}}.js

Install dependency modules, Compile, Make test pages

$ npm run init        # npm update
                      # npm run build
                      # npm run test-page

Improvement

# edit lib/{{WebModuleName}}.js

$ npm run hint        # run jshint lib/*.js
$ npm run test        # npm test/index.node.js
                      # open test/index.html
$ npm run test-sim    # run MobileSafari on iOS Simulator

Coverage

$ npm run lint        # run coverage tools

Update version

$ npm run vup         # update patch version

> update patch version. 0.0.1 -> 0.0.2

Publish

$ git add .
$ git commit -m "message"
$ git push

$ npm publish
Clone this wiki locally