]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/js/ui/default/staff/README.install
LP#1350042 Browser client templates/scripts (phase 1)
[Evergreen.git] / Open-ILS / web / js / ui / default / staff / README.install
1 = Building, Testing, Packaging the Browser Client =
2 :Author:    Bill Erickson
3 :Email:     berick@esilibrary.com
4 :Date:      2014-05-07
5
6 == Prerequisites ==
7
8  * http://bower.io/[Bower] 
9   ** Dependency retrieval
10  * http://jasmine.github.io/[Jasmine] 
11   ** Headless unit tests runner
12  * http://gruntjs.com/[Grunt]
13   ** Coordinating the build
14   ** Concatenation + minification of JS and CSS
15
16 These are all Node.js plugins, so start by installing Node.js
17
18 === Install Node.js ===
19
20 Node.js does not have have Debian Wheezy build target.  For now, I've opted
21 to install from source.  For more, see also 
22 https://github.com/joyent/node/wiki/installation[Node.js Installation]
23
24 [source,sh]
25 ------------------------------------------------------------------------------
26 % git clone https://github.com/joyent/node.git
27 % cd node
28 % git checkout -b v0.10.28 v0.10.28
29
30 # set -j to number of CPU cores + 1
31 % ./configure && make -j5 && sudo make install
32
33 # update packages
34 % sudo npm update
35 ------------------------------------------------------------------------------
36
37 === Install Grunt CLI ===
38
39 [source,sh]
40 ------------------------------------------------------------------------------
41 % sudo npm install -g grunt-cli
42 ------------------------------------------------------------------------------
43
44 === Install Bower ===
45
46 [source,sh]
47 ------------------------------------------------------------------------------
48 % sudo npm install -g bower
49 ------------------------------------------------------------------------------
50
51 == Building, Testing, Minification == 
52
53 The remaining steps all take place within the staff JS web root:
54
55 [source,sh]
56 ------------------------------------------------------------------------------
57 % cd $EVERGREEN_ROOT/Open-ILS/web/js/ui/default/staff/
58 ------------------------------------------------------------------------------
59
60 === Install Project-local Dependencies ===
61
62 npm inspects the 'package.json' file for dependencies and fetches them
63 from the Node package network.
64
65 [source,sh]
66 ------------------------------------------------------------------------------
67 % npm install   # fetch Grunt dependencies
68 % bower install # fetch JS dependencies
69 ------------------------------------------------------------------------------
70
71 === Running the Build Scripts ===
72
73 [source,sh]
74 ------------------------------------------------------------------------------
75
76 # build, run tests
77 % grunt test
78
79 # build, concat+minify
80 % grunt uglify
81
82 # build, run tests, concat+minify 
83 % grunt all
84 ------------------------------------------------------------------------------
85
86 == TODO ==
87
88  * Minification of app-specific JS files
89  * Integrate this into the Evergreen Makefile test and install targets
90    ** Avoid installing test, node_modules, etc. into the web dir.
91  * Support fetching JS deps (angularjs, etc.) via direct retrieval for 
92    installation without test + concat + minify (i.e. w/o requiring Node.js)?
93