Skip to content

Commit

Permalink
Upgrade to Ionic beta.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lathonez committed Apr 22, 2016
1 parent b7ecb62 commit a571e7c
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 58 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<a name="1.?.?"></a>
# 1.?.? (2016-0?-??)
<a name="1.1.0"></a>
# 1.1.0 (2016-04-23)

### Features

* **Update**: Update to Ionic 2.0.0.beta.6 ([???????](https://github.com/lathonez/clicker/commit/???????))

### Bug Fixes

* **Unit Test**: Merge PR [#80]https://github.com/lathonez/clicker/pull/80) removing a trailing `;` ([e8fb205](https://github.com/lathonez/clicker/commit/e8fb205))
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ See the changelog [here](https://github.com/lathonez/clicker/CHANGELOG.md)

## Dependencies

**Angular 2:** 2.0.0-beta.15
**Ionic:** 2.0.0-beta.6

External dependencies are listed here to justify their inclusion and to enable their removal if you aren't using the related functionality.

* codecov.io: sending unit test coverage reports to codecov.io
Expand Down
18 changes: 14 additions & 4 deletions app/app.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS} from 'angular2/platform/testing/browser';
import { setBaseTestProviders } from 'angular2/testing';
import { IonicApp, Platform } from 'ionic-angular';
import { ClickerApp } from './app';

// this needs doing _once_ for the entire test suite, hence it's here
Expand All @@ -18,12 +17,23 @@ function getComponentStub(name: string): any {
return component;
}

class MockClass {
public ready(): any {
return new Promise((resolve: Function) => {
resolve();
});
}

public getComponent(): any {
return true;
}
}

describe('ClickerApp', () => {

beforeEach(() => {
let ionicApp: IonicApp = new IonicApp(null, null, null);
let platform: Platform = new Platform();
clickerApp = new ClickerApp(ionicApp, platform);
let mockClass: any = (<any>new MockClass());
clickerApp = new ClickerApp(mockClass, mockClass);
});

it('initialises with two possible pages', () => {
Expand Down
8 changes: 8 additions & 0 deletions app/components/clickerForm/clickerForm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ class MockClass {
public get(): any {
return {};
}

public getBoolean(): boolean {
return true;
}

public getNumber(): number {
return 42;
}
}

describe('ClickerForm', () => {
Expand Down
6 changes: 5 additions & 1 deletion app/pages/clickerList/clickerList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ class MockClass {
return {};
}

public getBoolean(): any {
public getBoolean(): boolean {
return true;
}

public getNumber(): number {
return 42;
}
}

let clickerList: ClickerList = null;
Expand Down
71 changes: 35 additions & 36 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Clicker</name>
<description>An Ionic Framework and Cordova project.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<plugin name="cordova-plugin-device" spec="~1.1.1" />
<plugin name="cordova-plugin-console" spec="~1.0.2" />
<plugin name="cordova-plugin-whitelist" spec="~1.2.1" />
<plugin name="cordova-plugin-splashscreen" spec="~3.2.1" />
<plugin name="cordova-plugin-statusbar" spec="~2.1.2" />
<plugin name="ionic-plugin-keyboard" spec="~2.0.1" />
</widget>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.myapp107445" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Clicker</name>
<description>An Ionic Framework and Cordova project.</description>
<author email="shazleto@gmail.com" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html"/>
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
</platform>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<plugin name="cordova-plugin-device" spec="~1.1.2"/>
<plugin name="cordova-plugin-console" spec="~1.0.3"/>
<plugin name="cordova-plugin-whitelist" spec="~1.2.2"/>
<plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>
<plugin name="cordova-plugin-statusbar" spec="~2.1.3"/>
<plugin name="ionic-plugin-keyboard" spec="~2.0.1"/>
</widget>
9 changes: 8 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ var copyHTML = require('ionic-gulp-html-copy');
var copyFonts = require('ionic-gulp-fonts-copy');
var copyScripts = require('ionic-gulp-scripts-copy');

var isRelease = argv.indexOf('--release') > -1;

gulp.task('watch', ['clean'], function(done){
runSequence(
['sass', 'html', 'fonts', 'scripts'],
Expand All @@ -48,10 +50,15 @@ gulp.task('build', ['clean'], function(done){
runSequence(
['sass', 'html', 'fonts', 'scripts'],
function(){
buildBrowserify().on('end', done);
buildBrowserify({
browserifyOptions: {
debug: !isRelease
}
}).on('end', done);
}
);
});

gulp.task('sass', buildSass);
gulp.task('html', copyHTML);
gulp.task('fonts', copyFonts);
Expand Down
2 changes: 1 addition & 1 deletion ionic.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"app_id": "",
"v2": true,
"typescript": true
}
}
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"dependencies": {
"angular2": "2.0.0-beta.13",
"es6-promise": "3.1.2",
"angular2": "2.0.0-beta.15",
"es6-shim": "^0.35.0",
"ionic-angular": "2.0.0-beta.4",
"ionic-angular": "2.0.0-beta.6",
"ionic-native": "^1.1.0",
"ionicons": "3.0.0-alpha.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.6"
"zone.js": "0.6.10"
},
"devDependencies": {
"codecov.io": "0.1.6",
Expand Down Expand Up @@ -47,7 +46,7 @@
"typings": "0.7.12"
},
"name": "clicker",
"version": "1.0.0",
"version": "1.1.0",
"description": "clicker: An Ionic project",
"cordovaPlugins": [
"cordova-sqlite-storage",
Expand Down
18 changes: 10 additions & 8 deletions test/app.stub.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"use strict";
var core_1 = require('angular2/core');
var browser_1 = require('angular2/platform/browser');
var app_1 = require('../components/app/app');
var tap_click_1 = require('../components/tap-click/tap-click');
var bootstrap_1 = require('../config/bootstrap');
var directives_1 = require('../config/directives');
var _reflect = Reflect;
Expand All @@ -13,7 +11,11 @@ var _reflect = Reflect;
* number of arguments that act as global config variables for the app.
* `@App` is similar to Angular's `@Component` in which it can accept a `template`
* property that has an inline template, or a `templateUrl` property that points
* to an external html template.
* to an external html template. The `@App` decorator runs the Angular bootstrapping
* process automatically, however you can bootstrap your app separately if you prefer.
* Additionally, `@App` will automatically bootstrap with all of Ionic's
* core components, meaning they won't all have to be individually imported and added
* to each component's `directives` property.
*
* @usage
* ```ts
Expand Down Expand Up @@ -42,8 +44,6 @@ function App(args) {
// get current annotations
var annotations = _reflect.getMetadata('annotations', cls) || [];
// args.selector = 'ion-app'; -- exactly the same as Ionic's apart from this line
// auto add Ionic directives
args.directives = args.directives ? args.directives.concat(directives_1.IONIC_DIRECTIVES) : directives_1.IONIC_DIRECTIVES;
// if no template was provided, default so it has a root <ion-nav>
if (!args.templateUrl && !args.template) {
args.template = '<ion-nav></ion-nav>';
Expand All @@ -54,13 +54,15 @@ function App(args) {
_reflect.defineMetadata('annotations', annotations, cls);
// define array of bootstrap providers
var providers = bootstrap_1.ionicProviders(args).concat(args.providers || []);
// auto add Ionic directives
var directives = args.directives ? args.directives.concat(directives_1.IONIC_DIRECTIVES) : directives_1.IONIC_DIRECTIVES;
// automatically provide all of Ionic's directives to every component
providers.push(core_1.provide(core_1.PLATFORM_DIRECTIVES, { useValue: [directives], multi: true }));
if (args.prodMode) {
core_1.enableProdMode();
}
browser_1.bootstrap(cls, providers).then(function (appRef) {
appRef.injector.get(tap_click_1.TapClick);
var app = appRef.injector.get(app_1.IonicApp);
app.setProd(args.prodMode);
bootstrap_1.postBootstrap(appRef, args.prodMode);
});
return cls;
};
Expand Down
2 changes: 2 additions & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

<!-- cordova.js required for cordova apps -->
<script src="cordova.js"></script>
<!-- Polyfill needed for platforms without Promise and Collection support -->
<script src="build/js/es6-shim.min.js"></script>
<!-- Zone.js and Reflect-metadata -->
<script src="build/js/angular2-polyfills.js"></script>
<!-- the bundle which is built from the app's source code -->
Expand Down

0 comments on commit a571e7c

Please sign in to comment.