<commit_before>Overview
========

Often when deploying JS components, you want to compile a multitude of source
files down to a single build result.  The benefits of doing this include faster
performance from the client perspective (due to fewer http hits to load
scripts), and potentially simpler integration by the developer integrating your
component. Gravity was specifically designed to ease this process.

`gravity` is a command-line tool that reads `gravity.map` files.

A `gravity.map` is a JSON file that can be thought of as a project manifest.  In
it, you can specify build targets, and the source files that are used to create
each target.

	{
		"final.js": [
			"src/1.js",
			"src/2.js",
			...
		]
	}

This tells gravity that you want a build product called `final.js`, and that it
should be the result of compiling various source files (or even other build
products) together.

Full documentation of gravity.map syntax can be found in the `SYNTAX.md` file.


Installation
============

Prerequisites:

 - node 0.6 or greater
 - git 1.7 or greater

To install to ~/git/gravity

	mkdir ~/git
	cd ~/git
	git clone <EMAIL>:ccampbell/gravity.git
	cd gravity
	git submodule update --init

Of course you can check it out wherever you like.  Just make sure you add the
gravity dir (in this example ~/git/gravity) to your path.


Commands
========

### gravity list

To see a list of all the build products, where `<dir>` is the location of your
project's directory (ie., wherever the gravity.map file is):

	gravity list <dir>


### gravity serve

During development, you can run gravity as a local server that will perform
on-the-fly concatenation of your source.

	gravity serve <dir>
<commit_msg>Add note about running commands on Windows<commit_after>Overview
========

Often when deploying JS components, you want to compile a multitude of source
files down to a single build result.  The benefits of doing this include faster
performance from the client perspective (due to fewer http hits to load
scripts), and potentially simpler integration by the developer integrating your
component. Gravity was specifically designed to ease this process.

`gravity` is a command-line tool that reads `gravity.map` files.

A `gravity.map` is a JSON file that can be thought of as a project manifest.  In
it, you can specify build targets, and the source files that are used to create
each target.

	{
		"final.js": [
			"src/1.js",
			"src/2.js",
			...
		]
	}

This tells gravity that you want a build product called `final.js`, and that it
should be the result of compiling various source files (or even other build
products) together.

Full documentation of gravity.map syntax can be found in the `SYNTAX.md` file.


Installation
============

Prerequisites:

 - node 0.6 or greater
 - git 1.7 or greater

To install to ~/git/gravity

	mkdir ~/git
	cd ~/git
	git clone <EMAIL>:ccampbell/gravity.git
	cd gravity
	git submodule update --init

Of course you can check it out wherever you like.  Just make sure you add the
gravity dir (in this example ~/git/gravity) to your path.


Commands
========

Mac/unix/cygwin users will be able to invoke "gravity" directly.  To run the
commands in Windows cmd.exe, just prepend "node " to the commands below.

### gravity list

To see a list of all the build products, where `<dir>` is the location of your
project's directory (ie., wherever the gravity.map file is):

	gravity list <dir>


### gravity serve

During development, you can run gravity as a local server that will perform
on-the-fly concatenation of your source.

	gravity serve <dir>

{'fraction_non_alphanumeric': 0.0790205898720089, 'fraction_numerical': 0.00333889816360601, 'mean_word_length': 3.819034852546917, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1904631', 'n_tokens_mistral': 1053, 'n_tokens_neox': 972, 'n_words': 529}