mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
1944b0c6f0
It works locally because it can just nagivate to ../lib/ve.
In production however we need docs/ to be standalone so that we
can publish it without needing a subdirectory at:
https://docs.wikimedia.org/VisualEditor/master/.
For local usage this will be a symlink that still points to
the sibling directory (but using a symlink instead of a ../ path).
In production we can then instruct jenkins to replace that symlink
with an actual copy of lib/. As long as the generated path
references in the HTML remain the same.
Follows-up 88c4888872
, which broke the publication of the docs in
Jenkins as it changed references from modules/ to ../modules/ for
the eg-iframe. This works locally, but broke in Jenkins as it was relying
on the copying of modules/ to docs/modules/ being enough to make it work).
Change-Id: I10eaa5424d172932b29774a0f03d511d555fd121
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'] );
|
|
};
|