Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Added ngc support
Browse files Browse the repository at this point in the history
  • Loading branch information
Fank committed Sep 29, 2016
1 parent d1f63f6 commit 68b5c40
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 50 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
55 changes: 17 additions & 38 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -15,7 +14,8 @@ gulp.task('watch', function() {
gulp.watch([
'./index.ts',
'./src/*.ts',
'!*/**/*.d.ts'
'!*/**/*.d.ts',
'!*/**/*.ngfactory.ts',
], [
'build'
]);
Expand All @@ -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({
Expand All @@ -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);
});
});
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
28 changes: 28 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 68b5c40

Please sign in to comment.