Workiva Common JavaScript Utilities
Common JavaScript functionality for all Workiva applications.
Consuming This Library
- Distribution is through bower. Don't forget to add the version to the end of the URL!
# install bower if you haven't already
$ npm install -g bower
# install this package
$ bower install git@github.com:Workiva/wf-js-common.git#{version}
- In your requirejs configuration, ensure the following config exists for both wf-js-common and its dependencies:
requirejs.config({
paths: {
'wf-js-common': 'path-to-bower_components/wf-js-common/src/',
bowser: 'path-to-bower_components/bowser/bowser',
modernizr: 'path-to-bower_components/modernizr/modernizr'
},
shim: {
modernizr: {
exports: 'Modernizr'
}
}
});
Development: Getting Started
# clone the repo
$ git clone git@github.com:Workiva/wf-js-common.git
$ cd wf-js-common
# install global tools if you haven't already
$ npm install -g bower
$ npm install -g grunt-cli
# run init script
$ ./init.sh
The init script will initialize your local environment and ensure that you have all global and local dependencies installed.
Quality Assurance
For Developers
To get started developing:
# ensure everything is working when checking out a new branch:
$ grunt qa
# setup lint and test watches and serve as you develop:
$ grunt dev
For QA
There's a special grunt task for you! It will:
- lint the code
- run the tests
- report on code coverage
- generate the API docs
- open the project web site so you can get going fast!
$ grunt qa
You should run this every time you checkout a branch. It will do everything to get you going.
Project Structure
bower_components
libraries distributed by Bowerdocs
project design and API documentationnode_modules
libraries distributed by NPMout
output from build taskssrc
source filestest
test filestools
supporting tools for code quality, builds, etc.
Managing Dependencies
Familiarize yourself with the package managers we use:
Development: Process
This project uses wf-js-grunt. Please see that repo for more information.