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
- If necessary, install node and its package manager npm. Crafty is currently tested with node v6.
- Use npm to globally install the grunt commandline tool:
npm install grunt-cli -g. (You might need elevated permissions for a global install.)
- Install the packages Crafty uses to build by running
npm installin 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_modulesdirectory 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
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