[MediaWiki-commits] [Gerrit] build: Use jsduck native - change (mediawiki...MobileFrontend)
jenkins-bot has submitted this change and it was merged. Change subject: build: Use jsduck native .. build: Use jsduck native * Simplify mkdir to just docs/. Creating the subdirectory will just make jsduck remove and re-create it. This matches the way the Makefile manages phpdoc (also only creates docs/). * Other applications and services that support JSDuck will be able to discover the jsduck configuration in its standard location and use it. * By running jsduck natively a few bugs from grunt-jsduck are implicitly fixed: - Warnings are no longer output twice. - JSDuck's feathers finally shine. The output colors are now preserved. - More descriptive exit code. The entry points npm run doc, make docs and make jsduck continue to work fine. However grunt docs will no longer exist. I would've kept grunt-docs (just for convenience during the transition) if it weren't for the fact that grunt-jsduck doesn't support reading from 'jsduck.json'. Minor hygiene: Only match /docs at the top level in gitignore. Change-Id: I4e7c8cd22991c7979b09590a34996480e566cba7 --- M .gitignore M Gruntfile.js A jsduck.json M package.json 4 files changed, 35 insertions(+), 42 deletions(-) Approvals: Jdlrobson: Looks good to me, approved jenkins-bot: Verified diff --git a/.gitignore b/.gitignore index e900ac6..b19d449 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ /vendor/ node_modules/ tmp/ -docs/ +/docs dev-scripts/remotes vendor/ composer.phar diff --git a/Gruntfile.js b/Gruntfile.js index 4264e18..e711ef3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,7 +13,6 @@ grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.loadNpmTasks( 'grunt-notify' ); grunt.loadNpmTasks( 'grunt-svg2png' ); - grunt.loadNpmTasks( 'grunt-jsduck' ); grunt.initConfig( { URL: process.env.MEDIAWIKI_URL || 'http://127.0.0.1:8080/w/index.php/', @@ -25,9 +24,9 @@ jsTests: 'tests/qunit/**/*.js' }, mkdir: { - jsdocs: { + docs: { options: { - create: [ 'docs/js' ] + create: [ 'docs' ] } } }, @@ -97,49 +96,15 @@ reload: true } } - }, - jsduck: { - main: { - src: [ - '%= files.js %' - ], - dest: 'docs/js', - options: { - 'builtin-classes': true, - 'external': [ - 'Hogan.Template', - 'HandleBars.Template', - 'jQuery.Deferred', - 'jQuery.Promise', - 'jQuery.Event', - 'jQuery.Object', - 'jqXHR', - 'File', - 'mw.user', - 'mw.Api', - 'CodeMirror', - 'OO.ui.ToolGroup', - 'OO.ui.LookupElement', - 'OO.EventEmitter' - ], - 'ignore-global': true, - 'tags': './.docs/jsduckCustomTags.rb', - // https://github.com/senchalabs/jsduck/issues/525 - 'processes': 0, - 'warnings-exit-nonzero': true, - 'warnings': [ '-nodoc(class,public)', '-dup_member', '-link_ambiguous' ] - } - } } } ); grunt.registerTask( 'lint', [ 'jshint', 'jscs' ] ); - grunt.registerTask( 'docs', [ 'mkdir:jsdocs', 'jsduck:main' ] ); // grunt test will be run by npm test which will be run by Jenkins // Do not execute qunit here, or other tasks that require full mediawiki // running. - grunt.registerTask( 'test', [ 'lint', 'docs' ] ); + grunt.registerTask( 'test', [ 'lint' ] ); grunt.registerTask( 'default', [ 'test' ] ); }; diff --git a/jsduck.json b/jsduck.json new
[MediaWiki-commits] [Gerrit] build: Use jsduck native - change (mediawiki...MobileFrontend)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/219427 Change subject: build: Use jsduck native .. build: Use jsduck native * Simplify mkdir to just docs/. Creating the subdirectory will just make jsduck remove and re-create it. This matches the way the Makefile manages phpdoc (also only creates docs/). * Other applications and services that support JSDuck will be able to discover the jsduck configuration in its standard location and use it. * By running jsduck natively a few bugs from grunt-jsduck are implicitly fixed: - Warnings are no longer output twice. - JSDuck's feathers finally shine. The output colors are now preserved. - More descriptive exit code. The entry points npm run doc, make docs and make jsduck continue to work fine. However grunt docs will no longer exist. I would've kept grunt-docs (just for convenience during the transition) if it weren't for the fact that grunt-jsduck doesn't support reading from 'jsduck.json'. Minor hygiene: Only match /docs at the top level in gitignore. Change-Id: I4e7c8cd22991c7979b09590a34996480e566cba7 --- M .gitignore M Gruntfile.js A jsduck.json M package.json 4 files changed, 34 insertions(+), 41 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/27/219427/1 diff --git a/.gitignore b/.gitignore index e900ac6..b19d449 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ /vendor/ node_modules/ tmp/ -docs/ +/docs dev-scripts/remotes vendor/ composer.phar diff --git a/Gruntfile.js b/Gruntfile.js index 4264e18..e711ef3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,7 +13,6 @@ grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.loadNpmTasks( 'grunt-notify' ); grunt.loadNpmTasks( 'grunt-svg2png' ); - grunt.loadNpmTasks( 'grunt-jsduck' ); grunt.initConfig( { URL: process.env.MEDIAWIKI_URL || 'http://127.0.0.1:8080/w/index.php/', @@ -25,9 +24,9 @@ jsTests: 'tests/qunit/**/*.js' }, mkdir: { - jsdocs: { + docs: { options: { - create: [ 'docs/js' ] + create: [ 'docs' ] } } }, @@ -97,49 +96,15 @@ reload: true } } - }, - jsduck: { - main: { - src: [ - '%= files.js %' - ], - dest: 'docs/js', - options: { - 'builtin-classes': true, - 'external': [ - 'Hogan.Template', - 'HandleBars.Template', - 'jQuery.Deferred', - 'jQuery.Promise', - 'jQuery.Event', - 'jQuery.Object', - 'jqXHR', - 'File', - 'mw.user', - 'mw.Api', - 'CodeMirror', - 'OO.ui.ToolGroup', - 'OO.ui.LookupElement', - 'OO.EventEmitter' - ], - 'ignore-global': true, - 'tags': './.docs/jsduckCustomTags.rb', - // https://github.com/senchalabs/jsduck/issues/525 - 'processes': 0, - 'warnings-exit-nonzero': true, - 'warnings': [ '-nodoc(class,public)', '-dup_member', '-link_ambiguous' ] - } - } } } ); grunt.registerTask( 'lint', [ 'jshint', 'jscs' ] ); - grunt.registerTask( 'docs', [ 'mkdir:jsdocs', 'jsduck:main' ] ); // grunt test will be run by npm test which will be run by Jenkins // Do not execute qunit here, or other tasks that require full mediawiki // running. - grunt.registerTask( 'test', [ 'lint', 'docs' ] ); + grunt.registerTask( 'test', [ 'lint' ] ); grunt.registerTask( 'default', [