The project depends on Grunt.js. Assuming you already have Node.js installed on your system, run the following command:
sudo npm install -g grunt
Next, clone the repository and install project dependencies:
# Fetch only the latest commits.
git clone [email protected]:bierik/javascript-library.git YOUR_LIBRARY_NAME
cd YOUR_LIBRARY_NAME
npm install
And with npm you get the following packages:
- Grunt - JavaScript task runner.
- Babel - ES6 Transpiler.
- Browserify - Dependency Bundler
- Karma - JavaScript test runner.
- Jasmine - JavaScript test suite.
- Chai - JavaScript Assertion Library.
Run the following command to re-build the library:
grunt build
Run the following command to watch for changes:
grunt
See https://github.com/substack/browserify-handbook for more information about browserify.
Browserify comes with a built-in support to generate source maps. It is already enabled by default, but feel free to disable source maps. Refer to this article to enable source maps in Google Chrome, if you haven't already done so.
Run all tests
npm test
or
grunt test
Run a specific test
grunt test --grep="Name of your test"
When you are changing library's name from myapp to YOUR_LIBRARY_NAME
- Change the name in
package.json
- Change the filename in
src/my.app.js
If you have any suggestions, or found a bug please open a GitHub issue and I will get to it as soon as I can.