Skip to content

Commit

Permalink
Delete tsd.js occurrence
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdy Dara committed Sep 7, 2015
1 parent 58e2b58 commit 8ee5384
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 70 deletions.
1 change: 0 additions & 1 deletion app/src/preprocessors.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ module.exports = function(GulpAngularGenerator) {
}

if(this.props.jsPreprocessor.key !== 'typescript') {
rejectWithRegexp.call(this, /tsd\.js/);
rejectWithRegexp.call(this, /tsd\.json/);
rejectWithRegexp.call(this, /tsconfig\.json/);
}
Expand Down
57 changes: 32 additions & 25 deletions app/templates/_tsd.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,6 @@
"path": "<%- props.paths.tmp %>/typings",
"bundle": "<%- props.paths.tmp %>/typings/tsd.d.ts",
"installed": {
"angularjs/angular.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"angularjs/angular-mocks.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"jasmine/jasmine.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"karma-jasmine/karma-jasmine.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"moment/moment.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"moment/moment-node.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},

<% if (angularModulesObject.animate) { -%>
"angularjs/angular-animate.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
Expand All @@ -36,16 +17,14 @@
"angularjs/angular-sanitize.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},

<% } if (props.jQuery.key === 'jquery2') { -%>
<% } if (props.jQuery.key === 'jquery2' || props.jQuery.key === 'jquery1') { -%>
"jquery/jquery.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
<% } if (props.jQuery.key === 'zepto') { -%>
"zepto/zepto.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},

<% } if (props.resource.key === 'angular-resource') { -%>
"angularjs/angular-resource.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
Expand All @@ -54,7 +33,6 @@
"restangular/restangular.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},

<% } if (props.router.key === 'ui-router') { -%>
"angular-ui-router/angular-ui-router.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
Expand All @@ -67,7 +45,18 @@
"angular2/router.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},

"angular2/angular2.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"rx/rx.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"rx/rx-lite.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"es6-promise/es6-promise.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
<% } if(props.ui.key === 'bootstrap' && props.bootstrapComponents === 'official') { -%>
"bootstrap/bootstrap.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
Expand All @@ -83,7 +72,25 @@
<% } if(props.bootstrapComponents.key === 'ui-bootstrap') { -%>
"angular-ui-bootstrap/angular-ui-bootstrap.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
}
},
<% } -%>
"angularjs/angular.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"angularjs/angular-mocks.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"jasmine/jasmine.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"karma-jasmine/karma-jasmine.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"moment/moment.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
},
"moment/moment-node.d.ts": {
"commit": "bb051830df88f5a55dcf06b7fe85bf6b62cc97f2"
}
}
}
4 changes: 0 additions & 4 deletions app/templates/gulp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ Gulp tasks which start a server for development or e2e tests.

Compile your styles with your CSS preprocessor. Use injection in the index.*

## tsd.js

Typescript specific tasks to generate Typescript descriptors.

## unit-tests.js

Task for launching the unit tests with Karma from Gulp.
Expand Down
6 changes: 3 additions & 3 deletions app/templates/gulp/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ gulp.task('other', function () {
.pipe(gulp.dest(path.join(conf.paths.dist, '/')));
});

gulp.task('clean', function (done) {
<% if (props.jsPreprocessor.key === 'typescript') { -%>
gulp.task('clean', ['tsd:purge'], function (done) {
$.del([path.join(conf.paths.dist, '/'), path.join(conf.paths.tmp, '/partials'), path.join(conf.paths.tmp, '/serve')], done);
<% } else { -%>
gulp.task('clean', function (done) {
<% } -%>
$.del([path.join(conf.paths.dist, '/'), path.join(conf.paths.tmp, '/')], done);
<% } -%>
});

<% if (imageMin) { -%>
Expand Down
8 changes: 0 additions & 8 deletions app/templates/gulp/_scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,15 @@ function webpackWrapper(watch, test, callback) {
.pipe(gulp.dest(path.join(conf.paths.tmp, '/serve/app')));
}

<% if (props.jsPreprocessor.key === 'typescript') { -%>
gulp.task('scripts', ['tsd:install'], function () {
<% } else { -%>
gulp.task('scripts', function () {
<% } -%>
return webpackWrapper(false, false);
});

gulp.task('scripts:watch', ['scripts'], function (callback) {
return webpackWrapper(true, false, callback);
});

<% if (props.jsPreprocessor.key === 'typescript') { -%>
gulp.task('scripts:test', ['tsd:install'], function () {
<% } else { -%>
gulp.task('scripts:test', function () {
<% } -%>
return webpackWrapper(false, true);
});

Expand Down
15 changes: 7 additions & 8 deletions test/node/test-preprocessors.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('gulp-angular generator preprocessors script', function () {
{ src: 'gulp/styles.js' },
{ src: 'gulp/scripts.js' },
{ src: 'gulp/markups.js' },
{ src: 'gulp/tsd.js' },
{ src: 'index.constants.js' },
{ src: 'tsd.json' }
];
Expand Down Expand Up @@ -88,7 +87,7 @@ describe('gulp-angular generator preprocessors script', function () {
htmlPreprocessor: { key: 'not none' }
};
generator.rejectFiles();
generator.files.length.should.be.equal(5);
generator.files.length.should.be.equal(4);
});
});

Expand All @@ -98,38 +97,38 @@ describe('gulp-angular generator preprocessors script', function () {
jsPreprocessor: { key: 'coffee' }
};
generator.lintCopies();
generator.files[6].src.should.match(/coffeelint/);
generator.files[5].src.should.match(/coffeelint/);
});

it('should add tslint for typescript preprocessor', function() {
generator.props = {
jsPreprocessor: { key: 'typescript' }
};
generator.lintCopies();
generator.files[6].src.should.match(/tslint/);
generator.files[5].src.should.match(/tslint/);
});
});

describe('add travis files', function() {
it('should not add file if there is no travis env', function() {
process.env.TRAVIS = 'false';
generator.travisCopies();
generator.files.length.should.be.equal(6);
generator.files.length.should.be.equal(5);
});

it('should not add file if travis but no typescript', function() {
process.env.TRAVIS = 'true';
generator.props = { jsPreprocessor: { key: 'not typescript' } };
generator.travisCopies();
generator.files.length.should.be.equal(6);
generator.files.length.should.be.equal(5);
});

it('should add file if travis and typescript', function() {
process.env.TRAVIS = 'true';
generator.props = { jsPreprocessor: { key: 'typescript' } };
generator.travisCopies();
generator.files.length.should.be.equal(7);
generator.files[6].src.should.match(/tsdrc/);
generator.files.length.should.be.equal(6);
generator.files[5].src.should.match(/tsdrc/);
});
});

Expand Down
11 changes: 0 additions & 11 deletions test/template/test-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,4 @@ describe('gulp-angular build template', function () {
result = build(model);
result.should.match(/\$\.imagemin/);
});

it('should add tsd:purge in clean dependencies for typescript', function() {
model.props.jsPreprocessor.key = 'noJsPrepro';
var result = build(model);
result.should.not.match(/tsd:purge/);

model.props.jsPreprocessor.key = 'typescript';
result = build(model);
result.should.match(/'clean', \['tsd:purge'\],/);
});

});
10 changes: 0 additions & 10 deletions test/template/test-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ describe('gulp-angular scripts template', function () {
model = mockModel();
});

it('should add tsd:install as dependencies for typescript', function() {
model.props.jsPreprocessor.key = 'not typescript';
var result = scripts(model);
result.should.match(/gulp\.task\('scripts', function/);

model.props.jsPreprocessor.key = 'typescript';
result = scripts(model);
result.should.match(/gulp\.task\('scripts', \['tsd:install'\]/);
});

it('should add the right js preprocessor process', function() {
model.props.jsPreprocessor.key = 'noJsPrepro';
var result = scripts(model);
Expand Down

0 comments on commit 8ee5384

Please sign in to comment.