Home

Awesome

IONIC Boilerplate

MIT license Dependency Status devDependencies Status build status coverage report Join the chat at https://gitter.im/marcoturi/ionic2-boilerplate <br>A ionic boilerplate for starting new projects. This boilerplate will follow the best practices for angular and ionic development.

NOTE: I moved Unit tests from running through Rollup to Webpack with release 0.10.0. If you are looking to the old configuration see the rollup branch.

Table of Contents

<a name="features"></a>Features

<a name="roadmap"></a>Roadmap

<a name="installation"></a>Installation & Configuration

<a name="quick-start"></a>Quick Start

# Required dependecies (on Mac Os also install ios-sim and ios-deploy)
npm i -g cordova ionic yarn
gem install scss_lint

# Clone the repo --depth 1 removes all but one .git commit history
git clone --depth 1 https://github.com/marcoturi/ionic2-boilerplate.git

# Change directory
cd ionic2-boilerplate

# Install project dependencies
yarn --ignore-engines
npm run post-install

# Launch ionic serve
npm run dev

TO RUN IONIC: Make sure you have Node version >= 6.X and NPM >= 3 <br> TO RUN SCSS-LINT: Make sure you have Ruby >= 2 <br>

<a name="npm-scripts"></a>NPM scripts commands

TaskDescription
devRun ionic serve
buildFull production build. Use --dev flag for dev build.
releaseGenerate changelog based on commits
pushShortcut for git push origin master --follow-tags
lintLint with tslint
scss-lintLint scss
testRuns Karma test
test:watchRuns Karma test watching for edits (TDD style)
e2eRuns e2e protractor tests
e2e:interactiveRuns e2e protractor tests in interactive mode
docsGenerate code documentation through Typedoc
outdatedSearch npm packages for outdated dependencies
post-installUpdate web-driver to be able to run e2e tests.
ios:devBuild .ipa using dev environment vars
ios:releaseBuild .ipa with production environment vars
android:devBuild .apk using dev environment vars
android:releaseBuild .apk with production environment vars

<a name="gitlab-ci"></a>Gitlab CI Configuration

KeyDescription
IONIC_EMAILYour ionic.io email
IONIC_PASSWORDYour ionic.io password
IONIC_PACKAGE_BUILD_RELEASE(Optional) Indicate whether this is a release build. Possible values are true or false. Defaults to false.
IONIC_PACKAGE_BUILD_PROFILESecurity profile to use for the build, as defined in Ionic.io console.

<a name="tips"></a>Tips

<a name="optional-libraries"></a>Optional Libraries

If you want everything to just work nicely with rollup, use es2015 libraries like lodash-es instead of lodash. In the case of lodash-es try to do: import map from 'lodash-es/map' rather than import { map } from 'lodash-es'. See here for further info. To find examples on how to import 3rd party libs with ionic and rollup see here and here

<a name="git-workflow"></a>Git Workflow

git add .
npm run commit // this will run tslint + scss lint + commit
npm run push // this will run unit tests + push to master
// now check on GITLAB if there are no errors, than if you want push your commits to the release branch to get automatic ipa and apk

<a name="links"></a>Useful Links

<a name="ionic-cordova"></a>Ionic & Cordova

<a name="webstorm"></a>Webstorm

<a name="windows"></a>Windows

<a name="license"></a>License

Copyright (c) 2016 Marco Turi
Source code is open source and released under the MIT license.