Skip to content

Commit

Permalink
MDL-75012 js: Use our own jsdoc wrapper
Browse files Browse the repository at this point in the history
grunt-jsdoc is abandoned and only works with an older version of jsdoc.

This is a very simple wrapper around jsdoc itself.
  • Loading branch information
andrewnicols committed Feb 28, 2023
1 parent 472fc27 commit 5d0631b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 251 deletions.
40 changes: 28 additions & 12 deletions .grunt/tasks/jsdoc.js
Expand Up @@ -20,17 +20,33 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

module.exports = grunt => {
// Project configuration.
grunt.config.merge({
jsdoc: {
dist: {
options: {
configure: ".grunt/jsdoc/jsdoc.conf.js",
},
},
},
});
module.exports = (grunt) => {
const path = require('path');

grunt.registerTask('jsdoc', 'Generate JavaScript documentation using jsdoc', function() {
const done = this.async();
const configuration = path.resolve('.grunt/jsdoc/jsdoc.conf.js');

grunt.loadNpmTasks('grunt-jsdoc');
grunt.util.spawn({
cmd: 'jsdoc',
args: [
'--configure',
configuration,
]
}, function(error, result, code) {
if (result.stdout) {
grunt.log.write(result.stdout);
}

if (result.stderr) {
grunt.log.error(result.stderr);
}
if (error) {
grunt.fail.fatal(`JSDoc failed with error code ${code}`);
} else {
grunt.log.write('JSDoc completed successfully'.green);
}
done();
});
});
};
238 changes: 0 additions & 238 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -27,7 +27,6 @@
"grunt": "^1.6.1",
"grunt-contrib-watch": "1.1.0",
"grunt-eslint": "24.0.0",
"grunt-jsdoc": "^2.4.1",
"grunt-rollup": "^11.9.0",
"grunt-sass": "3.1.0",
"grunt-stylelint": "^0.18.0",
Expand Down

0 comments on commit 5d0631b

Please sign in to comment.