The source of opentype.js is divided into modules, located in the src
directory.
We use rollup to combine this into a single package with every release.
When creating a pull request, you don't need to run npm run dist
-- we'll do that when creating a release.
-
On our GitHub page, click the "Fork" button to create your personal fork of the opentype.js repository.
-
Clone your repository:
git clone git://github.com/opentypejs/opentype.js.git
-
Create a new branch for your feature. For example:
git checkout -b my-awesome-feature
. A dedicated branch for your pull request means you can develop multiple features at the same time, and ensures that your pull request is stable even if you later decide to develop an unrelated feature. -
Install the development dependencies:
cd opentype.js
npm install
-
Start the development server. This watches file changes and compiles and serves the page at http://localhost:8080/
npm start
This bundles all source files under
dist/opentype.js
. -
Make some changes
-
Check if tests pass
npm test
-
Commit your changes
git add --all && git commit
-
Submit your pull request -- and thanks in advance!
If you want to create your own self-contained version of opentype.js, run
`npm run dist`
This compiles the source and places opentype.js
and opentype.min.js
in the dist
folder.
We use a set of npm scripts to build releases:
- Update the version number in
package.json
andbower.json
. - Add information about the new release in
RELEASES.md
. - Run
npm run dist
to update the files in thedist
folder. - Commit (
git commit -a
) and create a tag (e.g.git tag 1.2.1
). Push and push tags (git push && git push --tags
). - Once published, Travis will push the new tagged release to npm. Bower updates automatically.