From d81b0d445b7da9b2547b4a765250b2d3ed9dda5b Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 21 Oct 2014 10:32:50 +0200 Subject: [PATCH 1/3] Adding raven requirement --- bower.json | 3 ++- gulpfile.coffee | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index d01e3285..10a70219 100644 --- a/bower.json +++ b/bower.json @@ -72,7 +72,8 @@ "favico.js": "0.3.4", "Sortable": "~0.1.8", "pikaday": "~1.2.0", - "malihu-custom-scrollbar-plugin": "~3.0.4" + "malihu-custom-scrollbar-plugin": "~3.0.4", + "raven-js": "~1.1.16" }, "resolutions": { "lodash": "~2.4.1", diff --git a/gulpfile.coffee b/gulpfile.coffee index 56127693..4a495b0c 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -85,6 +85,7 @@ paths.js = [ paths.app + "vendor/jquery-textcomplete/jquery.textcomplete.js", paths.app + "vendor/markitup/markitup/jquery.markitup.js", paths.app + "vendor/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js", + paths.app + "vendor/raven-js/dist/raven.js", paths.app + "js/jquery.ui.git-custom.js", paths.app + "js/jquery-ui.drag-multiple-custom.js", paths.app + "js/sha1-custom.js", From 7b267e0a7bccb6e20dd25128befff339fbde7e8d Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 21 Oct 2014 10:51:37 +0200 Subject: [PATCH 2/3] Adding raven logger --- app/coffee/modules/common/raven-logger.coffee | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 app/coffee/modules/common/raven-logger.coffee diff --git a/app/coffee/modules/common/raven-logger.coffee b/app/coffee/modules/common/raven-logger.coffee new file mode 100644 index 00000000..f0f9d415 --- /dev/null +++ b/app/coffee/modules/common/raven-logger.coffee @@ -0,0 +1,41 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# File: modules/common/raven-logger.coffee +### + + +taiga = @.taiga + +module = angular.module("taigaCommon") + +ExceptionHandlerFactory = ($log, @config) -> + ravenConfig = @config.get("ravenConfig", null) + if ravenConfig + $log.debug "Using the RavenJS exception handler." + Raven.config(ravenConfig).install() + return (exception, cause) -> + $log.error.apply($log, arguments) + Raven.captureException(exception) + + else + $log.debug "Using the default logging exception handler." + return (exception, cause) -> + $log.error.apply($log, arguments) + +module.factory("$exceptionHandler", ["$log", "$tgConfig", ExceptionHandlerFactory]) From 7a00157aa71e09c3559c991f846567a5477c777e Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 21 Oct 2014 11:56:34 +0200 Subject: [PATCH 3/3] generate js sourcemaps in the app-deploy --- gulpfile.coffee | 11 ++++++++--- package.json | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gulpfile.coffee b/gulpfile.coffee index 4a495b0c..74d86bda 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -1,6 +1,6 @@ gulp = require("gulp") jade = require("gulp-jade") - +gutil = require("gulp-util") coffee = require("gulp-coffee") concat = require("gulp-concat") uglify = require("gulp-uglify") @@ -19,6 +19,7 @@ scsslint = require("gulp-scss-lint") newer = require("gulp-newer") cache = require("gulp-cached") jadeInheritance = require('gulp-jade-inheritance') +sourcemaps = require('gulp-sourcemaps') paths = {} paths.app = "app/" @@ -201,8 +202,10 @@ gulp.task "jslibs-watch", -> gulp.task "jslibs-deploy", -> gulp.src(paths.js) .pipe(plumber()) + .pipe(sourcemaps.init()) .pipe(concat("libs.js")) .pipe(uglify({mangle:false, preserveComments: false})) + .pipe(sourcemaps.write('./')) .pipe(gulp.dest("dist/js/")) gulp.task "app-watch", ["coffee", "conf", "locales"], -> @@ -224,8 +227,10 @@ gulp.task "app-deploy", ["coffee", "conf", "locales"], -> ] gulp.src(_paths) - .pipe(concat("app.js")) - .pipe(uglify({mangle:false, preserveComments: false})) + .pipe(sourcemaps.init()) + .pipe(concat("app.js")) + .pipe(uglify({mangle:false, preserveComments: false})) + .pipe(sourcemaps.write('./')) .pipe(gulp.dest(paths.dist + "js/")) ############################################################################## diff --git a/package.json b/package.json index 47a2c2ee..5deac6ac 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "gulp-rename": "^1.2.0", "gulp-ruby-sass": "^0.4.3", "gulp-scss-lint": "0.1.1", + "gulp-sourcemaps": "^1.2.4", "gulp-styledocco": "0.0.1", "gulp-template": "^0.1.1", "gulp-uglify": "~0.2.0",