3
## Organization of the source code
5
The source of opentype.js is divided into modules, located in the `src` directory.
7
We use [browserify](http://browserify.org/) to combine this into a single package with every release.
9
When creating a pull request, you **don't** need to run `npm run dist` -- we'll do that when creating a release.
11
## How to hack on the source
13
1. On our [GitHub page](https://github.com/nodebox/opentype.js), click the "Fork" button to create your personal fork
14
of the opentype.js repository.
16
2. Clone your repository:
18
git clone git://github.com/nodebox/opentype.js.git
20
3. Create a new branch for your feature. For example: `git checkout -b my-awesome-feature`.
21
A dedicated branch for your pull request means you can develop multiple features at the same time, and ensures
22
that your pull request is stable even if you later decide to develop an unrelated feature.
24
4. Install the development dependencies (browserify, watchify, jshint, ...):
29
5. Start the development server. This watches file changes and compiles and serves the page at http://localhost:8080/
33
Note that the compiled file ends up in the `build` folder, not the `dist` folder! The development server
34
rewrites the JavaScript URL from `dist/opentype.min.js` to `build/opentype.js`.
38
7. Check if tests pass
42
8. Commit your changes
44
git add --all && git commit
46
9. Submit your pull request -- and thanks in advance!
48
## Making a distributable for yourself
50
If you want to create your own self-contained version of opentype.js, run
54
This compiles the source and places `opentype.js` and `opentype.min.js` in the `dist` folder.
56
## How we publish a release
58
We use a set of [npm scripts](https://www.npmjs.org/doc/misc/npm-scripts.html) to build releases:
60
1. Update the version number in `package.json` and `bower.json`.
61
2. Add information about the new release in `RELEASES.md`.
62
3. Run `npm run dist` to update the files in the `dist` folder.
63
4. Commit (`git commit -a`) and create a tag (e.g. `git tag 1.2.1`). Push and push tags (`git push && git push --tags`).
64
5. Run `npm publish` to publish the package to npm. Bower updates automatically.