This document describes how to set up your development environment to build and test Zeroth.
- Prerequisite Software
- Getting the Sources
- Environment Variable Setup
- Installing NPM Modules and Dart Packages
- Build commands
- Running Tests Locally
- Code Style
- Project Information
- CI using Travis
- Transforming Dart code
- Debugging
See the contribution guidelines if you'd like to contribute to Zeroth.
Before you can build and test Zeroth, you must install and configure the following products on your development machine:
-
Git and/or the GitHub app (for Mac or Windows); GitHub's Guide to Installing Git is a good source of information.
-
Node.js, (version
>=5.4.1 <6
) which is used to run a development web server, run tests, and generate distributable files. We also use Node's Package Manager,npm
(version>=3.5.3 <4.0
), which comes with Node. Depending on your system, you can install Node either from source or as a pre-packaged bundle.
Fork and clone the Zeroth repository:
- Login to your GitHub account or create one by following the instructions given here.
- Fork the main Zeroth repository.
- Clone your fork of the Zeroth repository and define an
upstream
remote pointing back to the Zeroth repository that you forked in the first place.
# Clone your GitHub repository:
git clone git@github.com:<github username>/zeroth.git
# Go to the Zeroth directory:
cd zeroth
# Add the main Zeroth repository as an upstream remote to your repository:
git remote add upstream https://github.com/zeroth/zeroth.git
Next, install the JavaScript modules and Dart packages needed to build and test Zeroth:
# Install Zeroth project dependencies (package.json)
npm install
To build Zeroth and prepare tests, run:
u build
Notes:
- Library output is put in the
lib
folder.
You can selectively test either the browser or server suites as follows:
u build browser
u build server
To clean out the dist
folder, run:
u clean
u test
: full test suite for both browser and server of Zeroth. These are the same tests that run on Travis.
You can selectively run either environment as follows:
u test server
u test browser
Note: If you want to only run a single test you can alter the test you wish to run by changing
it
to iit
or describe
to ddescribe
. This will only run that individual test and make it
much easier to debug. xit
and xdescribe
can also be useful to exclude a test and a group of
tests respectively.
We use tslint for linting. See linting rules in gulpfile. To lint, run
$ u lint
The following gulp task will generate the API docs in the dist-docs
directory:
$ u doc build
You can serve the generated documentation to check how it would render on zeroth.io:
$ u doc watch
Then open your browser to http://localhost:8080 to view the docs. Note that any edits to the markdown files that make up the docs will be live reloaded, but changes to assets or templates will need a restart to the doc watcher.
This document is modified from the Angular 2 developer guide