Skip to content
mucaho edited this page May 20, 2017 · 15 revisions

These instructions assume you've already cloned the Crafty repo on your machine, and are for developers interested in contributing to the project. Others can just download the most recent versions of Crafty here.

Node and grunt

This uses node and GruntJS. To get started

  1. If necessary, install node and its package manager npm. Crafty is currently tested with node v6.
  2. Use npm to globally install the grunt commandline tool: npm install grunt-cli -g. (You might need elevated permissions for a global install.)
  3. Install the packages Crafty uses to build by running npm install in Crafty's root directory. (The one with package.json.) This step will pull in about 30MB of required node modules and their dependencies, and place them in the node_modules directory of the project.

Note: You can also use yarn instead of npm, and indeed it's a bit faster. Using yarn will also guarantee you get the package versions specified in the yarn.lock file.

That's it! Now you can use these commands:

  • grunt: builds crafty.js and validates it.
  • grunt api: builds the documentation
  • grunt view-api: builds the documentation, and opens it in your default browser
  • grunt check: runs tests and lints
  • grunt uglify: minifies crafty.js
  • grunt release: builds crafty.js, crafty-min.js, and the documentation