Skip to content

Commit

Permalink
Add a watch command, update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
fdb committed May 15, 2017
1 parent c83ab53 commit 8381ccd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -4,7 +4,7 @@

The source of opentype.js is divided into modules, located in the `src` directory.

We use [browserify](http://browserify.org/) to combine this into a single package with every release.
We use [rollup](https://rollupjs.org/) 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.

Expand All @@ -21,7 +21,7 @@ When creating a pull request, you **don't** need to run `npm run dist` -- we'll
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.

4. Install the development dependencies (browserify, watchify, jshint, ...):
4. Install the development dependencies:

`cd opentype.js`
`npm install`
Expand All @@ -30,8 +30,7 @@ When creating a pull request, you **don't** need to run `npm run dist` -- we'll

`npm start`

Note that the compiled file ends up in the `build` folder, not the `dist` folder! The development server
rewrites the JavaScript URL from `dist/opentype.min.js` to `build/opentype.js`.
This bundles all source files under `dist/opentype.js`.

6. Make some changes

Expand Down
16 changes: 7 additions & 9 deletions README.md
Expand Up @@ -26,7 +26,7 @@ Here's an example. We load a font, then display it on a canvas with id "canvas":
}
});

See [the project website](http://nodebox.github.io/opentype.js/) for a live demo.
See [the project website](https://opentype.js.org/) for a live demo.

Features
========
Expand All @@ -47,6 +47,12 @@ Installation
[Download the latest ZIP](https://github.com/nodebox/opentype.js/archive/master.zip) and grab the files in the `dist`
folder. These are compiled.

### Using npm

npm install --save opentype.js

OpenType.js uses ES6-style imports, so debugging it in Node.js requires running `npm run build` first. Use `npm run watch` to automatically rebuild when files change.

### Using Bower

To install using [Bower](http://bower.io/), enter the following command in your project directory:
Expand All @@ -57,14 +63,6 @@ You can then include them in your scripts using:

<script src="/bower_components/opentype.js/dist/opentype.js"></script>

### Using Node / Browserify

To install using [Browserify](http://browserify.org/), enter the following command in your project directory:

npm install --save opentype.js

OpenType.js uses ES6-style imports, so debugging it in Node.js requires running `npm run build` first.

API
===
### Loading a font
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -26,6 +26,7 @@
},
"scripts": {
"start": "node ./bin/server.js",
"watch": "rollup -c -w",
"test": "mocha --require reify --compilers js:buble/register --recursive && jshint . && jscs .",
"build": "rollup -c",
"minify": "cross-env MINIFY=1 npm run build",
Expand Down

0 comments on commit 8381ccd

Please sign in to comment.