mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
ee743f869d
* Add lib/ve. * Remove modules provided by VisualEditor core. * Update paths. * Remove VisualEditor core specific things from Gruntfile. * Remove entries from external.js already in lib/ve/.docs/external.js. * Implement build script to compose a jsduck index that includes all of VisualEditor core. Right now it includes VisualEditor's index as-is, and because those patterns (e.g. ve.dm.*Node) will also MW subclasses this means our category page will include MW classes under "VisualEditor (core)" (before the repo split, this was intentional). This is inevitable unless we list every class individually, or (the plan) until we move the MW subclasses out of the ve.* namespace and into mw.* somewhere. Bug: 45342 Change-Id: Iff45cd555430634c9fc341fd3b177c1e0625300b
91 lines
1.9 KiB
JavaScript
91 lines
1.9 KiB
JavaScript
/*!
|
|
* Grunt file
|
|
*
|
|
* @package VisualEditor
|
|
*/
|
|
|
|
/*jshint node:true */
|
|
module.exports = function ( grunt ) {
|
|
var modules = grunt.file.readJSON( 'lib/ve/build/modules.json' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
|
grunt.loadNpmTasks( 'grunt-contrib-csslint' );
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
|
grunt.loadNpmTasks( 'grunt-jscs-checker' );
|
|
grunt.loadTasks( 'lib/ve/build/tasks' );
|
|
grunt.loadTasks( 'build/tasks' );
|
|
|
|
grunt.initConfig( {
|
|
pkg: grunt.file.readJSON( 'package.json' ),
|
|
jsduckcatconfig: {
|
|
main: {
|
|
target: '.docs/categories.json',
|
|
from: [
|
|
'.docs/mw-categories.json',
|
|
{
|
|
file: 'lib/ve/.docs/categories.json',
|
|
aggregate: {
|
|
'VisualEditor (core)': [
|
|
'General',
|
|
'Initialization',
|
|
'DataModel',
|
|
'ContentEditable',
|
|
'User Interface',
|
|
'Tests'
|
|
]
|
|
},
|
|
include: ['UnicodeJS', 'OOJS UI', 'Upstream']
|
|
}
|
|
]
|
|
}
|
|
},
|
|
buildloader: {
|
|
egiframe: {
|
|
target: '.docs/eg-iframe.html',
|
|
template: '.docs/eg-iframe.html.template',
|
|
modules: modules,
|
|
pathPrefix: '../lib/ve/',
|
|
indent: '\t\t'
|
|
}
|
|
},
|
|
jshint: {
|
|
options: {
|
|
jshintrc: '.jshintrc'
|
|
},
|
|
all: [
|
|
'*.js',
|
|
'{.docs,build}/**/*.js',
|
|
'modules/**/*.js'
|
|
]
|
|
},
|
|
jscs: {
|
|
src: [
|
|
'<%= jshint.all %>',
|
|
'!modules/syntaxhighlight/**/*.js'
|
|
]
|
|
},
|
|
csslint: {
|
|
options: {
|
|
csslintrc: '.csslintrc'
|
|
},
|
|
all: [
|
|
// TODO: modules/syntaxhighlight should be included, but is failing.
|
|
'modules/{ve-mw,ve-wmf}/**/*.css'
|
|
],
|
|
},
|
|
watch: {
|
|
files: [
|
|
'.{jshintrc,jscs.json,jshintignore,csslintrc}',
|
|
'<%= jshint.all %>',
|
|
'<%= csslint.all %>'
|
|
],
|
|
tasks: ['test']
|
|
}
|
|
} );
|
|
|
|
grunt.registerTask( 'lint', ['jshint', 'jscs', 'csslint'] );
|
|
grunt.registerTask( 'test', ['lint'] );
|
|
grunt.registerTask( 'build', ['jsduckcatconfig', 'buildloader'] );
|
|
grunt.registerTask( 'default', ['build', 'test'] );
|
|
};
|