build: Move pre/post 'doc' task into package.json

Standard entry point.

Change-Id: Ic6cdc9ac1b266a64dcb1522ac36132c5ef844d3c
This commit is contained in:
Timo Tijhof 2015-04-03 10:33:22 +01:00 committed by James D. Forrester
parent 92fca62022
commit 1082249691
4 changed files with 22 additions and 4 deletions

View file

@ -8,6 +8,7 @@
module.exports = function ( grunt ) {
var modules = grunt.file.readJSON( 'lib/ve/build/modules.json' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-csslint' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
@ -72,6 +73,13 @@ module.exports = function ( grunt ) {
banana: {
all: 'modules/ve-{mw,wmf}/i18n/'
},
copy: {
jsduck: {
src: 'lib/ve/**/*',
dest: 'docs/',
expand: true
}
},
watch: {
files: [
'.{csslintrc,jscsrc,jshintignore,jshintrc}',

View file

@ -1,4 +1,11 @@
#!/usr/bin/env bash
#
# DEPRECATED: Use 'npm run-script doc' instead.
#
# This is kept as-is for back-compat with Jenkins jobs.
# Don't forward to 'npm run-script' since Jenkins relies on it
# being a symlink.
#
set -e
cd $(dirname $0)/..
jsduck

View file

@ -1,14 +1,14 @@
{
"--title": "VisualEditor - Documentation",
"--output": "docs",
"--categories": ".jsduck/categories.json",
"--eg-iframe": ".jsduck/eg-iframe.html",
"--tags": ".jsduck/CustomTags.rb",
"--warnings": ["-nodoc(class,public)"],
"--builtin-classes": true,
"--processes": "0",
"--warnings-exit-nonzero": true,
"--builtin-classes": true,
"--external": "HTMLDocument,Window,Node,Set,Range,Selection,ClientRect,File,Blob,DataTransfer,DataTransferItem,KeyboardEvent,MouseEvent",
"--output": "docs",
"--warnings": ["-nodoc(class,public)"],
"--": [
".jsduck/external.js",
"lib/ve/.jsduck/external.js",

View file

@ -4,11 +4,14 @@
"private": true,
"description": "Build tools for the VisualEditor-MediaWiki extension.",
"scripts": {
"test": "grunt test"
"test": "grunt test",
"doc": "jsduck",
"postdoc": "grunt copy:jsduck"
},
"devDependencies": {
"grunt": "0.4.5",
"grunt-banana-checker": "0.2.1",
"grunt-contrib-copy": "0.8.0",
"grunt-contrib-csslint": "0.4.0",
"grunt-contrib-jshint": "0.11.0",
"grunt-contrib-watch": "0.6.1",