
* chore(e2e): add livereload server and clean task for e2e * chore(e2e): refactor to use gulp connect and open * chore(e2e): WIP remove open, add formatting, add reload task * wip(e2e): use SystemJS for faster dev e2e rebuilds * chore(e2e): wip removing old gulp file, old e2e task update template for e2e and port number * chore(e2e): wip add SystemJS for dev build of e2e, use those tasks instead * chore(e2e): uncomment out range components * chore(e2e): wip fix paths for the e2e tempate * chore(scripts): update README back to the old way * chore(e2e): code cleanup * chore(e2e): split tasks into dev and prod, put common tasks in e2e * chore(e2e): rename e2e templates and add to readme * chore(e2e): fix dev build so it will work with snapshot * chore(snapshot): get snapshot working with dev and prod builds
5.2 KiB
Development
Getting Started
All of these commands require you to run npm install
first. To see a full list of the gulp commands, run gulp
.
Installing Nightly Version
The latest nightly version can be installed via npm.
- Run
npm install --save ionic-angular@nightly
- Your
package.json
file'sdependencies
will be updated with the nightly version. - Restart any
watch
orserve
commands that may be already running.
Building Ionic Source
Run gulp build
or gulp watch
to watch for changes.
Building & Running e2e Tests
Development
- Run
gulp e2e
orgulp e2e.watch
to watch for changes. - Navigate to
http://localhost:8000/dist/e2e
Validation
The following commands take longer to run because they use AoT compilation. They should really only be used to validate that our components work with AoT, and fix them if not.
- Run
gulp e2e.prod
to bundle all e2e tests, or pass a folder for a specific test. For example,gulp e2e.prod --f=alert/basic
will build the test insrc/components/alert/test/basic
. - Run
gulp e2e.watchProd
with a folder passed to watch a test. For example,gulp e2e.watchProd --f=select/single-value
will watch the test insrc/components/select/test/single-value
. - Navigate to
http://localhost:8000/dist/e2e
Building & Running API Demos
- Run
gulp demos
orgulp demos.watch
to watch for changes. - Navigate to
http://localhost:8000/dist/demos
Building API Docs
gulp docs
to build the nightly versiongulp docs --doc-version=2.0.0
to build a specific API version
Developing against Ionic locally
From ionic
directory:
gulp package build
or (gulp package watch
, then open another terminal for step 2)cd dist
npm link
(may requiresudo
)
From your app directory:
npm link ionic-angular
ionic serve
orionic run
orionic emulate
To remove the linked version of ionic-angular
do npm rm ionic-angular
, and then reinstall using npm install ionic-angular
.
Running Snapshot
Setup
- Install Protractor:
npm install -g protractor@2.5.1
- Run
webdriver-manager update
- Export
IONIC_SNAPSHOT_KEY
(get from someone)
Commands
gulp snapshot
will run thegulp e2e.prod
task with AoT compilation.gulp snapshot.skipBuild
will skip thegulp e2e.prod
task with AoT compilation.gulp snapshot.dev
will run a development build using thegulp e2e
task.gulp snapshot.quick
will skip the build and run snapshot without uploading to the server.
Flags
--f | -folder
will run the command with a test folder. For example,gulp snapshot --f=action-sheet/basic
will run snapshot for the test atsrc/components/action-sheet/test/basic
.
Running Tests
gulp validate
Running Sass Linter
Requires Ruby. Skip this step entirely if you are unable to install Ruby.
- See the Sass Guidelines for editing the Sass.
- Install the linter:
gem install scss_lint
- Run
gulp lint.sass
and fix any linter errors.
Running TypeScript Linter
- Run
gulp lint.ts
and fix any errors.
Releasing
Releasing Ionic Source
- Run snapshot & verify all changes are intentional, update master snapshot if so
- Run
gulp release
- Pulls latest from GitHub
- Runs
gulp validate
- Builds npm package files into dist
- Updates package.json version
- Removes debug statements
- Updates changelog
- Publishes to npm
- Creates a new tag and release on Github
- Verify that the
changelog
changes are accurate and thepackage.json
version is correct (git status
&&git diff
) - Commit and push
- Sit back and have a beer 🍻 (or wine 🍷)
Publish a nightly release
- Run
gulp nightly
- Pulls latest from GitHub
- Runs
gulp validate
- Builds npm package files into dist
- Removes debug statements
- Publishes to npm using the
nightly
tag with the date/time of publish added to the version:2.0.0-rc.0
results in2.0.0-rc.0-201610131811
npm install ionic-angular@nightly
will now install the latest nightly release- Run
npm view ionic-angular
to see 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 demos
and then gulp docs
, and it'll compile and copy the demos to the ionic-site
repo, ready for testing.