From 5a429d90bee27458d922e358bd7787b5b17fc049 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Tue, 31 Jul 2018 09:00:19 -0400 Subject: [PATCH] Add jsdoc to package json and test/build tasks --- .jsdoc.json | 20 ++++++++++++++++++++ package.json | 7 +++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .jsdoc.json diff --git a/.jsdoc.json b/.jsdoc.json new file mode 100644 index 00000000..f4d8b9fc --- /dev/null +++ b/.jsdoc.json @@ -0,0 +1,20 @@ +{ + "plugins": ["plugins/markdown"], + "templates": { + "default": { + "includeDate": false, + "outputSourceFiles": false + } + }, + "source": { + "include": ["src"] + }, + "opts": { + "destination": "playground/docs", + "pedantic": true, + "private": true, + "readme": "README.md", + "recurse": true, + "template": "node_modules/docdash" + } +} diff --git a/package.json b/package.json index 35b33a0a..56822bd2 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,10 @@ "main": "./dist/node/scratch-vm.js", "browser": "./src/index.js", "scripts": { - "build": "webpack --progress --colors --bail", + "build": "npm run docs && webpack --progress --colors --bail", "coverage": "tap ./test/{unit,integration}/*.js --coverage --coverage-report=lcov", "deploy": "touch playground/.nojekyll && gh-pages -t -d playground -m \"Build for $(git log --pretty=format:%H -n1)\"", + "docs": "jsdoc -c .jsdoc.json", "extract:core": "mkdirp translations/core && format-message extract --out-file translations/core/en.json src/extensions/**/index.js", "i18n:src": "npm run extract:core", "lint": "eslint . && format-message lint src/**/*.js", @@ -23,7 +24,7 @@ "tap": "tap ./test/{unit,integration}/*.js", "tap:unit": "tap ./test/unit/*.js", "tap:integration": "tap ./test/integration/*.js", - "test": "npm run lint && npm run tap", + "test": "npm run lint && npm run docs && npm run tap", "watch": "webpack --progress --colors --watch", "version": "json -f package.json -I -e \"this.repository.sha = '$(git log -n1 --pretty=format:%H)'\"" }, @@ -54,6 +55,7 @@ "babel-loader": "^7.0.0", "babel-preset-env": "^1.6.1", "copy-webpack-plugin": "^4.5.1", + "docdash": "^0.4.0", "eslint": "^5.0.1", "eslint-config-scratch": "^5.0.0", "expose-loader": "0.7.5", @@ -61,6 +63,7 @@ "format-message-cli": "5.2.1", "gh-pages": "^1.1.0", "in-publish": "^2.0.0", + "jsdoc": "^3.5.5", "json": "^9.0.4", "lodash.defaultsdeep": "4.6.0", "pngjs": "^3.3.2",