mediawiki-extensions-Popups/Gruntfile.js
Sam Smith e47fe4d04d Use Redux and Redux Thunk
Changes:
* Create the ext.popups.lib module, which contains redux@3.6.0 and
  redux-thunk@2.1.0.
* Rely on the Resource Loader's minification and mangling (?)
  mechanisms.
* Create an asynchronous bootstrap script, which creates a Redux store
  when the User Agent is idle.

Change-Id: Ib7168217a5673bb2a8378eb30d6aa45043c66e62
2016-11-08 15:33:20 -05:00

110 lines
2.3 KiB
JavaScript

// jscs:disable jsDoc
/*jshint node:true */
module.exports = function ( grunt ) {
var QUNIT_URL_BASE = 'http://localhost:8080/wiki/Special:JavaScriptTest/qunit/plain?module=';
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
banana: {
all: 'i18n/'
},
jscs: {
options: {
config: '.jscsrc'
},
main: '<%= jshint.all %>',
test: {
options: {
config: 'tests/.jscsrc.js'
},
files: {
src: [
'tests/qunit/**/*.js',
'!tests/qunit/ext.popups.core.test.js'
]
}
}
},
jshint: {
options: {
jshintrc: true
},
all: [
'*.js',
'**/*.js',
'!node_modules/**',
'!resources/ext.popups.lib/**',
// FIXME: Remove ignores for legacy code upon removal/refactor
'!resources/ext.popups.core/**',
'!resources/ext.popups.desktop/**',
'!resources/ext.popups.images/**',
'!resources/ext.popups.renderer.desktopRenderer/**',
'!resources/ext.popups.schemaPopups/**',
'!resources/ext.popups.schemaPopups.utils/**',
'!resources/ext.popups.targets.desktopTarget/**',
// End legacy code
'!tests/qunit/**'
],
test: {
files: {
src: 'tests/qunit/**/*.js'
}
}
},
jsonlint: {
all: [
'*.json',
'**/*.json',
'!node_modules/**'
]
},
qunit: {
all: {
options: {
summaryOnly: true,
urls: [
// Add QUnit modules below using the format:
// QUNIT_URL_BASE + 'ext.popups.testModule'
QUNIT_URL_BASE + 'ext.popups'
]
}
}
},
stylelint: {
options: {
syntax: 'less'
},
all: [
'resources/**/*.less'
]
},
watch: {
lint: {
files: [ 'resources/**/*.js', 'tests/qunit/**/*.js' ],
tasks: [ 'lint' ]
},
scripts: {
files: [ 'resources/**/*.js', 'tests/qunit/**/*.js' ],
tasks: [ 'test' ]
},
configFiles: {
files: [ 'Gruntfile.js' ],
options: {
reload: true
}
}
}
} );
grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', [ 'qunit' ] );
grunt.registerTask( 'default', [ 'test', 'lint' ] );
};