Development
Getting Started
All of these commands require you to run npm install first. Add the --typecheck flag to generate type definitions (.d.ts) and do type checking, but keep in mind builds and rebuilds when watching will be significantly slower (~1min and ~1s respectively, vs ~20s and ~200ms without typechecking).
Installing Nightly Version
The latest nightly version can be installed via npm.
- Run
npm install --save ionic-angular@nightly - Your
package.jsonfile'sdependencieswill be updated with the nightly version. - Restart any
watchorservecommands that may be already running.
Building Ionic Source
Run gulp build or gulp watch to watch for changes.
Building & Running e2e Tests
- Run
gulp e2eorgulp watch.e2eto watch for changes. - Navigate to
http://localhost:8000/dist/e2e
Building & Running API Demos
- Run
gulp demosorgulp watch.demosto watch for changes. - Navigate to
http://localhost:8000/dist/demos
Building API Docs
gulp docsto build the nightly versiongulp docs --doc-version=2.0.0to build a specific API version
Developing against Ionic locally
From ionic directory:
gulp package buildor (gulp package watch, then open another terminal for step 2)cd distnpm link(may requiresudo)
From your app directory:
npm link ionic-angularionic serveorionic runorionic emulate
To remove the linked version of ionic-angular do npm rm ionic-angular, and then reinstall using npm install ionic-angular.
Running Snapshot
- Install Protractor:
npm install -g protractor@2.5.1 - Run
webdriver-manager update - Export
IONIC_SNAPSHOT_KEY(get from someone) - Run
gulp snapshot
Running Tests
gulp karma
Running Sass Linter
- See the Sass Guidelines for editing Sass and running the linter.
Releasing
Releasing Ionic Source
- Run
gulp prerelease
- Pulls latest
- updates package.json minor version
- updates changelog
- builds npm package files into dist
- Verify that changelog changes and package.json update are correct (
git status&&git diff) - Run snapshot & update if necessary
- Commit and push
- Run
gulp release
- publishes to npm
- Creates a new tag and release on Github
- Sit back and have a beer 🍺 (or wine 🍷)
Publish a nightly release
- Run
gulp publish.nightly
- Pulls latest
- builds npm package files into dist
- updates package.json to a nightly version for publish: 0.1.0-beta.0 results in 0.1.0-beta.0-r8e7684t
- publishes to NPM using the nightly tag
npm install ionic-angular@nightlywill now install the latest nightly release
Releasing Component Demos
Ionic Component demos are automatically compiled and deployed to the ionic staging site on every commit in ionic-preview-app. No action is necessary.
If you'd like to manually update the demos, follow the steps on the preview app for running locally on the site.
Releasing API Demos
Ionic API demos are automatically compiled and deployed to the ionic staging site on every commit. No action is necessary.
If you'd like to manually update the demos, clone the ionic-site repo as a sibling of ionic. From ionic run gulp docs, and it'll compile and copy the demos to the ionic-site repo, ready for testing or committing.