From: Bill Erickson Date: Wed, 7 May 2014 13:55:23 +0000 (-0400) Subject: temp install docs for JS deps, testing, and minification X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4f88825072606b0ddb04449a0e27a46156f38dec;p=working%2FEvergreen.git temp install docs for JS deps, testing, and minification Signed-off-by: Bill Erickson --- 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 index 0000000000..9714dd566d --- /dev/null +++ b/Open-ILS/web/js/ui/default/staff/README.install @@ -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..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)? +