-
Notifications
You must be signed in to change notification settings - Fork 8
Development
uupaa edited this page Oct 11, 2014
·
29 revisions
This file contains guidelines on WebModule developing workflow.
-
Software requirements for WebModule:
-
Installation steps:
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" $ brew -v > Homebrew 0.9.5 $ brew install node $ npm -v > 2.0.2
- Add a NODE_PATH to your shell .rc file.
$ 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
- Install dependency npm modules.
$ npm install -g plato $ npm install -g jshint $ npm install -g http-server $ npm install -g uupaa.compile.js
-
Clone WebModule to local workspace:
$ mkdir ~/workspace $ cd workspace $ git clone git@github.com:uupaa/WebModule.git
-
Create an example WebModule repository on GitHub:
-
Creating a new repository
- (1) Select your account.
- (2) Input WebModule name. naming hint.
- (3) Input description (optional).
- (4) Check the box and select license.
- (5) Click to create.
Owner Repository name +-------------------+ +-------------------+ | your account (1) | / | WMExample.js (2) | +-------------------+ +-------------------+ Description (optional) +------------------------------------------------+ | my first webmodule (3) | +------------------------------------------------+ [x] Public [x] Initialize this repository with a README (4) +----------------------+ | +---------------------------------+ | | | | Add a license: MIT License (4) | +----------------------+ | +---------------------------------+ +------------------------+ | Create repository (5) | +------------------------+ -
Creating a new repository
-
Clone an example WebModule repository to local workspace:
- Clone and change directory to it.
$ pwd > ~/workspace $ git clone git@github.com:YOUR-ACCOUNT/WMExample.js.git $ cd WMExample.js
-
Clone WebModule structure:
$ pwd > ~/workspace/WMExample.js $ node ../WebModule/clone > clone: ~/workspace/WMExample.js/lint/plato/README.md > clone: ~/workspace/WMExample.js/release/README.md > clone: ~/workspace/WMExample.js/.gitignore > clone: ~/workspace/WMExample.js/.jshintrc > clone: ~/workspace/WMExample.js/.npmignore > clone: ~/workspace/WMExample.js/.travis.yml > clone: ~/workspace/WMExample.js/index.js > clone: ~/workspace/WMExample.js/lib/WMExample.js > clone: ~/workspace/WMExample.js/test/test.js > clone: ~/workspace/WMExample.js/package.json > exists: ~/workspace/WMExample.js/README.md - overwrite it? (y/n): y > overwrite: ~/workspace/WMExample.js/README.md
-
Initialize WMExample.js:
$ pwd > ~/workspace/WMExample.js $ npm run init > npm update > npm run build > npm run test-page
Edit and test.
$ vi lib/WMExample.js # edit
$ npm run hint # run jshint
$ npm run test # run tests
$ npm run test-sim # run test on iOS Simulator
$ npm run coverage # run coverage tools-
Update patch version.
$ npm run patch # update patch version > update patch version. 0.0.0 -> 0.0.1
-
Commit and publish.
$ git add . $ git commit -m "first commit" $ git push $ npm publish