mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-30 11:10:04 +00:00
integrate babel and fix build
This commit is contained in:
parent
8a08bf9aa2
commit
db9dd108e4
7 changed files with 37 additions and 13 deletions
8
.babelrc
Normal file
8
.babelrc
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"presets": [
|
||||
"latest"
|
||||
],
|
||||
"plugins": [
|
||||
"angularjs-annotate"
|
||||
]
|
||||
}
|
||||
5
.bowerrc
5
.bowerrc
|
|
@ -1,6 +1,3 @@
|
|||
{
|
||||
"directory": "app/bower_components",
|
||||
"ignoredDependencies": [
|
||||
"jquery"
|
||||
]
|
||||
"directory": "app/bower_components"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ TODO configure more restrictive Content-Security-Policy
|
|||
|
||||
<!-- build:js({.tmp,app}) scripts/vendor.js defer -->
|
||||
<!-- bower:js -->
|
||||
<script src="bower_components/json3/lib/json3.js"></script>
|
||||
<script src="bower_components/es5-shim/es5-shim.js"></script>
|
||||
<script src="bower_components/angular/angular.js"></script>
|
||||
<script src="bower_components/angular-animate/angular-animate.js"></script>
|
||||
<script src="bower_components/angular-aria/angular-aria.js"></script>
|
||||
|
|
@ -91,6 +93,8 @@ TODO configure more restrictive Content-Security-Policy
|
|||
<script src="bower_components/moment-duration-format/lib/moment-duration-format.js"></script>
|
||||
<script src="bower_components/marked/lib/marked.js"></script>
|
||||
<script src="bower_components/angular-marked/dist/angular-marked.js"></script>
|
||||
<script src="bower_components/jquery/dist/jquery.js"></script>
|
||||
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
|
||||
<script src="bower_components/angular-bootstrap-calendar/dist/js/angular-bootstrap-calendar-tpls.js"></script>
|
||||
<script src="bower_components/hamsterjs/hamster.js"></script>
|
||||
<!-- endbower -->
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue