mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00

When using npm link to develop against Ionic locally, most setups by default require the use of 'sudo', which then requires the gulp clean task to also be run with sudo. Switch to mkdirp-no-bin so there are no root owned files in dist/node_modules when using sudo npm link.
Development
Building & Running Ionic Source
npm install
gulp watch
- Go to http://localhost:8000/dist/e2e/
- Stay cool
Building & Running Component Demos
- Clone the
ionic-site
repo inionic2/dist/
:git clone git@github.com:driftyco/ionic-site.git
- You may need to remove the existing directory first:
rm -rf ionic2/dist/ionic-site
- Run
gulp watch:demos
from the top level directory - Navigate to
ionic2/dist/ionic-site
and runnpm install
- Run
gulp watch
in this directory - A browser should launch at
http://localhost:3000
at which point you can navigate tohttp://localhost:3000/docs/v2/components/
Building & Running API Demos
- Follow the steps for Building & Running Ionic Source
- Run
gulp demos
- Run
gulp watch:demos
- 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
Building NPM Module for Local Testing
From ionic
repo root directory:
gulp package --strip-debug false
cd dist
sudo npm link
- After ionic changes:
gulp transpile.no-typecheck --strip-debug false && gulp copy.scss
From Testing App root directory:
npm link ionic-framework
ionic serve
orionic run
or whatever
When done:
- In testing app,
npm uninstall ionic-framework
- In ionic repo,
sudo gulp clean
Running Snapshot
- Install Protractor:
npm install -g protractor
- Export
IONIC_SNAPSHOT_KEY
(get from someone) - Run
gulp snapshot
Running Tests
gulp karma
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 🍷)
Releasing Component Demos
(Copied from ionic-preview-app, check there for updates)
- Set production mode to true
- Rebuild app
- Copy the contents of this entire repo to
ionic-site/dist/preview-app/
(cp -R * ../path/to/ionic-site/dist/preview-app/
)
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.