@microsoft/api-extractor
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "2.0.5", | ||
"tag": "@microsoft/api-extractor_v2.0.5", | ||
"date": "Sat, 22 Apr 2017 01:02:03 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Added check for API names that are not supported (only letters and numbers supported)" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "2.0.4", | ||
@@ -7,0 +19,0 @@ "tag": "@microsoft/api-extractor_v2.0.4", |
# Change Log - @microsoft/api-extractor | ||
This log was last generated on Wed, 19 Apr 2017 20:18:06 GMT and should not be manually modified. | ||
This log was last generated on Sat, 22 Apr 2017 01:02:03 GMT and should not be manually modified. | ||
## 2.0.5 | ||
Sat, 22 Apr 2017 01:02:03 GMT | ||
### Patches | ||
- Added check for API names that are not supported (only letters and numbers supported) | ||
## 2.0.4 | ||
@@ -6,0 +13,0 @@ Wed, 19 Apr 2017 20:18:06 GMT |
@@ -88,2 +88,6 @@ import * as ts from 'typescript'; | ||
/** | ||
* Names of API items should only contain letters, numbers and underscores. | ||
*/ | ||
private static _allowedNameRegex; | ||
/** | ||
* The name of the definition, as seen by external consumers of the Public API. | ||
@@ -100,2 +104,6 @@ * For example, suppose a class is defined as "export default class MyClass { }" | ||
/** | ||
* The name of an API item should be readable and not contain any special characters. | ||
*/ | ||
supportedName: boolean; | ||
/** | ||
* Indicates the type of definition represented by this ApiItem instance. | ||
@@ -102,0 +110,0 @@ */ |
@@ -128,6 +128,6 @@ /* tslint:disable:no-bitwise */ | ||
this.extractor = options.extractor; | ||
this.typeChecker = this.extractor.typeChecker; | ||
this.declarationSymbol = options.declarationSymbol; | ||
this.exportSymbol = options.exportSymbol || this.declarationSymbol; | ||
this.name = this.exportSymbol.name || '???'; | ||
this.typeChecker = this.extractor.typeChecker; | ||
var originalJsDoc = ''; | ||
@@ -216,2 +216,7 @@ if (this.jsdocNode) { | ||
this.needsDocumentation = this.shouldHaveDocumentation() && summaryTextCondensed.length <= 10; | ||
this.supportedName = (this.kind === ApiItemKind.Package) || ApiItem._allowedNameRegex.test(this.name); | ||
if (!this.supportedName) { | ||
this.warnings.push("The name \"" + this.name + "\" contains unsupported characters; " + | ||
'API names should use only letters, numbers, and underscores'); | ||
} | ||
if (this.kind === ApiItemKind.Package) { | ||
@@ -412,4 +417,8 @@ if (this.documentation.apiTag !== ApiDocumentation_1.ApiTag.None) { | ||
}()); | ||
/** | ||
* Names of API items should only contain letters, numbers and underscores. | ||
*/ | ||
ApiItem._allowedNameRegex = /^[a-zA-Z_]+[a-zA-Z_0-9]*$/; | ||
exports.default = ApiItem; | ||
//# sourceMappingURL=ApiItem.js.map |
@@ -29,2 +29,4 @@ // WARNING: Unable to find a documentation file ("es6-collections.api.json") for the referenced package | ||
constructor(); | ||
// WARNING: The name "$unallowedName" contains unsupported characters; API names should use only letters, numbers, and underscores | ||
public $unallowedName: string; | ||
// @beta (undocumented) | ||
@@ -31,0 +33,0 @@ public betaTagmissingParam: string; |
@@ -59,2 +59,5 @@ "use strict"; | ||
ApiJsonGenerator.prototype.visitApiStructuredType = function (apiStructuredType, refObject) { | ||
if (!apiStructuredType.supportedName) { | ||
return; | ||
} | ||
var kind = apiStructuredType.kind === ApiItem_1.ApiItemKind.Class ? ApiJsonFile_1.default.convertKindToJson(ApiItem_1.ApiItemKind.Class) : | ||
@@ -86,2 +89,5 @@ apiStructuredType.kind === ApiItem_1.ApiItemKind.Interface ? | ||
ApiJsonGenerator.prototype.visitApiEnum = function (apiEnum, refObject) { | ||
if (!apiEnum.supportedName) { | ||
return; | ||
} | ||
var valuesNode = {}; | ||
@@ -103,2 +109,5 @@ var enumNode = { | ||
ApiJsonGenerator.prototype.visitApiEnumValue = function (apiEnumValue, refObject) { | ||
if (!apiEnumValue.supportedName) { | ||
return; | ||
} | ||
var declaration = apiEnumValue.getDeclaration(); | ||
@@ -118,2 +127,5 @@ var firstToken = declaration ? declaration.getFirstToken() : undefined; | ||
ApiJsonGenerator.prototype.visitApiFunction = function (apiFunction, refObject) { | ||
if (!apiFunction.supportedName) { | ||
return; | ||
} | ||
for (var _i = 0, _a = apiFunction.params; _i < _a.length; _i++) { | ||
@@ -152,5 +164,11 @@ var param = _a[_i]; | ||
ApiJsonGenerator.prototype.visitApiMember = function (apiMember, refObject) { | ||
if (!apiMember.supportedName) { | ||
return; | ||
} | ||
refObject[apiMember.name] = 'apiMember-' + apiMember.getDeclaration().kind; | ||
}; | ||
ApiJsonGenerator.prototype.visitApiProperty = function (apiProperty, refObject) { | ||
if (!apiProperty.supportedName) { | ||
return; | ||
} | ||
if (apiProperty.getDeclaration().kind === ts.SyntaxKind.SetAccessor) { | ||
@@ -173,2 +191,5 @@ return; | ||
ApiJsonGenerator.prototype.visitApiMethod = function (apiMethod, refObject) { | ||
if (!apiMethod.supportedName) { | ||
return; | ||
} | ||
for (var _i = 0, _a = apiMethod.params; _i < _a.length; _i++) { | ||
@@ -211,2 +232,5 @@ var param = _a[_i]; | ||
ApiJsonGenerator.prototype.visitApiParam = function (apiParam, refObject) { | ||
if (!apiParam.supportedName) { | ||
return; | ||
} | ||
if (refObject) { | ||
@@ -213,0 +237,0 @@ refObject.isOptional = apiParam.isOptional; |
{ | ||
"name": "@microsoft/api-extractor", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Validatation, documentation, and auditing for the exported API of a TypeScript package", | ||
@@ -19,3 +19,3 @@ "main": "lib/index.js", | ||
"mocha": "~2.5.3", | ||
"@microsoft/node-library-build": ">=3.0.0 <4.0.0" | ||
"@microsoft/node-library-build": ">=3.0.1 <4.0.0" | ||
}, | ||
@@ -22,0 +22,0 @@ "dependencies": { |
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
678854
8342