diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000000..b98d08a1c6 --- /dev/null +++ b/.babelrc @@ -0,0 +1,8 @@ +{ + "presets": [ + "latest" + ], + "plugins": [ + "angularjs-annotate" + ] +} \ No newline at end of file diff --git a/.bowerrc b/.bowerrc index d8b5b4b909..5773025bf9 100644 --- a/.bowerrc +++ b/.bowerrc @@ -1,6 +1,3 @@ { - "directory": "app/bower_components", - "ignoredDependencies": [ - "jquery" - ] + "directory": "app/bower_components" } diff --git a/app/index.html b/app/index.html index f89dec16dd..f213e16286 100644 --- a/app/index.html +++ b/app/index.html @@ -74,6 +74,8 @@ TODO configure more restrictive Content-Security-Policy + + @@ -91,6 +93,8 @@ TODO configure more restrictive Content-Security-Policy + + diff --git a/app/scripts/_app.js b/app/scripts/_app.js index 95dd0157f4..1e334304ec 100644 --- a/app/scripts/_app.js +++ b/app/scripts/_app.js @@ -43,6 +43,7 @@ .run(initGlobalShortcuts) .run(showWelcomeDialog); + /* @ngInject */ function configMarked(markedProvider) { markedProvider.setRenderer({ link: function (href, title, text) { @@ -51,6 +52,7 @@ }); } + /* @ngInject */ function configMdTheme($mdThemingProvider, THEMES) { $mdThemingProvider.theme('default') .primaryPalette('blue'); @@ -78,11 +80,13 @@ $mdThemingProvider.alwaysWatchTheme(true); } + /* @ngInject */ function initGlobalModels(InitGlobalModels, $localStorage, LS_DEFAULTS) { $localStorage.$default(LS_DEFAULTS); InitGlobalModels(); } + /* @ngInject */ function initGlobalShortcuts($document, Dialogs, $localStorage, IS_ELECTRON) { // we just use this single one as this usually does mess // up with the default browser shortcuts @@ -117,6 +121,7 @@ } } + /* @ngInject */ function initPollForSimpleTimeTracking($localStorage, IS_ELECTRON, $interval, SIMPLE_TIME_TRACKING_INTERVAL, Tasks) { // if NOT in electron context if (!IS_ELECTRON) { @@ -134,6 +139,7 @@ } } + /* @ngInject */ function initPollJiraTaskUpdates($localStorage, Jira, IS_ELECTRON, $interval, JIRA_UPDATE_POLL_INTERVAL) { // handle updates that need to be made locally if (IS_ELECTRON) { @@ -148,12 +154,14 @@ } } + /* @ngInject */ function showWelcomeDialog($localStorage, Dialogs) { if ($localStorage.isShowWelcomeDialog) { Dialogs('WELCOME', undefined, true); } } + /* @ngInject */ function initMousewheelZoomForElectron($document, $window, IS_ELECTRON) { if (IS_ELECTRON) { const { webFrame } = require('electron'); diff --git a/karma.conf.js b/karma.conf.js index e1230db0eb..af66afe8c1 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -14,6 +14,8 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ // bower:js + 'app/bower_components/json3/lib/json3.js', + 'app/bower_components/es5-shim/es5-shim.js', 'app/bower_components/angular/angular.js', 'app/bower_components/angular-animate/angular-animate.js', 'app/bower_components/angular-aria/angular-aria.js', @@ -31,9 +33,10 @@ module.exports = function(config) { 'app/bower_components/moment-duration-format/lib/moment-duration-format.js', 'app/bower_components/marked/lib/marked.js', 'app/bower_components/angular-marked/dist/angular-marked.js', + 'app/bower_components/jquery/dist/jquery.js', + 'app/bower_components/bootstrap/dist/js/bootstrap.js', 'app/bower_components/angular-bootstrap-calendar/dist/js/angular-bootstrap-calendar-tpls.js', 'app/bower_components/hamsterjs/hamster.js', - 'app/bower_components/angular-mocks/angular-mocks.js', // endbower // modules first diff --git a/package.json b/package.json index 1598d04127..5234fb110e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,9 @@ } }, "devDependencies": { + "babel-cli": "^6.22.2", + "babel-plugin-angularjs-annotate": "^0.7.0", + "babel-preset-latest": "^6.22.0", "browser-sync": "latest", "del": "latest", "ecstatic": "latest", @@ -39,6 +42,7 @@ "electron-prebuilt": "^1.4.13", "gulp": "latest", "gulp-autoprefixer": "latest", + "gulp-babel": "^6.1.2", "gulp-clean-css": "latest", "gulp-if": "latest", "gulp-imagemin": "latest", @@ -70,8 +74,8 @@ "lazypipe": "latest", "merge-stream": "latest", "node-sass": "latest", - "protractor": "latest", "phantomjs-prebuilt": "latest", + "protractor": "latest", "require-dir": "latest", "run-sequence": "latest", "wiredep": "latest", diff --git a/tasks/build.js b/tasks/build.js index f7569be005..3f703c669c 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -14,7 +14,6 @@ var minifyHtml = require('gulp-minify-html'); var cleanCSS = require('gulp-clean-css'); var useref = require('gulp-useref'); var sourcemaps = require('gulp-sourcemaps'); -var ngAnnotate = require('gulp-ng-annotate'); var uglify = require('gulp-uglify'); var imagemin = require('gulp-imagemin'); var runSequence = require('run-sequence') @@ -23,6 +22,7 @@ var wiredep = require('wiredep').stream; var merge = require('merge-stream'); var lazypipe = require('lazypipe'); +var babel = require('gulp-babel'); // main task gulp.task('build', function (callback) { @@ -33,14 +33,14 @@ gulp.task('build', function (callback) { 'injectAll', 'buildStyles', - //'cleanDist', - // 'wiredepBuild', + 'cleanDist', + 'wiredepBuild', // 'injectAll', // 'testSingle', - // 'lint', + 'lint', // 'sass', - // 'minFiles', - // 'copy', + 'minFiles', + 'copy', // reset config //'ngConfig', @@ -90,7 +90,7 @@ gulp.task('minFiles', function () { return gulp.src(config.mainFile) .pipe(useref({}, lazypipe() .pipe(sourcemaps.init, { loadMaps: true }))) - .pipe(gulpif('*.js', ngAnnotate())) + .pipe(gulpif('*.js', babel())) .pipe(gulpif('*.js', uglify({ preserveComments: 'license' }))) .pipe(gulpif('*.css', cleanCSS())) .pipe(gulp.dest(config.dist));