Socket
Socket
Sign inDemoInstall

@microsoft/api-extractor

Package Overview
Dependencies
8
Maintainers
2
Versions
478
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.7 to 2.0.8

lib/example1-output.api.ts

12

CHANGELOG.json

@@ -5,2 +5,14 @@ {

{
"version": "2.0.8",
"tag": "@microsoft/api-extractor_v2.0.8",
"date": "Wed, 14 Jun 2017 13:03:40 GMT",
"comments": {
"patch": [
{
"comment": "Definitions marked as @beta are now included in the *.api.json files for documentation"
}
]
}
},
{
"version": "2.0.7",

@@ -7,0 +19,0 @@ "tag": "@microsoft/api-extractor_v2.0.7",

9

CHANGELOG.md
# Change Log - @microsoft/api-extractor
This log was last generated on Thu, 08 Jun 2017 05:15:52 GMT and should not be manually modified.
This log was last generated on Wed, 14 Jun 2017 13:03:40 GMT and should not be manually modified.
## 2.0.8
Wed, 14 Jun 2017 13:03:40 GMT
### Patches
- Definitions marked as @beta are now included in the *.api.json files for documentation
## 2.0.7

@@ -6,0 +13,0 @@ Thu, 08 Jun 2017 05:15:52 GMT

2

lib/ApiItemVisitor.d.ts

@@ -13,3 +13,2 @@ import ApiPackage from './definitions/ApiPackage';

import ApiModuleVariable from './definitions/ApiModuleVariable';
import { ApiTag } from './definitions/ApiDocumentation';
/**

@@ -20,3 +19,2 @@ * This is a helper class that provides a standard way to walk the ApiItem

declare abstract class ApiItemVisitor {
protected apiTagsToSkip: ApiTag[];
protected visit(apiItem: ApiItem, refObject?: Object): void;

@@ -23,0 +21,0 @@ protected abstract visitApiStructuredType(apiStructuredType: ApiStructuredType, refObject?: Object): void;

@@ -20,5 +20,2 @@ "use strict";

ApiItemVisitor.prototype.visit = function (apiItem, refObject) {
if (this.apiTagsToSkip && this.apiTagsToSkip.indexOf(apiItem.documentation.apiTag) >= 0) {
return;
}
if (apiItem instanceof ApiStructuredType_1.default) {

@@ -25,0 +22,0 @@ this.visitApiStructuredType(apiItem, refObject);

@@ -32,3 +32,3 @@ // WARNING: Unable to find a documentation file ("es6-collections.api.json") for the referenced package

// @beta (undocumented)
public betaTagmissingParam: string;
public betaTagMissingParam: string;
public fieldWithBadTag: string;

@@ -35,0 +35,0 @@ // @deprecated

@@ -156,2 +156,13 @@ {

},
"betaTagMissingParam": {
"kind": "property",
"isOptional": false,
"isReadOnly": false,
"isStatic": false,
"type": "string",
"deprecatedMessage": [],
"summary": [],
"remarks": [],
"isBeta": true
},
"fieldWithBadTag": {

@@ -288,3 +299,3 @@ "kind": "property",

"returnValue": {
"type": "{ \r\n name: string, \r\n obj: MyDocumentedClass \r\n }",
"type": "{\r\n name: string,\r\n obj: MyDocumentedClass\r\n }",
"description": [

@@ -291,0 +302,0 @@ {

@@ -6,2 +6,3 @@ import Extractor from '../Extractor';

import ApiFunction from '../definitions/ApiFunction';
import ApiItem from '../definitions/ApiItem';
import ApiItemVisitor from '../ApiItemVisitor';

@@ -15,3 +16,2 @@ import ApiPackage from '../definitions/ApiPackage';

import ApiMethod from '../definitions/ApiMethod';
import { ApiTag } from '../definitions/ApiDocumentation';
/**

@@ -30,4 +30,4 @@ * For a library such as "example-package", ApiFileGenerator generates the "example-package.api.ts"

private static _EXPORTS_KEY;
protected apiTagsToSkip: ApiTag[];
protected jsonOutput: Object;
protected visit(apiItem: ApiItem, refObject?: Object): void;
writeJsonFile(reportFilename: string, extractor: Extractor): void;

@@ -34,0 +34,0 @@ protected visitApiStructuredType(apiStructuredType: ApiStructuredType, refObject?: Object): void;

@@ -35,11 +35,17 @@ "use strict";

var _this = _super !== null && _super.apply(this, arguments) || this;
// Only allow @public
_this.apiTagsToSkip = [
ApiDocumentation_1.ApiTag.Alpha,
ApiDocumentation_1.ApiTag.Beta,
ApiDocumentation_1.ApiTag.Internal
];
_this.jsonOutput = {};
return _this;
}
// @override
ApiJsonGenerator.prototype.visit = function (apiItem, refObject) {
switch (apiItem.documentation.apiTag) {
case ApiDocumentation_1.ApiTag.None:
case ApiDocumentation_1.ApiTag.Beta:
case ApiDocumentation_1.ApiTag.Public:
break;
default:
return; // skip @alpha and @internal definitions
}
_super.prototype.visit.call(this, apiItem, refObject);
};
ApiJsonGenerator.prototype.writeJsonFile = function (reportFilename, extractor) {

@@ -46,0 +52,0 @@ this.visit(extractor.package, this.jsonOutput);

@@ -27,4 +27,4 @@ /// <reference types="mocha" />

var inputFolder = './testInputs/example1';
var outputFile = './lib/example1-output.ts';
var expectedFile = path.join(inputFolder, 'example1-output.ts');
var outputFile = './lib/example1-output.api.ts';
var expectedFile = path.join(inputFolder, 'example1-output.api.ts');
var compilerOptions = {

@@ -31,0 +31,0 @@ target: ts.ScriptTarget.ES5,

@@ -18,2 +18,25 @@ /// <reference types="mocha" />

it('Example 1', function () {
var inputFolder = './testInputs/example1';
var outputFile = './lib/example1-output.json';
var expectedFile = path.join(inputFolder, 'example1-output.json');
var compilerOptions = {
target: ts.ScriptTarget.ES5,
module: ts.ModuleKind.CommonJS,
moduleResolution: ts.ModuleResolutionKind.NodeJs,
rootDir: inputFolder,
typeRoots: ['./'] // We need to ignore @types in these tests
};
var extractor = new Extractor_1.default({
compilerOptions: compilerOptions,
errorHandler: testErrorHandler
});
extractor.loadExternalPackages('./testInputs/external-api-json');
extractor.analyze({
entryPointFile: path.join(inputFolder, 'index.ts')
});
var apiJsonGenerator = new ApiJsonGenerator_1.default();
apiJsonGenerator.writeJsonFile(outputFile, extractor);
TestFileComparer_1.default.assertFileMatchesExpected(outputFile, expectedFile);
});
it('Example 2', function () {
var inputFolder = './testInputs/example2';

@@ -20,0 +43,0 @@ var outputFile = './lib/example2-output.json';

{
"name": "@microsoft/api-extractor",
"version": "2.0.7",
"version": "2.0.8",
"description": "Validate, document, and review the exported API for a TypeScript library",

@@ -5,0 +5,0 @@ "keywords": [

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc