[ADF-2557] Added return tag support and error messages (#3127)

* [ADF-2557] Added return tag support and error messages

* [ADF-2557] Set doc tool config to use index script correctly
This commit is contained in:
Andy Stark
2018-03-28 16:00:59 +01:00
committed by Eugenio Romano
parent 0aba5bb1b5
commit 7d5f1b223b
5 changed files with 63 additions and 20 deletions

View File

@@ -7,7 +7,7 @@ var remark = require("remark");
var frontMatter = require("remark-frontmatter");
var liquid = require("liquidjs");
var typedoc_1 = require("typedoc");
var libFolders = ["content-services"]; //["core", "content-services", "process-services", "insights"];
var libFolders = ["core", "content-services", "process-services", "insights"];
var templateFolder = path.resolve(".", "config", "DocProcessor", "templates");
var excludePatterns = [
"**/*.spec.ts"
@@ -21,16 +21,22 @@ var PropInfo = /** @class */ (function () {
var _this = this;
this.name = rawProp.name;
this.docText = rawProp.comment ? rawProp.comment.shortText : "";
this.docText = this.docText.replace(/[\n\r]+/g, " ");
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
this.defaultValue = rawProp.defaultValue || "";
this.defaultValue = this.defaultValue.replace(/\|/, "\\|");
this.type = rawProp.type ? rawProp.type.toString() : "";
if (rawProp.decorators) {
rawProp.decorators.forEach(function (dec) {
if (dec.name === "Input")
if (dec.name === "Input") {
_this.isInput = true;
if (dec.name === "Output")
if (!_this.docText)
console.log("Warning: Input \"" + rawProp.getFullName() + "\" has no doc text.");
}
if (dec.name === "Output") {
_this.isOutput = true;
if (!_this.docText)
console.log("Warning: Output \"" + rawProp.getFullName() + "\" has no doc text.");
}
});
}
this.isDeprecated = rawProp.comment && rawProp.comment.hasTag("deprecated");
@@ -44,7 +50,7 @@ var ParamInfo = /** @class */ (function () {
this.type = rawParam.type.toString();
this.defaultValue = rawParam.defaultValue;
this.docText = rawParam.comment ? rawParam.comment.text : "";
this.docText = this.docText.replace(/[\n\r]+/g, " ");
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
this.isOptional = rawParam.flags.isOptional;
this.combined = this.name;
if (this.isOptional)
@@ -59,14 +65,24 @@ var MethodSigInfo = /** @class */ (function () {
function MethodSigInfo(rawSig) {
var _this = this;
this.name = rawSig.name;
this.docText = rawSig.hasComment() ? rawSig.comment.shortText + rawSig.comment.text : "";
this.docText = this.docText.replace(/[\n\r]+/g, " ");
this.returnType = rawSig.type ? rawSig.type.toString() : "";
this.isDeprecated = rawSig.comment && rawSig.comment.hasTag("deprecated");
if (rawSig.hasComment()) {
this.docText = rawSig.comment.shortText + rawSig.comment.text;
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
if (!this.docText)
console.log("Warning: method \"" + rawSig.name + "\" has no doc text.");
this.returnDocText = rawSig.comment.returns;
this.returnDocText = this.returnDocText ? this.returnDocText.replace(/[\n\r]+/g, " ").trim() : "";
if (!this.returnDocText)
console.log("Warning: Return value of method \"" + rawSig.name + "\" has no doc text.");
this.isDeprecated = rawSig.comment.hasTag("deprecated");
}
this.params = [];
var paramStrings = [];
if (rawSig.parameters) {
rawSig.parameters.forEach(function (rawParam) {
if (!rawParam.comment || !rawParam.comment.text)
console.log("Warning: parameter \"" + rawParam.name + "\" of method \"" + rawSig.name + "\" has no doc text.");
var param = new ParamInfo(rawParam);
_this.params.push(param);
paramStrings.push(param.combined);