marcoturi / ionic-boilerplate

✨ An Ionic Starter kit featuring Tests, E2E, Karma, Protractor, Jasmine, Istanbul, Gitlab CI, Automatic IPA and APK, TypeScript 2, TsLint, Codelyzer, Typedoc, Yarn, Rollup, and Webpack 2
MIT License
318 stars 107 forks source link
angular angular5 boilerplate codelyzer docker gitlab-ci headless-chrome ionic ionic2 ionic3 karma protractor rollup typedoc typescript webpack

IONIC Boilerplate

MIT license Dependency Status devDependencies Status build status coverage report Join the chat at https://gitter.im/marcoturi/ionic2-boilerplate
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

Features

Roadmap

Installation & Configuration

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
TO RUN SCSS-LINT: Make sure you have Ruby >= 2

NPM scripts commands

Task Description
dev Run ionic serve
build Full production build. Use --dev flag for dev build.
release Generate changelog based on commits
push Shortcut for git push origin master --follow-tags
lint Lint with tslint
scss-lint Lint scss
test Runs Karma test
test:watch Runs Karma test watching for edits (TDD style)
e2e Runs e2e protractor tests
e2e:interactive Runs e2e protractor tests in interactive mode
docs Generate code documentation through Typedoc
outdated Search npm packages for outdated dependencies
post-install Update web-driver to be able to run e2e tests.
ios:dev Build .ipa using dev environment vars
ios:release Build .ipa with production environment vars
android:dev Build .apk using dev environment vars
android:release Build .apk with production environment vars

Gitlab CI Configuration

Key Description
IONIC_EMAIL Your ionic.io email
IONIC_PASSWORD Your 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_PROFILE Security profile to use for the build, as defined in Ionic.io console.

Tips

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

Git Workflow

Useful Links

Ionic & Cordova

Webstorm

Windows

License

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