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

Repositories Explained

There are several repositories hosted on GitHub under the craftyjs project:

Main Repository Structure

This is an explanation of the main library development repo.

These are the important directories:

  • /src -- The source code for Crafty, broken into separate files that are reassembled
  • /build -- Scripts for building crafty and its API documentation
  • /tests/unit -- Unit and integration tests (using the qunit framework)
  • /tests/webdriver -- Regression tests (using webdriver)
  • /playgrounds -- Small tech demos of various parts of Crafty's functionality. They can be used to check functionality not covered by tests (such as whether specific rendering techniques work!)

Building

The build scripts currently use node. Full information can be found in wiki:Building.

Testing

If you've set up the grunt environment, you can run the tests with the command grunt check. The tests will use node's javascript engine (V8, same as Chrome), with PhantomJS for rendering.

You can also open up the tests/unit/index.html file to run unit & integration tests in a browser, which is necessary to test alternate browser engines.

Source code

To make Crafty more maintainable, it is split into many separate source files. Build scripts concatenate these files into one monolithic file: crafty.js. Comments in the source code are used to generate the documentation.

To quickly jump to the source code of an API functionality, follow the source code links on craftyjs.com/api.