From efc84d2f25db103a66208802832b5975f2bcd12e Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Thu, 13 Jul 2017 08:56:30 -0700 Subject: [PATCH] Add tooling for documentation * Add global View and Page * Remove inheritdoc statements for globals - docs cannot be inherited from a class defined in another repo Note: you'll need to `gem install jsduck` for this to work Bug: T170639 Change-Id: Idb3a6e9edbd45889047e7904561b84033569a689 --- jsduck.json | 34 +++++++++++++++++++ package.json | 4 ++- resources/skins.minerva.mainMenu/MainMenu.js | 4 --- .../NotificationBadge.js | 5 --- 4 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 jsduck.json diff --git a/jsduck.json b/jsduck.json new file mode 100644 index 0000000..d1938ea --- /dev/null +++ b/jsduck.json @@ -0,0 +1,34 @@ +{ + "--title": "MinervaNeue - Documentation", + "--output": "docs", + "--processes": "0", + "--warnings-exit-nonzero": true, + "--builtin-classes": true, + "--external": [ + "Hogan.Template", + "HandleBars.Template", + "jQuery.Deferred", + "jQuery.Promise", + "jQuery.Event", + "jQuery.Object", + "jqXHR", + "View", + "Page", + "File", + "Router", + "MainMenu", + "mw.user", + "mw.Api", + "mw.ForeignApi", + "OO.ui.ToolGroup", + "OO.ui.Tool", + "OO.ui.mixin.LookupElement", + "OO.EventEmitter", + "ve.init.mw.MobileArticleTarget", + "mw.echo.dm.NotificationItem" + ], + "--warnings": ["-nodoc(class,public)", "-dup_member", "-link_ambiguous"], + "--": [ + "resources" + ] +} diff --git a/package.json b/package.json index 7184a14..48f00c9 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,11 @@ { "private": true, "scripts": { - "test": "grunt test && dev-scripts/svg_check.sh" + "test": "grunt test && npm run doc && dev-scripts/svg_check.sh", + "doc": "jsduck" }, "dependencies": { + "jsdoc": "3.4.2", "svgo": ">=0.4.4" }, "devDependencies": { diff --git a/resources/skins.minerva.mainMenu/MainMenu.js b/resources/skins.minerva.mainMenu/MainMenu.js index babda9b..4b51e40 100644 --- a/resources/skins.minerva.mainMenu/MainMenu.js +++ b/resources/skins.minerva.mainMenu/MainMenu.js @@ -17,11 +17,8 @@ } OO.mfExtend( MainMenu, View, { - /** @inheritdoc */ isTemplateMode: true, - /** @inheritdoc */ template: mw.template.get( 'skins.minerva.mainMenu', 'menu.hogan' ), - /** @inheritdoc */ templatePartials: { menuGroup: mw.template.get( 'skins.minerva.mainMenu', 'menuGroup.hogan' ) }, @@ -51,7 +48,6 @@ } ); }, /** - * @inheritdoc * Remove the nearby menu entry if the browser doesn't support geo location */ postRender: function () { diff --git a/resources/skins.minerva.notifications.badge/NotificationBadge.js b/resources/skins.minerva.notifications.badge/NotificationBadge.js index 7f51830..f6a9e84 100644 --- a/resources/skins.minerva.notifications.badge/NotificationBadge.js +++ b/resources/skins.minerva.notifications.badge/NotificationBadge.js @@ -31,7 +31,6 @@ OO.mfExtend( NotificationBadge, View, { /** - * @inheritdoc * @cfg {Object} defaults Default options hash. * @cfg {String} defaults.notificationIconClass e.g. mw-ui-icon for icon * @cfg {String} defaults.loadingIconHtml for spinner @@ -45,9 +44,6 @@ hasUnseenNotifications: false, notificationCount: 0 }, - /** - * @inheritdoc - */ isBorderBox: false, /** * Loads a ResourceLoader module script. Shows ajax loader whilst loading. @@ -107,7 +103,6 @@ } ); } ); }, - /** @inheritdoc */ template: mw.template.get( 'skins.minerva.notifications.badge', 'badge.hogan' ), /** * Click handler for clicking on the badge