diff --git a/gulpfile.js b/gulpfile.js index 2086dff30a..c3473cf6cc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ // Mostly stolen from https://github.com/pkozlowski-opensource/ng2-play ///// +var Builder = require('systemjs-builder'); var gulp = require('gulp'); var karma = require('karma').server; var path = require('path'); @@ -24,6 +25,19 @@ var argv = require('yargs').argv; gulp.task('default', ['js', 'html', 'sass', 'libs', 'playgroundJs', 'playgroundFiles']); +var NG2_PATH = 'jspm_packages/github/angular/angular@master'; +gulp.task('ng2-compile', shell.task([ + 'npm install', + 'gulp build/transpile.js.dev.es6' +], { + cwd: NG2_PATH +})); +gulp.task('ng2-copy', ['ng2-compile'], function() { + return gulp.src(NG2_PATH + '/dist/js/dev/es6/{angular2,rtts_assert}/**/*') + .pipe(gulpif(/es6$/, rename({ extname: '.js' }))) + .pipe(gulp.dest('dist/lib')); +}); + gulp.task('watch', ['default'], function() { var http = require('http'); var connect = require('connect'); @@ -82,10 +96,6 @@ gulp.task('playgroundJs', function() { .pipe(gulp.dest(buildConfig.dist)); }); -function traceurCompile() { - return lazypipe() - (); -} gulp.task('js', function () { return gulp.src(buildConfig.src.js) .pipe(rename(function(file) { @@ -149,3 +159,10 @@ gulp.task('examples', ['sass'], function() { }); require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig); + +gulp.task('watch-examples', ['examples'], function() { + return gulp.watch([ + 'src/**/*', + 'scripts/examples/index.template.html' + ], ['examples']); +}); diff --git a/jspm-config.js b/jspm-config.js index 57891725b9..cdf09ba23e 100644 --- a/jspm-config.js +++ b/jspm-config.js @@ -1,21 +1,36 @@ System.config({ - "paths": { - "*": "*.js", - "github:*": "/jspm_packages/github/*.js" + paths: { + '*': '*.js', + 'github:*': '/jspm_packages/github/*.js', + 'npm:*': '/jspm_packages/npm/*.js' }, - "traceurOptions": { - "annotations": true, - "types": true, - "memberVariables": true + traceurOptions: { + sourceMaps: true, + annotations: true, // parse annotations + types: true, // parse types + script: false, // parse as a module + memberVariables: true, // parse class fields + modules: 'instantiate' } }); System.config({ - "map": { - "angular/zone.js": "github:angular/zone.js@0.4.1", - "angular2": "github:angular/angular@master/dist/js/prod/es6/angular2", - "hammer": "github:hammerjs/hammer.js@2.0.4", - "ionic2": "/src" + map: { + 'angular2': '/dist/lib/angular2', + 'rtts_assert': '/dist/lib/rtts_assert', + 'angular/zone.js': 'github:angular/zone.js@0.4.1', + 'events': 'github:jspm/nodelibs-events@0.1.0', + 'hammer': 'github:hammerjs/hammer.js@2.0.4', + 'ionic2': '/src', + 'github:jspm/nodelibs-events@0.1.0': { + 'events-browserify': 'npm:events-browserify@0.0.1' + }, + 'github:jspm/nodelibs-process@0.1.1': { + 'process': 'npm:process@0.10.1' + }, + 'npm:events-browserify@0.0.1': { + 'process': 'github:jspm/nodelibs-process@0.1.1' + } } }); diff --git a/package.json b/package.json index 74c28af288..54b186a5f3 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,10 @@ "serve-static": "~1.8.1", "systemjs": "^0.11.3", "through2": "~0.6.3", - "yargs": "^3.6.0" + "yargs": "^3.6.0", + "systemjs-builder": "^0.9.1" }, "dependencies": { - "angular2": "2.0.0-alpha.13", "es6-module-loader": "~0.11.0", "event-stream": "^3.3.0", "gulp-template": "^3.0.0", @@ -50,7 +50,9 @@ }, "configFile": "jspm-config.js", "dependencies": { + "angular2": "github:angular/angular@master", "angular/zone.js": "github:angular/zone.js@0.4.1", + "events": "github:jspm/nodelibs-events@^0.1.0", "hammer": "github:hammerjs/hammer.js@^2.0.4" } } diff --git a/scripts/examples/index.template.html b/scripts/examples/index.template.html index 5337ec7079..023f637a45 100644 --- a/scripts/examples/index.template.html +++ b/scripts/examples/index.template.html @@ -4,14 +4,13 @@ - + - - + -
+ <%= contents %>