Uploaded image for project: 'National Data Service'
  1. National Data Service
  2. NDS-173

Investigate Build/Release tasks for production JavaScript

XMLWordPrintableJSON

    • Icon: Story Story
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • Development
    • None
    • NodeJS, Bower, Grunt
    • NDS Sprint 18, NDS Sprint 19

      As a developer of NDS Labs, there should be tooling to help prepare the JavaScript code for production-quality. Thankfully we can use Grunt to automate many of the more common tasks for us. Grunt accepts plugins that specify tasks, many if which are available through NPM.

      The tasks we should implement, in order, are as follows:

      1. jshint / csslint: Display syntax errors / warnings from JS / CSS
      2. concat: Concatenate all JS / CSS to a single file uglify does this as well
      3. uglify / cssmin: Minify / compress all JS / CSS files
      4. imagemin: Compress all locally-stored images
      5. karma/protractor: Run unit/integration tests on the GUI against the mock server (see NDS-725)
      6. start http-server express (with different modes? i.e. production vs. dev - see NDS-727)

      This story is complete when the Gruntfile.js in the ndslabs GUI source is filled out to automate some or all of the above tasks. At the very least, jshint, uglify, cssmin, imagemin and concat should be present.

      More tasks can be added at any time if we decide that there is anything else we might find helpful.

      Only helpful if we do all of them:

      • swagger / swagger-server: Generate a REST client and mock server (for testing or backend-less development) from a swagger api spec
      • connect / watch: start a test server to develop against (may require changes to apiserver CORS) and automatically refresh the UI / run unit tests when files change on disk
      • istanbul: report code coverage of the tests run - seems to require running a proxy server, which may cause issues with CORS

      Other "maybes":

      • jsdoc: Generate HTML pages containing documentation from comments in the source (javadoc for js) (minimal is preferred to optimal)
      • browserify: resolve nodejs modules within JS source (would require several changes - see NDS-229)
      • moustache: templating engine that can ease things like versioning
      • cachebuster: append magic strings to index.html to prevent caching
      • Other tasks that may need exploration:
        • html2js
        • precompile js templates
        • generate / apply certs?
        • the order in which these tasks will need to run to function properly

              lambert8 Sara Lambert
              lambert8 Sara Lambert
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 day, 4 hours Original Estimate - 1 day, 4 hours
                  1d 4h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 4 hours, 10 minutes
                  2d 4h 10m