Workflow_en
uupaa edited this page May 25, 2015
·
1 revision
This entry contains guidelines on WebModule developing workflow. ( Japanese version )
-
Software requirements for WebModule:
- Mac OS X 10.9.5 and later.
- Homebrew.
- Node.js latest version.
- JDK version 1.7 and later. (request from Closure compiler)
- Google Chrome Browser.
- Xcode and iOS Simulator. (bundled on Xcode) (optional)
- node-webkit Mac OS 64bit (optional)
- npm modules([Plato][], [JSHint][], uupaa.compile.js)
-
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 packages.
$ npm install -g plato $ npm install -g jshint $ npm install -g uupaa.compile.js
-
Clone WebModule to local your workspace(e.g. ~/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.
- (3) Input description (optional).
- (4) Check the box and select license.
- (5) Click to create.
Owner Repository name +-------------------+ +-------------------+ | your account (1) | / | MyExample.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 your local workspace:
- Clone and change directory to it.
$ pwd > ~/workspace $ git clone git@github.com:YOUR-ACCOUNT/MyExample.js.git $ cd MyExample.js
-
Setup WebModule:
$ cd ~/workspace/MyExample.js $ node ../WebModule/run/setup > - repositoryFullName: MyExample.js > - repositoryName: MyExample > - copy source dir: ~/workspace/WebModule/ > - copy target dir: ~/workspace/MyExample.js/ > > clone: ~/workspace/MyExample.js/lint/plato/README.md > clone: ~/workspace/MyExample.js/release/README.md > clone: ~/workspace/MyExample.js/.gitignore > clone: ~/workspace/MyExample.js/.jshintrc > clone: ~/workspace/MyExample.js/.npmignore > clone: ~/workspace/MyExample.js/.travis.yml > clone: ~/workspace/MyExample.js/index.js > clone: ~/workspace/MyExample.js/lib/MyExample.js > clone: ~/workspace/MyExample.js/test/testcase.js > : > : > clone: ~/workspace/MyExample.js/package.json > exists: ~/workspace/MyExample.js/README.md - overwrite it? (y/n): y > overwrite: ~/workspace/MyExample.js/README.md > > done. > > Available next actions, > `$ npm run` # list up npm run-script > `$ npm start` # start local httpd server > `$ npm run sync` # sync scripts, install/update node modules, create test pages and minify
-
Sync WebModule/MODULE_package.json to MyExample.js/package.json:
$ npm run sync
Edit and test.
$ npm start # start local httpd server (port 8000)
$ edit lib/MyExample.js
$ npm run hint # run jshint
$ npm run test # run tests
$ npm run sim # run test on iOS Simulator
$ npm run score # 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