temp install docs for JS deps, testing, and minification
authorBill Erickson <berick@esilibrary.com>
Wed, 7 May 2014 13:55:23 +0000 (09:55 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 7 May 2014 13:55:23 +0000 (09:55 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/staff/README.install [new file with mode: 0644]

diff --git a/Open-ILS/web/js/ui/default/staff/README.install b/Open-ILS/web/js/ui/default/staff/README.install
new file mode 100644 (file)
index 0000000..9714dd5
--- /dev/null
@@ -0,0 +1,94 @@
+= Building, Testing, Packaging the Browser Client =
+:Author:    Bill Erickson
+:Email:     berick@esilibrary.com
+:Date:      2014-05-07
+
+== Prerequisites ==
+
+=== Install Node.js ===
+
+Node.js does not have have Debian Wheezy build target.  For now, I've opted
+to install from source.  For more, see also 
+https://github.com/joyent/node/wiki/installation[Node.js Installation]
+
+[source,sh]
+------------------------------------------------------------------------------
+% git clone https://github.com/joyent/node.git
+% cd node
+% git checkout -b v0.10.28 v0.10.28
+
+# set -j to number of CPU cores + 1
+% ./configure && make -j5 && sudo make install
+
+# update packages
+% sudo npm update
+------------------------------------------------------------------------------
+
+=== Install Grunt CLI ===
+
+[source,sh]
+------------------------------------------------------------------------------
+% sudo npm install -g grunt-cli
+------------------------------------------------------------------------------
+
+== Building, Testing, Minification == 
+
+The remaining steps all take place within the staff JS web root:
+
+[source,sh]
+------------------------------------------------------------------------------
+% cd Open-ILS/web/js/ui/default/staff/
+------------------------------------------------------------------------------
+
+=== Install Project-local Dependencies ===
+
+npm inspects the 'package.json' file for dependencies and fetches them
+from the Node package network.
+
+[source,sh]
+------------------------------------------------------------------------------
+% npm install
+------------------------------------------------------------------------------
+
+=== Generate test IDL2js Output ===
+
+Unit tests require mock data.  The IDL is needed for practically all tests,
+so there's a script to generate IDL2js output from the in-repo IDL.
+
+[source,sh]
+------------------------------------------------------------------------------
+% cd test/data
+% ./translate_idl2js.pl
+% cd ../../
+------------------------------------------------------------------------------
+
+=== Running the Build Scripts ===
+
+ * build : copy needed files (angular, etc.) from the node directories into
+   our build directory
+ * test : run unit tests
+ * concat+minify : concatenate 'core' script files into a single file and
+   minify the file using Grunt's 'uglify' plugin.  This will create a file
+   at build/evergreen-staff-client.<version>.min.js, which contain the 
+   scripts needed for all interfaces.
+
+[source,sh]
+------------------------------------------------------------------------------
+
+# build, run tests
+% grunt test
+
+# build, concat+minify
+% grunt uglify
+
+# build, run tests, concat+minify 
+% grunt all
+------------------------------------------------------------------------------
+
+== TODO ==
+
+ * Minification of app-specific files
+ * Integrate this into the Evergreen Makefile test and install targets
+ * Support fetching JS deps (angularjs, etc.) via direct retrieval for 
+   installation without test + concat + minify (i.e. w/o requiring Node.js)?
+