diff --git a/.travis.yml b/.travis.yml index cdf24b3f3..b51264c99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,12 @@ before_install: before_script: - cd apps/deck + - make install-npm-deps-dev script: + - node --version + - npm --version + - make build-js - make test after_failure: diff --git a/js/Gruntfile.js b/js/Gruntfile.js index 9f2a5964b..f1efba72a 100644 --- a/js/Gruntfile.js +++ b/js/Gruntfile.js @@ -22,13 +22,12 @@ module.exports = function(grunt) { - 'use strict'; + 'use strict'; grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-wrap'); - grunt.loadNpmTasks('grunt-ng-annotate'); grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-phpunit'); @@ -115,18 +114,10 @@ module.exports = function(grunt) { reporters: ['progress'] } }, - - ngAnnotate: { - app: { - src: ['<%= meta.productionJS %>app.js'], - dest: '<%= meta.productionJS %>app.js' - } - } - }); // make tasks available under simpler commands - grunt.registerTask('build', ['jshint', 'concat', 'wrap', 'ngAnnotate']); + grunt.registerTask('build', ['jshint', 'concat', 'wrap']); grunt.registerTask('js-unit', ['karma:continuous']); }; diff --git a/js/gulpfile.js b/js/gulpfile.js deleted file mode 100644 index 9ce7a9911..000000000 --- a/js/gulpfile.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - * @copyright Copyright (c) 2016 Julius Härtl - * - * @author Julius Härtl - * - * @license GNU AGPL version 3 or any later version - * - * 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 . - * - */ - -/*jslint node: true */ -'use strict'; - -const gulp = require('gulp'), - ngAnnotate = require('gulp-ng-annotate'), - uglify = require('gulp-uglify'), - jshint = require('gulp-jshint'), - KarmaServer = require('karma').Server, - phpunit = require('gulp-phpunit'), - concat = require('gulp-concat'), - sourcemaps = require('gulp-sourcemaps'); - -// Configuration -const buildTarget = 'app.min.js'; -const phpunitConfig = __dirname + '/../phpunit.xml'; -const karmaConfig = __dirname + '/karma.conf.js'; -const destinationFolder = __dirname + '/build/'; -const sources = [ - 'app/App.js', 'app/Config.js', 'app/Run.js', - 'controller/**/*.js', - 'filter/**/*.js', - 'service/**/*.js', - 'gui/**/*.js', - 'plugin/**/*.js', - 'utility/**/*.js', - 'directive/**/*.js' -]; -const testSources = ['tests/**/*.js']; -const phpSources = ['../**/*.php', '!../js/**', '!../vendor/**']; -const watchSources = sources.concat(testSources).concat(['*.js']); -const lintSources = watchSources; - -// tasks -gulp.task('default', ['lint'], () => { - return gulp.src(sources) - .pipe(ngAnnotate()) - .pipe(sourcemaps.init()) - .pipe(concat(buildTarget)) - .pipe(uglify()) - .pipe(sourcemaps.write()) - .pipe(gulp.dest(destinationFolder)); -}); - -gulp.task('lint', () => { - return gulp.src(lintSources) - .pipe(jshint()) - .pipe(jshint.reporter('default')) - .pipe(jshint.reporter('fail')); -}); - -gulp.task('watch', () => { - gulp.watch(watchSources, ['default']); -}); - -gulp.task('karma', (done) => { - new KarmaServer({ - configFile: karmaConfig, - singleRun: true - }, done).start(); -}); - -gulp.task('watch-karma', (done) => { - new KarmaServer({ - configFile: karmaConfig, - autoWatch: true - }, done).start(); -}); - -gulp.task('phpunit', () => { - return gulp.src(phpSources) - .pipe(phpunit('phpunit', { - configurationFile: phpunitConfig - })); -}); - -gulp.task('watch-phpunit', () => { - gulp.watch(phpSources, ['phpunit']); -}); diff --git a/js/package.json b/js/package.json index 2e0344d8f..1bd2af10c 100644 --- a/js/package.json +++ b/js/package.json @@ -1,36 +1,28 @@ { "name": "deck", - "description": "Deck owncloud app", - "version": "0.1.0", - "private": true, - "homepage": "https://github.com/juliushaertl/deck", - "repository": { - "type": "git", - "url": "git@github.com:juliushaertl/deck.git" - }, - "dependencies": { - "karma": "^1.1.1", - "bower": "*", - "grunt": "*" + "version": "1.0.0", + "main": "Gruntfile.js", + "directories": { + "test": "tests" }, + "dependencies": {}, "devDependencies": { - "grunt-cli": "*", - "grunt-contrib-concat": "*", - "grunt-contrib-jshint": "*", - "grunt-contrib-watch": "*", - "grunt-karma": "*", - "grunt-ng-annotate": "^1.0.1", - "grunt-phpunit": "*", - "grunt-wrap": "*", - "jasmine-core": "*", - "jshint-stylish": "^2.1.0", - "karma": "*", - "karma-chrome-launcher": "*", - "karma-coverage": "*", - "karma-firefox-launcher": "*", - "karma-jasmine": "*", - "karma-phantomjs-launcher": "*", - "phantomjs": "*" + "bower": "^1.8.0", + "grunt": "^1.0.1", + "grunt-contrib-concat": "^1.0.1", + "grunt-contrib-jshint": "^1.1.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-karma": "^2.0.0", + "grunt-phpunit": "^0.3.6", + "grunt-wrap": "^0.3.0", + "jshint-stylish": "^2.2.1", + "karma": "^1.4.1" }, - "engine": "node >= 0.8" + "scripts": { + "test": "echo \"Warning: no test specified\" && exit 0" + }, + "author": "", + "license": "AGPL-3.0", + "keywords": [], + "description": "" }