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', [ 'test' ] ); }; diff --git a/jsduck.json b/jsduck.json new file mode 100644 index 0000000..7d7f0ba --- /dev/null +++ b/jsduck.json @@ -0,0 +1,28 @@ +{ + "--title": "MobileFrontend - Documentation", + "--output": "docs", + "--processes": "0", + "--tags": ".docs/jsduckCustomTags.rb", + "--warnings-exit-nonzero": true, + "--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" + ], + "--warnings": ["-nodoc(class,public)", "-dup_member", "-link_ambiguous"], + "--": [ + "resources" + ] +} diff --git a/package.json b/package.json index 24b8e28..f78b52b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "version": "0.0.1", "scripts": { "test": "grunt test", - "doc": "grunt docs" + "predoc": "grunt mkdir:docs", + "doc": "jsduck" }, "repository": { "type": "git", @@ -26,7 +27,6 @@ "grunt-contrib-jshint": "0.10.0", "grunt-jscs": "1.8.0", "jscs-jsdoc": "git+https://github.com/jdlrobson/jscs-jsdoc.git#checkParamExistence", - "grunt-jsduck": "^1.0.1", "js-beautify": "^1.5.4", "grunt-notify": "^0.3.1", "grunt-contrib-watch": "0.6.1", -- To view, visit https://gerrit.wikimedia.org/r/219427 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4e7c8cd22991c7979b09590a34996480e566cba7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits