diff --git a/config.js b/config.js index 24ed2a4a78..ac50c1e94d 100644 --- a/config.js +++ b/config.js @@ -7,10 +7,10 @@ System.config({ ] }, "paths": { - "ionic/*": "dist/ionic/*.js", + //"ionic/*": "dist/js/es6/ionic/*.js", "github:*": "jspm_packages/github/*.js", "npm:*": "jspm_packages/npm/*.js", - "angular2/*": "angular2/dist/js/dev/es6/angular2/*.es6", + //"angular2/*": "angular2/dist/js/dev/es6/angular2/*.es6", "*": "*.js" } }); diff --git a/gulpfile.js b/gulpfile.js index 79e3c07d81..84a424d06b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -23,12 +23,20 @@ var webpack = require('gulp-webpack'); var lazypipe = require('lazypipe'); -gulp.task('build', function() { +gulp.task('clean.build', function() { runSequence( 'clean', - 'ionic.traceur', + 'ionic.transpile', 'ionic.bundle.deps', - 'ionic.bundle.js', + 'ionic.examples', + 'sass', + 'fonts', + 'polyfills'); +}) + +gulp.task('build', function() { + runSequence( + 'ionic.transpile', 'ionic.examples', 'sass', 'fonts', @@ -39,24 +47,17 @@ gulp.task('watch', function() { runSequence( 'clean', - 'link.angular', - 'ionic.copy.js', + 'ionic.traceur', + 'ionic.bundle.deps', + 'ionic.bundle.js', 'ionic.examples', 'sass', 'fonts', 'polyfills', function() { - watch('ionic/**/*.js', function(file) { - var splt = file.path.split('/'); - var filename = splt[splt.length - 1]; - - var dest = file.path.replace(__dirname, '../angular-ionic/modules'); - dest = dest.replace(filename, '') - - doubleCheckDistFiles(); - - return gulp.src(file.path).pipe(gulp.dest(dest)); + watch('ionic/**/*.js', function() { + gulp.start(''); }); watch('ionic/components/*/test/**/*', function() { @@ -98,32 +99,37 @@ var babelOptions = { 'angular2-annotations', 'type-assertion:after' ],*/ - modules: "system" + modules: "system", + moduleIds: true, + getModuleId: function(name) { + return "ionic/" + name; + } }; -gulp.task('ionic.traceur', function(done) { +gulp.task('ionic.transpile', function(done) { return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*']) .pipe(traceur(traceurOptions)) - .pipe(gulp.dest('dist/ionic')); -}); - -gulp.task('ionic.bundle.js', function() { - var Builder = require('systemjs-builder'); - var builder = new Builder(); - return builder.loadConfig('config.js').then(function(){ - builder.config({ baseURL: 'file:' + process.cwd() }); - return builder.build('dist/ionic/ionic - dist/js/dependencies', 'dist/js/ionic.bundle.js'); - }, function(error){ - throw new Error(error); - }) + .pipe(gulp.dest('dist/js/es6/ionic')) + .pipe(babel(babelOptions)) + .pipe(gulp.dest('dist/js/es5/ionic')) + .pipe(concat('ionic.bundle.js')) + .pipe(gulp.dest('dist/js/')); }); gulp.task('ionic.bundle.deps', function() { - var Builder = require('systemjs-builder'); + var Builder = require('systemjs-builder') var builder = new Builder(); return builder.loadConfig('config.js').then(function(){ - builder.config({ baseURL: 'file:' + process.cwd() }); - return builder.build('dist/ionic/ionic - [dist/ionic/ionic]', 'dist/js/dependencies.js'); + // add ionic and angular2 build paths, since config.js is loaded at runtime from + // tests we don't want to put them there + builder.config({ + baseURL: 'file:' + process.cwd(), + paths : { + "ionic/*": "dist/js/es6/ionic/*.js", + "angular2/*": "angular2/dist/js/dev/es6/angular2/*.es6", + } + }); + return builder.build('dist/js/es6/ionic/**/* - [dist/js/es6/ionic/**/*]', 'dist/js/dependencies.js'); }, function(error){ throw new Error(error); }) @@ -132,7 +138,7 @@ gulp.task('ionic.bundle.deps', function() { gulp.task('ionic.examples', function() { var buildTest = lazypipe() .pipe(traceur, traceurOptions) - .pipe(babel, babelOptions) + //.pipe(babel, babelOptions) Let SystemJS load index.js at runtime, saves build time // Get each test folder with gulp.src return gulp.src('ionic/components/*/test/*/**/*') diff --git a/ionic/components/aside/config.js b/ionic/components/aside/config.js index a0d2d8d976..862916c42f 100644 --- a/ionic/components/aside/config.js +++ b/ionic/components/aside/config.js @@ -1,7 +1,7 @@ -import {ComponentConfig} from 'ionic/config/component-config' +import {ComponentConfig} from 'ionic/config/component' import {Aside} from 'ionic/components/aside/aside'; -import * as asideTypes from 'ionic/components/aside/types/types' -import * as asideGestures from 'ionic/components/aside/gestures/gestures'; +import * as asideTypes from 'ionic/components/aside/extensions/types' +import * as asideGestures from 'ionic/components/aside/extensions/gestures'; export let AsideConfig = new ComponentConfig(Aside) diff --git a/ionic/components/nav/nav.js b/ionic/components/nav/nav.js index 57ea0fb829..fb2c1604f6 100644 --- a/ionic/components/nav/nav.js +++ b/ionic/components/nav/nav.js @@ -8,7 +8,10 @@ import {Injector} from 'angular2/di'; import {ViewContainerRef} from 'angular2/src/core/compiler/view_container_ref'; import {Compiler} from 'angular2/angular2'; -import {NavBase} from './nav-base'; +import {NavController} from './nav-controller'; +import {NavItem, NavParams} from './nav-item'; +import {Tabs} from '../tabs/tabs'; +//import {nav} from './nav-base'; import {SwipeHandle} from './swipe-handle'; import {IonicComponent} from '../../config/component'; diff --git a/ionic/components/split-view/split-view.js b/ionic/components/split-view/split-view.js index 51c69b05dc..e8f0fed47c 100644 --- a/ionic/components/split-view/split-view.js +++ b/ionic/components/split-view/split-view.js @@ -1,6 +1,6 @@ import {Component, Parent, Decorator, View, NgElement} from 'angular2/angular2' import {Nav} from 'ionic/components/nav/nav' -import {NavPane} from 'ionic/components/nav-pane/nav-pane' +//import {NavPane} from 'ionic/components/nav-pane/nav-pane' import * as util from 'ionic/util' // TODO consider more explicit API, a la tabs diff --git a/scripts/e2e/ionic.template.html b/scripts/e2e/ionic.template.html index e4158299bf..45654a243c 100644 --- a/scripts/e2e/ionic.template.html +++ b/scripts/e2e/ionic.template.html @@ -21,16 +21,17 @@ - + - - - + + + + diff --git a/scripts/component/Reflect.js b/scripts/resources/Reflect.js similarity index 100% rename from scripts/component/Reflect.js rename to scripts/resources/Reflect.js diff --git a/scripts/component/babel-external-helpers.js b/scripts/resources/babel-external-helpers.js similarity index 100% rename from scripts/component/babel-external-helpers.js rename to scripts/resources/babel-external-helpers.js diff --git a/scripts/component/es6-module-loader.js b/scripts/resources/es6-module-loader.js similarity index 100% rename from scripts/component/es6-module-loader.js rename to scripts/resources/es6-module-loader.js diff --git a/scripts/component/system.src.js b/scripts/resources/system.src.js similarity index 100% rename from scripts/component/system.src.js rename to scripts/resources/system.src.js diff --git a/scripts/component/traceur-runtime.js b/scripts/resources/traceur-runtime.js similarity index 100% rename from scripts/component/traceur-runtime.js rename to scripts/resources/traceur-runtime.js diff --git a/scripts/component/zone-microtask.js b/scripts/resources/zone-microtask.js similarity index 100% rename from scripts/component/zone-microtask.js rename to scripts/resources/zone-microtask.js