Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 2.34 KB

developing.md

File metadata and controls

39 lines (24 loc) · 2.34 KB

Developers - running / updating / testing imjs

Building imjs

Setup

  1. You'll need to have node.js - but we prefer to use it via nvm to manage node versions, since node changes versions very fast. Make sure you have Node 8 or greater via node --version
  2. Once that's set up, make sure you have grunt, mocha installed globally
npm install -g mocha grunt
  1. Clone the repo and change into its directory if you haven't already.
  2. Install dependencies: npm install. (Note - this is not a duplicate of step 2. Step 2 installs some global dependencies that can be used outside of this package, whereas step 4 installs local dependencies that are used to build this package).

Adding new classes to the API

  1. Ideally, any new class added to the API should be in its own separate file.
  2. service.coffee acts as the entry point to the API. In order to add to the public part of the API, import the functionality in the file (at the top) and re-export it (at the bottom). Same pattern has to be followed to ensure that your file is correctly being added to the final build file.
  3. Update build-order.json and BUILD_ORDER (if required) so that your files are concatenated in the final build in correct order.

Running / updating imjs

See the gruntfile for possible tasks to be run. A default task that runs the build and tests is simply grunt.

Building the docs

If you need to regenerate the API documentation, make sure you have codo installed globally, and run codo in the root directory. Config is automatically pulled from the .codoopts file.

Running tests

Setting up tests to run on your local machine can be a bit tedious - it's usually easier to set up TravisCI for your repo, and allow travis to test code you push to a branch on your repo. Read more about testing setup in test/README.md

Trying out imjs

You can invoke imjs to test specific features manually by using npm run repl to test in a Node environment and npm run serve to test in a browser environment.

Releasing imjs

See release procedures.