Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/273504
Change subject: Update npm configuations to be able to run npm install ...................................................................... Update npm configuations to be able to run npm install This allows us to run grunt from inside www/ instead of having to move it to parent directory. Change-Id: Iaf286b1dc4af2948896d2dbd37697f06b440850d --- M .gitignore M .jshintignore R package.json M www/Gruntfile.js 4 files changed, 21 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/04/273504/1 diff --git a/.gitignore b/.gitignore index aaba1ad..a9e97c1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ scripts/backup.ab # Node modules for the js -www/node_modules +node_modules/** www/bundle*.js www/abusefilter.js www/preview.js diff --git a/.jshintignore b/.jshintignore index e655b25..3fb511f 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,2 +1,3 @@ www/lib/* app/src/main/assets/* +node_modules/** diff --git a/www/package.json b/package.json similarity index 89% rename from www/package.json rename to package.json index adbca5f..adf7532 100644 --- a/www/package.json +++ b/package.json @@ -3,11 +3,14 @@ "description": "JS files required for the Wikipedia Android app", "repository": "https://gerrit.wikimedia.org/r/apps/android/wikipedia", "version": "0.1.0", + "scripts": { + "test": "cd www/ && grunt test" + }, "devDependencies": { "browserify": "~12.0.1", "grunt": "~0.4.2", - "grunt-browserify": "~4.0.1", "grunt-cli": "~0.1.13", + "grunt-browserify": "~4.0.1", "grunt-contrib-copy": "~0.8.2", "grunt-contrib-jshint": "~0.11.3", "grunt-contrib-less": "~1.1.0", diff --git a/www/Gruntfile.js b/www/Gruntfile.js index b614c64..edc5af3 100644 --- a/www/Gruntfile.js +++ b/www/Gruntfile.js @@ -1,3 +1,4 @@ +/*jshint node:true */ module.exports = function ( grunt ) { var allScriptFiles = [ "js/bridge.js", @@ -22,7 +23,8 @@ "tests/index.html" ]; var distFolder = "../app/src/main/assets/"; - + + grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-browserify' ); grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-copy' ); @@ -30,6 +32,15 @@ grunt.initConfig( { pkg: grunt.file.readJSON( "package.json" ), + jshint: { + options: { + jshintrc: true + }, + all: [ + '.', + '!node_modules/**' + ] + }, browserify: { dist: { files: { @@ -68,12 +79,6 @@ } } }, - jshint: { - allFiles: allScriptFiles, - options: { - jshintrc: ".jshintrc" - } - }, copy: { main: { files: [ @@ -95,6 +100,7 @@ } } } ); - - grunt.registerTask( 'default', [ 'browserify', 'copy' ] ); + + grunt.registerTask( 'test', [ 'jshint', 'browserify', 'copy' ] ); + grunt.registerTask( 'default', 'test' ); }; -- To view, visit https://gerrit.wikimedia.org/r/273504 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf286b1dc4af2948896d2dbd37697f06b440850d Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits