Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ example/bower_components
node_modules
reports
tmp
typings
.idea
38 changes: 18 additions & 20 deletions dist/ngHttpProgress.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
/// <reference path="../typings/tsd.d.ts" />
/// <reference path="../typings/lodash/lodash.d.ts" />
/// <reference path="../typings/angularjs/angular.d.ts" />
declare module NgHttpProgress {
class NgHttpProgressInterceptor {
private $q;
private $injector;
private ngHttpProgressService;
/**
* Construct the service with dependencies injected
* @param _$q
* @param _$injector
*/
static $inject: string[];
constructor($q: ng.IQService, $injector: ng.auto.IInjectorService);
private getNgHttpProgressService;
request: (config: any) => any;
response: (response: any) => any;
responseError: (response: any) => any;
}
}
declare module NgHttpProgress {
interface ngProgress {
start(): void;
Expand Down Expand Up @@ -29,24 +45,6 @@ declare module NgHttpProgress {
height?: string;
}
}
declare module NgHttpProgress {
class NgHttpProgressInterceptor {
private $q;
private $injector;
private ngHttpProgressService;
/**
* Construct the service with dependencies injected
* @param _$q
* @param _$injector
*/
static $inject: string[];
constructor($q: ng.IQService, $injector: ng.auto.IInjectorService);
private getNgHttpProgressService;
request: (config: any) => any;
response: (response: any) => any;
responseError: (response: any) => any;
}
}
declare module NgHttpProgress {
class NgHttpProgressService implements INgHttpProgressService {
private config;
Expand Down
12 changes: 2 additions & 10 deletions dist/ngHttpProgress.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ngHttpProgress.js.map

Large diffs are not rendered by default.

103 changes: 55 additions & 48 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ var gulpCore = require('gulp'),
'main-bower-files',
'minimatch',
'run-sequence',
'json5'
'json5',
'merge2'
],
rename: {}
}),
Expand All @@ -26,14 +27,14 @@ var gulpCore = require('gulp'),
;


var tsDefinitions = ['./typings/**/*.d.ts'];
var tsDefinitions = './typings/**/*.d.ts';
var sources = {
tsd: './typings/**/*.d.ts',
app: {
ts: _.union(tsDefinitions, ['./src/**/*.ts'])
ts: [tsDefinitions, './src/**/*.ts']
},
test: {
ts: _.union(tsDefinitions, ['./test/**/*.ts']),
dependency: ['./bower_components/']
ts: [tsDefinitions, './test/**/*.ts']
}
};

Expand All @@ -43,67 +44,73 @@ var destinations = {
coverage: 'reports/**/lcov.info'
};

gulp.task('test', 'runs test sequence for frontend', function (cb){
gulp.task('test', 'runs test sequence for frontend', function (cb) {
return plugins.runSequence('clean', 'js:app', 'js:test', 'test:karma', cb);
});

gulp.task('js:test', function(){
gulp.task('js:test', function () {

return gulp.src(sources.test.ts)
.pipe(plugins.tsc({
sourceMap:true,
keepTree: false,
target: "ES5"
}))
.pipe(gulp.dest(destinations.testTmp))
;
var tsResult = gulp.src(sources.test.ts)
.pipe(plugins.typescript({
target: "ES5",
typescript: require('typescript')
}));

return tsResult.js.pipe(gulp.dest(destinations.testTmp))

});

gulp.task('test:karma', function(){
gulp.task('test:karma', function () {

var vendorFiles = plugins.mainBowerFiles({
includeDev: true,
paths: {
bowerDirectory: 'bower_components',
bowerJson: 'bower.json'
}
});
var vendorFiles = plugins.mainBowerFiles({
includeDev: true,
paths: {
bowerDirectory: 'bower_components',
bowerJson: 'bower.json'
}
});

vendorFiles = vendorFiles.map(function(path){
vendorFiles = vendorFiles.map(function (path) {
return path.replace(/\\/g, "\/").replace(/^.+bower_components\//i, './bower_components/');
});

var testFiles = [].concat(
vendorFiles, destinations.testTmp+'**/*.js', destinations.app+'**/*.js'
vendorFiles, destinations.testTmp + '**/*.js', destinations.app + '**/*.js'
);

gulp.src(testFiles)
.pipe(plugins.karma({
configFile: 'karma.conf.js',
action: 'run'
}))
.on('error', function(err) {
// Make sure failed tests cause gulp to exit non-zero
throw err;
});
.pipe(plugins.karma({
configFile: 'karma.conf.js',
action: 'run'
}))
.on('error', function (err) {
// Make sure failed tests cause gulp to exit non-zero
throw err;
});

});

gulp.task('js:app', function () {


return gulp.src(sources.app.ts)
.pipe(plugins.tsc({
sourceMap: true,
sourceRoot: __dirname+'/src/',
declaration: true,
keepTree: false,
var tsResult = gulp.src(sources.app.ts)
.pipe(plugins.sourcemaps.init())
.pipe(plugins.typescript({
target: "ES5",
noExternalResolve: true,
typescript: require('typescript'),
out: path.basename(bowerJson.main),
target: "ES5"
}))
.pipe(gulp.dest(destinations.app))
;
declarationFiles: true
}, undefined, plugins.typescript.reporter.longReporter()));

return plugins.merge2([
tsResult.dts
.pipe(plugins.replace('<reference path="typings', '<reference path="../typings'))
.pipe(gulp.dest(destinations.app)),

tsResult.js
.pipe(plugins.sourcemaps.write('./', {includeContent: false, sourceRoot: '../src/'}))
.pipe(gulp.dest(destinations.app))
]);

});

Expand Down Expand Up @@ -147,8 +154,8 @@ gulp.task('bump', function (cb) {
{
type: 'confirm',
name: 'confirm',
message: function(answers){
return 'Are you sure you want to bump the '+answers.bumpType+' version?'
message: function (answers) {
return 'Are you sure you want to bump the ' + answers.bumpType + ' version?'
}
}

Expand All @@ -161,7 +168,7 @@ gulp.task('bump', function (cb) {
return gulp.src(['./package.json', './bower.json'])
.pipe(plugins.bump({type: answers.bumpType}))
.pipe(gulp.dest('./'))
.pipe(plugins.git.commit('chore(semver): bump '+answers.bumpType+' version'))
.pipe(plugins.git.commit('chore(semver): bump ' + answers.bumpType + ' version'))
.pipe(plugins.filter('package.json')) // read package.json for the new version
.pipe(plugins.tagVersion()) // create tag
;
Expand All @@ -177,7 +184,7 @@ gulp.task('watch', function () {
// default
gulp.task('default', ['build', 'watch']);

gulp.task('coveralls', 'submits code coverage to coveralls', [], function(){
gulp.task('coveralls', 'submits code coverage to coveralls', [], function () {
gulp.src(destinations.coverage)
.pipe(plugins.coveralls());
});
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/ngHttpProgress.js",
"scripts": {
"test": "gulp test",
"postinstall": "./node_modules/.bin/tsd reinstall --config tsd.json"
"postinstall": "./node_modules/.bin/tsd reinstall --config tsd.json && ./node_modules/.bin/bower install"
},
"dependencies": {},
"devDependencies": {
Expand All @@ -14,7 +14,6 @@
"event-stream": "^3.3.1",
"globby": "^2.1.0",
"gulp": "^3.9.0",
"gulp-add-src": "^0.2.0",
"gulp-bump": "^0.3.1",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.5.2",
Expand All @@ -26,19 +25,19 @@
"gulp-karma": "0.0.4",
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-mocha": "^2.1.1",
"gulp-replace": "^0.5.3",
"gulp-sourcemaps": "^1.5.2",
"gulp-tag-version": "^1.2.1",
"gulp-tap": "^0.1.3",
"gulp-tsc": "^0.10.1",
"gulp-typescript": "^2.7.6",
"gulp-util": "^3.0.5",
"inquirer": "^0.8.5",
"jasmine-core": "^2.3.4",
"istanbul": "bryanforbes/istanbul#source-map-resolve",
"karma": "^0.12.31",
"karma-chai": "^0.1.0",
"karma-chai-as-promised": "^0.1.2",
"karma-chai-plugins": "^0.6.0",
"karma-chrome-launcher": "^0.2.0",
"istanbul": "bryanforbes/istanbul#source-map-resolve",
"karma-coverage": "gotwarlost/karma-coverage.git#source-lookup",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.0.2",
Expand All @@ -47,6 +46,7 @@
"karma-sinon-chai": "^1.0.0",
"lodash": "^3.9.3",
"main-bower-files": "^2.8.2",
"merge2": "^0.3.6",
"minimatch": "^2.0.8",
"mocha": "^2.2.5",
"requirejs": "^2.1.18",
Expand Down
1 change: 0 additions & 1 deletion src/ngHttpProgressInterceptor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference path="../typings/tsd.d.ts" />
/// <reference path="./ngHttpProgressInterfaces.ts" />

module NgHttpProgress {

Expand Down
3 changes: 0 additions & 3 deletions src/ngHttpProgressService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// <reference path="../typings/lodash/lodash.d.ts" />
/// <reference path="../typings/angularjs/angular.d.ts" />
/// <reference path="./ngHttpProgressInterfaces.ts" />

module NgHttpProgress {

Expand Down
6 changes: 0 additions & 6 deletions src/ngHttpProgressServiceProvider.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/// <reference path="../typings/lodash/lodash.d.ts" />
/// <reference path="../typings/angularjs/angular.d.ts" />
/// <reference path="./ngHttpProgressInterfaces.ts" />
/// <reference path="./ngHttpProgressService.ts" />
/// <reference path="./ngHttpProgressInterceptor.ts" />

module NgHttpProgress {

export declare class Error {
Expand Down
Loading