== Prerequisites ==
-=== Install Node.js ===
+ * http://bower.io/[Bower]
+ ** Dependency retrieval
+ * http://jasmine.github.io/[Jasmine]
+ ** Headless unit tests runner
+ * http://gruntjs.com/[Grunt]
+ ** Coordinating the build
+ ** Concatenation + minification of JS and CSS
+
+These are all Node.js plugins, so start by installing Node.js
-http://gruntjs.com/[Grunt] and http://jasmine.github.io/[Jasmine] (and
-related bits) allow us to retrieve JS dependencies, run unit tests, and
-concatenate + minify JS files on the server. They are both Node.js
-plugins.
+=== 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
% sudo npm install -g grunt-cli
------------------------------------------------------------------------------
+=== Install Bower ===
+
+[source,sh]
+------------------------------------------------------------------------------
+% sudo npm install -g bower
+------------------------------------------------------------------------------
+
== Building, Testing, Minification ==
The remaining steps all take place within the staff JS web root:
[source,sh]
------------------------------------------------------------------------------
-% npm install
-------------------------------------------------------------------------------
-
-=== Generate test IDL2js Output ===
-
-Unit tests require mock data. Some data is provided as static content,
-but the IDL JS is generated from the in-repo fm_IDL.xml file via a script:
-
-[source,sh]
-------------------------------------------------------------------------------
-% cd test/data
-% ./idl2js.pl
-% cd ../../
+% npm install # fetch Grunt dependencies
+% bower install # fetch JS dependencies
------------------------------------------------------------------------------
=== 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]
------------------------------------------------------------------------------
== TODO ==
- * Minification of app-specific files
+ * Minification of app-specific JS files
* Integrate this into the Evergreen Makefile test and install targets
** Avoid installing test, node_modules, etc. into the web dir.
* Support fetching JS deps (angularjs, etc.) via direct retrieval for
installation without test + concat + minify (i.e. w/o requiring Node.js)?
- * CSS minification