@microsoft/api-extractor
Advanced tools
Comparing version 3.2.4 to 3.2.5
@@ -5,2 +5,26 @@ { | ||
{ | ||
"version": "3.2.5", | ||
"tag": "@microsoft/api-extractor_v3.2.5", | ||
"date": "Mon, 11 Sep 2017 13:04:55 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"author": "pgonzal <pgonzal@users.noreply.github.com>", | ||
"commit": "d4271683f40917843650ddb537dcd21f1b3372be", | ||
"comment": "The isBeta and deprecatedMessage fields are now inherited in the *.api.json files" | ||
}, | ||
{ | ||
"author": "pgonzal <pgonzal@users.noreply.github.com>", | ||
"commit": "7de7daf14ea8299922e578125669ecfabbde8857", | ||
"comment": "Fix an issue where the *.api.json file was sometimes missing function parameters" | ||
} | ||
], | ||
"dependency": [ | ||
{ | ||
"comment": "Updating dependency \"@microsoft/node-core-library\" from `~0.2.9` to `~0.2.10`" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "3.2.4", | ||
@@ -7,0 +31,0 @@ "tag": "@microsoft/api-extractor_v3.2.4", |
# Change Log - @microsoft/api-extractor | ||
This log was last generated on Fri, 08 Sep 2017 01:28:04 GMT and should not be manually modified. | ||
This log was last generated on Mon, 11 Sep 2017 13:04:55 GMT and should not be manually modified. | ||
## 3.2.5 | ||
Mon, 11 Sep 2017 13:04:55 GMT | ||
### Patches | ||
- The isBeta and deprecatedMessage fields are now inherited in the *.api.json files | ||
- Fix an issue where the *.api.json file was sometimes missing function parameters | ||
## 3.2.4 | ||
@@ -6,0 +14,0 @@ Fri, 08 Sep 2017 01:28:04 GMT |
@@ -66,2 +66,12 @@ import { IDocElement } from '../markup/OldMarkup'; | ||
/** | ||
* An ordered map of items, indexed by the symbol name. | ||
* @alpha | ||
*/ | ||
export interface IApiNameMap<T> { | ||
/** | ||
* For a given name, returns the object with that name. | ||
*/ | ||
[name: string]: T; | ||
} | ||
/** | ||
* Return value of a method or function. | ||
@@ -152,5 +162,3 @@ * @alpha | ||
*/ | ||
parameters: { | ||
[name: string]: IApiParameter; | ||
}; | ||
parameters: IApiNameMap<IApiParameter>; | ||
/** | ||
@@ -173,5 +181,3 @@ * describes the return value of the method | ||
*/ | ||
parameters: { | ||
[name: string]: IApiParameter; | ||
}; | ||
parameters: IApiNameMap<IApiParameter>; | ||
/** | ||
@@ -194,5 +200,3 @@ * a description of the return value | ||
*/ | ||
parameters: { | ||
[name: string]: IApiParameter; | ||
}; | ||
parameters: IApiNameMap<IApiParameter>; | ||
} | ||
@@ -211,5 +215,3 @@ /** | ||
*/ | ||
members: { | ||
[name: string]: ApiMember; | ||
}; | ||
members: IApiNameMap<ApiMember>; | ||
/** | ||
@@ -263,5 +265,3 @@ * Interfaces implemented by this class | ||
*/ | ||
members: { | ||
[name: string]: ApiMember; | ||
}; | ||
members: IApiNameMap<ApiMember>; | ||
/** | ||
@@ -300,5 +300,3 @@ * Interfaces implemented by this interface | ||
*/ | ||
exports: { | ||
[name: string]: ApiItem; | ||
}; | ||
exports: IApiNameMap<ApiItem>; | ||
/** | ||
@@ -305,0 +303,0 @@ * The following are needed so that this interface and can share |
import * as ts from 'typescript'; | ||
import Extractor from '../Extractor'; | ||
import ApiDocumentation from '../aedoc/ApiDocumentation'; | ||
import { IDocElement } from '../markup/OldMarkup'; | ||
import { ReleaseTag } from '../aedoc/ReleaseTag'; | ||
import AstItemContainer from './AstItemContainer'; | ||
@@ -166,2 +168,18 @@ /** | ||
/** | ||
* The release tag for this item, which may be inherited from a parent. | ||
* By contrast, ApiDocumentation.releaseTag merely tracks the release tag that was | ||
* explicitly applied to this item, and does not consider inheritance. | ||
* @remarks | ||
* This is calculated during completeInitialization() and should not be used beforehand. | ||
*/ | ||
inheritedReleaseTag: ReleaseTag; | ||
/** | ||
* The deprecated message for this item, which may be inherited from a parent. | ||
* By contrast, ApiDocumentation.deprecatedMessage merely tracks the message that was | ||
* explicitly applied to this item, and does not consider inheritance. | ||
* @remarks | ||
* This is calculated during completeInitialization() and should not be used beforehand. | ||
*/ | ||
inheritedDeprecatedMessage: IDocElement[]; | ||
/** | ||
* The Extractor object that acts as the root of the abstract syntax tree that this item belongs to. | ||
@@ -168,0 +186,0 @@ */ |
@@ -131,2 +131,18 @@ "use strict"; | ||
this.hasIncompleteTypes = false; | ||
/** | ||
* The release tag for this item, which may be inherited from a parent. | ||
* By contrast, ApiDocumentation.releaseTag merely tracks the release tag that was | ||
* explicitly applied to this item, and does not consider inheritance. | ||
* @remarks | ||
* This is calculated during completeInitialization() and should not be used beforehand. | ||
*/ | ||
this.inheritedReleaseTag = ReleaseTag_1.ReleaseTag.None; | ||
/** | ||
* The deprecated message for this item, which may be inherited from a parent. | ||
* By contrast, ApiDocumentation.deprecatedMessage merely tracks the message that was | ||
* explicitly applied to this item, and does not consider inheritance. | ||
* @remarks | ||
* This is calculated during completeInitialization() and should not be used beforehand. | ||
*/ | ||
this.inheritedDeprecatedMessage = []; | ||
this.reportError = this.reportError.bind(this); | ||
@@ -297,2 +313,16 @@ this.jsdocNode = options.jsdocNode; | ||
this.documentation.completeInitialization(this.warnings); | ||
// Calculate the inherited release tag | ||
if (this.documentation.releaseTag !== ReleaseTag_1.ReleaseTag.None) { | ||
this.inheritedReleaseTag = this.documentation.releaseTag; | ||
} | ||
else if (this.parentContainer) { | ||
this.inheritedReleaseTag = this.parentContainer.inheritedReleaseTag; | ||
} | ||
// Calculate the inherited deprecation message | ||
if (this.documentation.deprecatedMessage.length) { | ||
this.inheritedDeprecatedMessage = this.documentation.deprecatedMessage; | ||
} | ||
else if (this.parentContainer) { | ||
this.inheritedDeprecatedMessage = this.parentContainer.inheritedDeprecatedMessage; | ||
} | ||
// TODO: this.visitTypeReferencesForNode(this); | ||
@@ -299,0 +329,0 @@ var summaryTextCondensed = DocElementParser_1.default.getAsText(this.documentation.summary, this.reportError).replace(/\s\s/g, ' '); |
@@ -66,3 +66,11 @@ { | ||
}, | ||
"parameters": {}, | ||
"parameters": { | ||
"___proto__": { | ||
"name": "___proto__", | ||
"description": [], | ||
"isOptional": false, | ||
"isSpread": false, | ||
"type": "string" | ||
} | ||
}, | ||
"deprecatedMessage": [], | ||
@@ -148,3 +156,3 @@ "summary": [], | ||
"remarks": [], | ||
"isBeta": false | ||
"isBeta": true | ||
} | ||
@@ -232,3 +240,11 @@ } | ||
}, | ||
"parameters": {}, | ||
"parameters": { | ||
"param": { | ||
"name": "param", | ||
"description": [], | ||
"isOptional": false, | ||
"isSpread": false, | ||
"type": "number" | ||
} | ||
}, | ||
"deprecatedMessage": [], | ||
@@ -235,0 +251,0 @@ "summary": [], |
@@ -194,16 +194,3 @@ { | ||
}, | ||
"parameters": { | ||
"param1": { | ||
"name": "param1", | ||
"description": [ | ||
{ | ||
"kind": "textDocElement", | ||
"value": "A description for param1." | ||
} | ||
], | ||
"isOptional": false, | ||
"isSpread": false, | ||
"type": "string" | ||
} | ||
}, | ||
"parameters": {}, | ||
"deprecatedMessage": [], | ||
@@ -237,16 +224,3 @@ "summary": [ | ||
}, | ||
"parameters": { | ||
"param1": { | ||
"name": "param1", | ||
"description": [ | ||
{ | ||
"kind": "textDocElement", | ||
"value": "A description for param1." | ||
} | ||
], | ||
"isOptional": false, | ||
"isSpread": false, | ||
"type": "string" | ||
} | ||
}, | ||
"parameters": {}, | ||
"deprecatedMessage": [], | ||
@@ -253,0 +227,0 @@ "summary": [ |
@@ -32,3 +32,11 @@ { | ||
}, | ||
"parameters": {}, | ||
"parameters": { | ||
"promise": { | ||
"name": "promise", | ||
"description": [], | ||
"isOptional": false, | ||
"isSpread": false, | ||
"type": "Promise<void>" | ||
} | ||
}, | ||
"deprecatedMessage": [], | ||
@@ -102,3 +110,11 @@ "summary": [ | ||
}, | ||
"parameters": {}, | ||
"parameters": { | ||
"library": { | ||
"name": "library", | ||
"description": [], | ||
"isOptional": false, | ||
"isSpread": false, | ||
"type": "MyLibrary3" | ||
} | ||
}, | ||
"deprecatedMessage": [], | ||
@@ -124,3 +140,11 @@ "summary": [ | ||
}, | ||
"parameters": {}, | ||
"parameters": { | ||
"missing": { | ||
"name": "missing", | ||
"description": [], | ||
"isOptional": false, | ||
"isSpread": false, | ||
"type": "MissingExport" | ||
} | ||
}, | ||
"deprecatedMessage": [], | ||
@@ -127,0 +151,0 @@ "summary": [ |
@@ -8,3 +8,2 @@ import Extractor from '../Extractor'; | ||
import AstPackage from '../ast/AstPackage'; | ||
import AstParameter from '../ast/AstParameter'; | ||
import AstMember from '../ast/AstMember'; | ||
@@ -57,3 +56,2 @@ import AstNamespace from '../ast/AstNamespace'; | ||
protected visitAstFunction(astFunction: AstFunction): void; | ||
protected visitApiParam(astParam: AstParameter): void; | ||
/** | ||
@@ -60,0 +58,0 @@ * Writes a synopsis of the AEDoc comments, which indicates the release tag, |
@@ -157,5 +157,2 @@ "use strict"; | ||
}; | ||
ApiFileGenerator.prototype.visitApiParam = function (astParam) { | ||
throw Error('Not Implemented'); | ||
}; | ||
/** | ||
@@ -162,0 +159,0 @@ * Writes a synopsis of the AEDoc comments, which indicates the release tag, |
@@ -10,3 +10,2 @@ import { JsonSchema } from '@microsoft/node-core-library'; | ||
import AstPackage from '../ast/AstPackage'; | ||
import AstParameter from '../ast/AstParameter'; | ||
import AstProperty from '../ast/AstProperty'; | ||
@@ -50,3 +49,3 @@ import AstMember from '../ast/AstMember'; | ||
protected visitAstMethod(astMethod: AstMethod, refObject?: Object): void; | ||
protected visitApiParam(astParam: AstParameter, refObject?: Object): void; | ||
private _createParameters(astFunction); | ||
} |
@@ -70,3 +70,3 @@ "use strict"; | ||
ApiJsonGenerator.prototype.visit = function (astItem, refObject) { | ||
switch (astItem.documentation.releaseTag) { | ||
switch (astItem.inheritedReleaseTag) { | ||
case ReleaseTag_1.ReleaseTag.None: | ||
@@ -93,6 +93,6 @@ case ReleaseTag_1.ReleaseTag.Beta: | ||
typeParameters: astStructuredType.typeParameters || [], | ||
deprecatedMessage: astStructuredType.documentation.deprecatedMessage || [], | ||
deprecatedMessage: astStructuredType.inheritedDeprecatedMessage || [], | ||
summary: astStructuredType.documentation.summary || [], | ||
remarks: astStructuredType.documentation.remarks || [], | ||
isBeta: astStructuredType.documentation.releaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
isBeta: astStructuredType.inheritedReleaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
}; | ||
@@ -119,6 +119,6 @@ refObject[astStructuredType.name] = structureNode; | ||
values: valuesNode, | ||
deprecatedMessage: astEnum.documentation.deprecatedMessage || [], | ||
deprecatedMessage: astEnum.inheritedDeprecatedMessage || [], | ||
summary: astEnum.documentation.summary || [], | ||
remarks: astEnum.documentation.remarks || [], | ||
isBeta: astEnum.documentation.releaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
isBeta: astEnum.inheritedReleaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
}; | ||
@@ -142,6 +142,6 @@ refObject[astEnum.name] = enumNode; | ||
value: value, | ||
deprecatedMessage: astEnumValue.documentation.deprecatedMessage || [], | ||
deprecatedMessage: astEnumValue.inheritedDeprecatedMessage || [], | ||
summary: astEnumValue.documentation.summary || [], | ||
remarks: astEnumValue.documentation.remarks || [], | ||
isBeta: astEnumValue.documentation.releaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
isBeta: astEnumValue.inheritedReleaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
}; | ||
@@ -153,6 +153,2 @@ }; | ||
} | ||
for (var _i = 0, _a = astFunction.params; _i < _a.length; _i++) { | ||
var param = _a[_i]; | ||
this.visitApiParam(param, astFunction.documentation.parameters[param.name]); | ||
} | ||
var returnValueNode = { | ||
@@ -165,7 +161,7 @@ type: astFunction.returnType, | ||
returnValue: returnValueNode, | ||
parameters: astFunction.documentation.parameters, | ||
deprecatedMessage: astFunction.documentation.deprecatedMessage || [], | ||
parameters: this._createParameters(astFunction), | ||
deprecatedMessage: astFunction.inheritedDeprecatedMessage || [], | ||
summary: astFunction.documentation.summary || [], | ||
remarks: astFunction.documentation.remarks || [], | ||
isBeta: astFunction.documentation.releaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
isBeta: astFunction.inheritedReleaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
}; | ||
@@ -199,6 +195,6 @@ refObject[astFunction.name] = newNode; | ||
kind: ApiJsonFile_1.default.convertKindToJson(astNamespace.kind), | ||
deprecatedMessage: astNamespace.documentation.deprecatedMessage || [], | ||
deprecatedMessage: astNamespace.inheritedDeprecatedMessage || [], | ||
summary: astNamespace.documentation.summary || [], | ||
remarks: astNamespace.documentation.remarks || [], | ||
isBeta: astNamespace.documentation.releaseTag === ReleaseTag_1.ReleaseTag.Beta, | ||
isBeta: astNamespace.inheritedReleaseTag === ReleaseTag_1.ReleaseTag.Beta, | ||
exports: membersNode | ||
@@ -227,6 +223,6 @@ }; | ||
type: astProperty.type, | ||
deprecatedMessage: astProperty.documentation.deprecatedMessage || [], | ||
deprecatedMessage: astProperty.inheritedDeprecatedMessage || [], | ||
summary: astProperty.documentation.summary || [], | ||
remarks: astProperty.documentation.remarks || [], | ||
isBeta: astProperty.documentation.releaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
isBeta: astProperty.inheritedReleaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
}; | ||
@@ -240,6 +236,6 @@ refObject[astProperty.name] = newNode; | ||
value: astModuleVariable.value, | ||
deprecatedMessage: astModuleVariable.documentation.deprecatedMessage || [], | ||
deprecatedMessage: astModuleVariable.inheritedDeprecatedMessage || [], | ||
summary: astModuleVariable.documentation.summary || [], | ||
remarks: astModuleVariable.documentation.remarks || [], | ||
isBeta: astModuleVariable.documentation.releaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
isBeta: astModuleVariable.inheritedReleaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
}; | ||
@@ -252,6 +248,2 @@ refObject[astModuleVariable.name] = newNode; | ||
} | ||
for (var _i = 0, _a = astMethod.params; _i < _a.length; _i++) { | ||
var param = _a[_i]; | ||
this.visitApiParam(param, astMethod.documentation.parameters[param.name]); | ||
} | ||
var newNode; | ||
@@ -262,4 +254,4 @@ if (astMethod.name === '__constructor') { | ||
signature: astMethod.getDeclarationLine(), | ||
parameters: astMethod.documentation.parameters, | ||
deprecatedMessage: astMethod.documentation.deprecatedMessage || [], | ||
parameters: this._createParameters(astMethod), | ||
deprecatedMessage: astMethod.inheritedDeprecatedMessage || [], | ||
summary: astMethod.documentation.summary || [], | ||
@@ -281,7 +273,7 @@ remarks: astMethod.documentation.remarks || [] | ||
returnValue: returnValueNode, | ||
parameters: astMethod.documentation.parameters, | ||
deprecatedMessage: astMethod.documentation.deprecatedMessage || [], | ||
parameters: this._createParameters(astMethod), | ||
deprecatedMessage: astMethod.inheritedDeprecatedMessage || [], | ||
summary: astMethod.documentation.summary || [], | ||
remarks: astMethod.documentation.remarks || [], | ||
isBeta: astMethod.documentation.releaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
isBeta: astMethod.inheritedReleaseTag === ReleaseTag_1.ReleaseTag.Beta | ||
}; | ||
@@ -291,11 +283,23 @@ } | ||
}; | ||
ApiJsonGenerator.prototype.visitApiParam = function (astParam, refObject) { | ||
if (!astParam.supportedName) { | ||
return; | ||
ApiJsonGenerator.prototype._createParameters = function (astFunction) { | ||
var result = {}; | ||
for (var _i = 0, _a = astFunction.params; _i < _a.length; _i++) { | ||
var astParameter = _a[_i]; | ||
if (!astParameter.supportedName) { | ||
continue; // skip parameter names with unusual characters | ||
} | ||
var apiParameter = { | ||
name: astParameter.name, | ||
description: [], | ||
isOptional: astParameter.isOptional, | ||
isSpread: astParameter.isSpread, | ||
type: astParameter.type || '' | ||
}; | ||
var aedocParameter = astFunction.documentation.parameters[astParameter.name]; | ||
if (aedocParameter) { | ||
apiParameter.description = aedocParameter.description; | ||
} | ||
result[astParameter.name] = apiParameter; | ||
} | ||
if (refObject) { | ||
refObject.isOptional = astParam.isOptional; | ||
refObject.isSpread = astParam.isSpread; | ||
refObject.type = astParam.type; | ||
} | ||
return result; | ||
}; | ||
@@ -302,0 +306,0 @@ ApiJsonGenerator._methodCounter = 0; |
@@ -10,3 +10,2 @@ import AstPackage from '../ast/AstPackage'; | ||
import AstNamespace from '../ast/AstNamespace'; | ||
import AstParameter from '../ast/AstParameter'; | ||
import AstProperty from '../ast/AstProperty'; | ||
@@ -30,4 +29,3 @@ import AstModuleVariable from '../ast/AstModuleVariable'; | ||
protected visitAstProperty(astProperty: AstProperty, refObject?: Object): void; | ||
protected abstract visitApiParam(astParam: AstParameter, refObject?: Object): void; | ||
} | ||
export default AstItemVisitor; |
{ | ||
"name": "@microsoft/api-extractor", | ||
"version": "3.2.4", | ||
"version": "3.2.5", | ||
"description": "Validate, document, and review the exported API for a TypeScript library", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@microsoft/node-core-library": "~0.2.8", | ||
"@microsoft/node-core-library": "~0.2.10", | ||
"@types/fs-extra": "0.0.37", | ||
@@ -33,0 +33,0 @@ "@types/node": "6.0.62", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
781771
10182