diff --git a/.gitignore b/.gitignore index 9d13842..3dd0c90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,11 @@ index.d.ts index.js +index.metadata.json +index.ngfactory.ts src/**/*.d.ts src/**/*.js +src/**/*.metadata.json +src/**/*.ngfactory.ts /node_modules diff --git a/gulpfile.js b/gulpfile.js index 05fa927..9bcbd92 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,10 +1,9 @@ "use strict"; var del = require('del'); +var exec = require('child_process').exec; var gulp = require('gulp'); -var merge = require('merge2'); var tslint = require('gulp-tslint'); -var typescript = require('gulp-typescript'); // Build. @@ -15,7 +14,8 @@ gulp.task('watch', function() { gulp.watch([ './index.ts', './src/*.ts', - '!*/**/*.d.ts' + '!*/**/*.d.ts', + '!*/**/*.ngfactory.ts', ], [ 'build' ]); @@ -27,18 +27,22 @@ gulp.task('clean:js', function() { return del([ './index.d.ts', - './index.js', './index.js.map', + './index.js', + './index.metadata.json', + './index.ngfactory.ts', './src/**/*.d.ts', + './src/**/*.js.map', './src/**/*.js', - './src/**/*.js.map' + './src/**/*.metadata.json', + './src/**/*.ngfactory.ts', ]); }); gulp.task('lint:ts', function() { return gulp.src([ - './index.ts', - './src/*.ts', + './index.ts', + './src/*.ts', '!*/**/*.d.ts' ]) .pipe(tslint({ @@ -47,35 +51,10 @@ gulp.task('lint:ts', function() { .pipe(tslint.report()) }); -gulp.task('transpile:ts', ['clean:js', 'lint:ts'], function () { - - var compilerOptions = { - emitDecoratorMetadata: true, - experimentalDecorators: true, - declaration: true, - module: 'commonjs', - moduleResolution: 'node', - noImplicitAny: false, - removeComments: false, - sourceMap: false, - target: 'es5' - }; - - var tsResult = gulp.src([ - './index.ts', - './src/*.ts', - './node_modules/@types/core-js/index.d.ts', - './node_modules/@types/jasmine/index.d.ts', - './node_modules/@types/node/index.d.ts' - ], { - base: './' - }) - .pipe(typescript(compilerOptions)); - - return merge([ - tsResult.js - .pipe(gulp.dest('.')), - tsResult.dts - .pipe(gulp.dest('.')) - ]); +gulp.task('transpile:ts', ['clean:js', 'lint:ts'], function (cb) { + exec('./node_modules/.bin/ngc', function (err, stdout, stderr) { + console.log(stdout); + console.log(stderr); + cb(err); + }); }); diff --git a/package.json b/package.json index 797ce19..68d7a41 100644 --- a/package.json +++ b/package.json @@ -25,28 +25,28 @@ }, "homepage": "https://github.com/basvandenberg/angular2-select#readme", "devDependencies": { - "@angular/common": "~2.0.0", - "@angular/compiler": "~2.0.0", - "@angular/core": "~2.0.0", - "@angular/forms": "~2.0.0", - "@angular/platform-browser": "~2.0.0", - "@angular/platform-browser-dynamic": "~2.0.0", - "@types/core-js": "~0.9.32", - "@types/jasmine": "~2.2.33", - "@types/node": "~6.0.38", + "@angular/common": "~2.0.1", + "@angular/compiler": "~2.0.1", + "@angular/compiler-cli": "^0.6.3", + "@angular/core": "~2.0.1", + "@angular/forms": "~2.0.1", + "@angular/platform-browser": "~2.0.1", + "@angular/platform-browser-dynamic": "~2.0.1", + "@angular/platform-server": "~2.0.1", + "@types/core-js": "~0.9.34", + "@types/jasmine": "~2.2.34", + "@types/node": "~6.0.41", "core-js": "~2.4.1", "del": "~2.2.2", "gulp": "~3.9.1", "gulp-sourcemaps": "~1.6.0", "gulp-tslint": "~6.1.1", - "gulp-typescript": "~3.0.1", - "merge2": "~1.0.2", "reflect-metadata": "~0.1.8", "rxjs": "~5.0.0-beta.12", "systemjs": "~0.19.38", "systemjs-builder": "~0.15.31", "tslint": "~3.15.1", - "typescript": "~2.0.3", + "typescript": "^2.0.3", "zone.js": "~0.6.23" }, "dependencies": {}, diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..12de67b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "declaration": true, + "module": "commonjs", + "moduleResolution": "node", + "noImplicitAny": false, + "removeComments": false, + "sourceMap": false, + "target": "es5" + }, + "include": [ + "index.ts", + "src/*.ts", + "node_modules/@types/**/*.d.ts" + ], + "exclude": [ + "typings/browser", + "typings/browser.d.ts", + "**/*.ngfactory.ts" + ], + "compileOnSave": true, + "buildOnSave": false, + "atom": { + "rewriteTsconfig": false + } +}