Socket
Socket
Sign inDemoInstall

@microsoft/api-extractor

Package Overview
Dependencies
Maintainers
2
Versions
487
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/api-extractor - npm Package Compare versions

Comparing version 3.4.2 to 4.0.0

bin/api-extractor

19

CHANGELOG.json

@@ -5,2 +5,21 @@ {

{
"version": "4.0.0",
"tag": "@microsoft/api-extractor_v4.0.0",
"date": "Fri, 20 Oct 2017 01:04:44 GMT",
"comments": {
"major": [
{
"author": "pgonzal <pgonzal@users.noreply.github.com>",
"commit": "3ff332dc81aafca27952120afc1be0788239b741",
"comment": "Redesigned interface for invoking API Extractor"
}
],
"dependency": [
{
"comment": "Updating dependency \"@microsoft/node-core-library\" from `~0.3.4` to `~0.3.5`"
}
]
}
},
{
"version": "3.4.2",

@@ -7,0 +26,0 @@ "tag": "@microsoft/api-extractor_v3.4.2",

9

CHANGELOG.md
# Change Log - @microsoft/api-extractor
This log was last generated on Thu, 05 Oct 2017 01:05:02 GMT and should not be manually modified.
This log was last generated on Fri, 20 Oct 2017 01:04:44 GMT and should not be manually modified.
## 4.0.0
Fri, 20 Oct 2017 01:04:44 GMT
### Breaking changes
- Redesigned interface for invoking API Extractor
## 3.4.2

@@ -6,0 +13,0 @@ Thu, 05 Oct 2017 01:05:02 GMT

34

lib/api/ApiJsonFile.d.ts

@@ -1,30 +0,18 @@

import { AstItemKind } from '../ast/AstItem';
import { IApiPackage } from './ApiItem';
import { JsonSchema } from '@microsoft/node-core-library';
/**
* Supports the conversion between AstItems that are loaded from AstItem to JSON notation
* and vice versa.
* Support for loading the *.api.json file.
*
* @public
*/
export default class ApiJsonFile {
private static _KIND_CONSTRUCTOR;
private static _KIND_CLASS;
private static _KIND_ENUM;
private static _KIND_ENUM_VALUE;
private static _KIND_INTERFACE;
private static _KIND_FUNCTION;
private static _KIND_PACKAGE;
private static _KIND_PROPERTY;
private static _KIND_METHOD;
private static _KIND_NAMESPACE;
private static _KIND_MODULEVARIABLE;
export declare class ApiJsonFile {
/**
* Uses the lowercase string that represents 'kind' in an API JSON file, and
* converts it to an AstItemKind enum value.
* There are two cases we do not include here, (Parameter and StructuredType),
* this is intential as we do not expect to be loading these kind of JSON object
* from file.
* The JSON Schema for API Extractor's *.api.json files (api-json.schema.json).
*/
static convertJsonToKind(jsonItemKind: string): AstItemKind;
static jsonSchema: JsonSchema;
/**
* Converts the an AstItemKind into a lower-case string that is written to API JSON files.
* Loads an *.api.json data file, and validates that it conforms to the api-json.schema.json
* schema.
*/
static convertKindToJson(astItemKind: AstItemKind): string;
static loadFromFile(apiJsonFilePath: string): IApiPackage;
}

@@ -5,88 +5,29 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const AstItem_1 = require("../ast/AstItem");
const path = require("path");
const node_core_library_1 = require("@microsoft/node-core-library");
/**
* Supports the conversion between AstItems that are loaded from AstItem to JSON notation
* and vice versa.
* Support for loading the *.api.json file.
*
* @public
*/
class ApiJsonFile {
/**
* Uses the lowercase string that represents 'kind' in an API JSON file, and
* converts it to an AstItemKind enum value.
* There are two cases we do not include here, (Parameter and StructuredType),
* this is intential as we do not expect to be loading these kind of JSON object
* from file.
* Loads an *.api.json data file, and validates that it conforms to the api-json.schema.json
* schema.
*/
static convertJsonToKind(jsonItemKind) {
switch (jsonItemKind) {
case (this._KIND_CONSTRUCTOR):
return AstItem_1.AstItemKind.Constructor;
case (this._KIND_CLASS):
return AstItem_1.AstItemKind.Class;
case (this._KIND_ENUM):
return AstItem_1.AstItemKind.Enum;
case (this._KIND_ENUM_VALUE):
return AstItem_1.AstItemKind.EnumValue;
case (this._KIND_INTERFACE):
return AstItem_1.AstItemKind.Interface;
case (this._KIND_FUNCTION):
return AstItem_1.AstItemKind.Function;
case (this._KIND_PACKAGE):
return AstItem_1.AstItemKind.Package;
case (this._KIND_PROPERTY):
return AstItem_1.AstItemKind.Property;
case (this._KIND_METHOD):
return AstItem_1.AstItemKind.Method;
case (this._KIND_NAMESPACE):
return AstItem_1.AstItemKind.Namespace;
case (this._KIND_MODULEVARIABLE):
return AstItem_1.AstItemKind.ModuleVariable;
default:
throw new Error('Unsupported kind when converting JSON item kind to API item kind.');
}
static loadFromFile(apiJsonFilePath) {
return node_core_library_1.JsonFile.loadAndValidateWithCallback(apiJsonFilePath, ApiJsonFile.jsonSchema, (errorInfo) => {
const errorMessage = path.basename(apiJsonFilePath) + ' does not conform to the expected schema.\n'
+ '(Was it created by an incompatible release of API Extractor?)\n'
+ errorInfo.details;
throw new Error(errorMessage);
});
}
/**
* Converts the an AstItemKind into a lower-case string that is written to API JSON files.
*/
static convertKindToJson(astItemKind) {
switch (astItemKind) {
case (AstItem_1.AstItemKind.Constructor):
return this._KIND_CONSTRUCTOR;
case (AstItem_1.AstItemKind.Class):
return this._KIND_CLASS;
case (AstItem_1.AstItemKind.Enum):
return this._KIND_ENUM;
case (AstItem_1.AstItemKind.EnumValue):
return this._KIND_ENUM_VALUE;
case (AstItem_1.AstItemKind.Interface):
return this._KIND_INTERFACE;
case (AstItem_1.AstItemKind.Function):
return this._KIND_FUNCTION;
case (AstItem_1.AstItemKind.Package):
return this._KIND_PACKAGE;
case (AstItem_1.AstItemKind.Property):
return this._KIND_PROPERTY;
case (AstItem_1.AstItemKind.Method):
return this._KIND_METHOD;
case (AstItem_1.AstItemKind.Namespace):
return this._KIND_NAMESPACE;
case (AstItem_1.AstItemKind.ModuleVariable):
return this._KIND_MODULEVARIABLE;
default:
throw new Error('Unsupported API item kind when converting to string used in API JSON file.');
}
}
}
ApiJsonFile._KIND_CONSTRUCTOR = 'constructor';
ApiJsonFile._KIND_CLASS = 'class';
ApiJsonFile._KIND_ENUM = 'enum';
ApiJsonFile._KIND_ENUM_VALUE = 'enum value';
ApiJsonFile._KIND_INTERFACE = 'interface';
ApiJsonFile._KIND_FUNCTION = 'function';
ApiJsonFile._KIND_PACKAGE = 'package';
ApiJsonFile._KIND_PROPERTY = 'property';
ApiJsonFile._KIND_METHOD = 'method';
ApiJsonFile._KIND_NAMESPACE = 'namespace';
ApiJsonFile._KIND_MODULEVARIABLE = 'module variable';
exports.default = ApiJsonFile;
/**
* The JSON Schema for API Extractor's *.api.json files (api-json.schema.json).
*/
ApiJsonFile.jsonSchema = node_core_library_1.JsonSchema.fromFile(path.join(__dirname, './api-json.schema.json'));
exports.ApiJsonFile = ApiJsonFile;
//# sourceMappingURL=ApiJsonFile.js.map

@@ -7,40 +7,23 @@ "use strict";

// IT IS INVOKED BY THE "Run.cmd" AND "Debug.cmd" BATCH FILES.
const ts = require("typescript");
const path = require("path");
const os = require("os");
const Extractor_1 = require("./Extractor");
const ApiFileGenerator_1 = require("./generators/ApiFileGenerator");
const ApiJsonGenerator_1 = require("./generators/ApiJsonGenerator");
const ROOT_DIR = './test/inputs/example4';
const ENTRY_POINT = 'src/index.ts';
const compilerOptions = {
target: ts.ScriptTarget.ES5,
module: ts.ModuleKind.CommonJS,
moduleResolution: ts.ModuleResolutionKind.NodeJs,
experimentalDecorators: true,
jsx: ts.JsxEmit.React,
rootDir: ROOT_DIR,
types: ['webpack-env', 'es6-collections']
};
const extractor = new Extractor_1.default({
compilerOptions: compilerOptions,
errorHandler: (message, fileName, lineNumber) => {
console.log(`ErrorHandler: ${message}` + os.EOL
+ ` ${fileName}#${lineNumber}`);
const ApiExtractor_1 = require("./extractor/ApiExtractor");
const apiExtractor = new ApiExtractor_1.ApiExtractor({
compiler: {
configType: 'tsconfig',
rootFolder: '.'
},
project: {
entryPointSourceFile: 'src/index.ts',
externalJsonFileFolders: ['./testInputs/external-api-json']
},
apiReviewFile: {
enabled: true,
apiReviewFolder: __dirname
},
apiJsonFile: {
enabled: true
}
});
extractor.loadExternalPackages('./testInputs/external-api-json');
process.chdir(ROOT_DIR);
extractor.analyze({
entryPointFile: path.join(ROOT_DIR, ENTRY_POINT),
otherFiles: [
path.join(ROOT_DIR, './typings/tsd.d.ts')
]
});
const apiFileGenerator = new ApiFileGenerator_1.default();
apiFileGenerator.writeApiFile(path.join(__dirname, './DebugRun-Output.api.ts'), extractor);
const apiJsonGenerator = new ApiJsonGenerator_1.default();
apiJsonGenerator.writeJsonFile(path.join(__dirname, './DebugRun-Output.json'), extractor);
apiExtractor.analyzeProject();
console.log('DebugRun completed.');
//# sourceMappingURL=DebugRun.js.map

@@ -11,3 +11,3 @@ "use strict";

const ResolvedApiItem_1 = require("./ResolvedApiItem");
const ApiJsonGenerator_1 = require("./generators/ApiJsonGenerator");
const ApiJsonFile_1 = require("./api/ApiJsonFile");
/**

@@ -170,3 +170,3 @@ * A loader for locating the ApiItem associated with a given project and API item, or

loadPackageIntoCache(apiJsonFilePath, cachePackageName) {
const astPackage = node_core_library_1.JsonFile.loadAndValidate(apiJsonFilePath, ApiJsonGenerator_1.default.jsonSchema, {
const astPackage = node_core_library_1.JsonFile.loadAndValidate(apiJsonFilePath, ApiJsonFile_1.ApiJsonFile.jsonSchema, {
customErrorHeader: 'The API JSON file does not conform to the expected schema, and may' + os.EOL

@@ -173,0 +173,0 @@ + 'have been created by an incompatible release of API Extractor:'

/**
* ExternalApiHelper has the specific use case of generating an API json file from third party definition files.
* ExternalApiHelper has the specific use case of generating an API json file from third-party definition files.
* This class is invoked by the gulp-core-build-typescript gulpfile, where the external package names are

@@ -8,3 +8,3 @@ * hard wired.

*
* @public
* @beta
*/

@@ -11,0 +11,0 @@ export default class ExternalApiHelper {

@@ -5,10 +5,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const ts = require("typescript");
const os = require("os");
const path = require("path");
const fs = require("fs");
const Extractor_1 = require("./Extractor");
const ApiJsonGenerator_1 = require("./generators/ApiJsonGenerator");
const ApiExtractor_1 = require("./extractor/ApiExtractor");
/**
* ExternalApiHelper has the specific use case of generating an API json file from third party definition files.
* ExternalApiHelper has the specific use case of generating an API json file from third-party definition files.
* This class is invoked by the gulp-core-build-typescript gulpfile, where the external package names are

@@ -19,3 +16,3 @@ * hard wired.

*
* @public
* @beta
*/

@@ -32,18 +29,13 @@ class ExternalApiHelper {

static generateApiJson(rootDir, libFolder, externalPackageFilePath) {
const compilerOptions = {
target: ts.ScriptTarget.ES5,
module: ts.ModuleKind.CommonJS,
moduleResolution: ts.ModuleResolutionKind.NodeJs,
const entryPointFile = path.resolve(rootDir, externalPackageFilePath);
const entryPointFolder = path.dirname(entryPointFile);
const overrideTsconfig = {
target: 'es5',
module: 'commonjs',
moduleResolution: 'node',
experimentalDecorators: true,
jsx: ts.JsxEmit.React,
rootDir: rootDir
jsx: 'react',
rootDir: entryPointFolder
};
const extractor = new Extractor_1.default({
compilerOptions: compilerOptions,
errorHandler: (message, fileName, lineNumber) => {
console.log(`TypeScript error: ${message}` + os.EOL
+ ` ${fileName}#${lineNumber}`);
}
});
let outputPath = path.join(rootDir, libFolder);
let outputPath = path.resolve(rootDir, libFolder);
if (!fs.existsSync(outputPath)) {

@@ -56,11 +48,24 @@ fs.mkdirSync(outputPath);

}
const externalPackageRootDir = path.dirname(externalPackageFilePath);
const outputApiJsonFilePath = path.join(outputPath, `${path.basename(externalPackageRootDir)}.api.json`);
const entryPointFile = path.join(rootDir, externalPackageFilePath);
extractor.analyze({
entryPointFile: entryPointFile,
otherFiles: []
const apiExtractor = new ApiExtractor_1.ApiExtractor({
compiler: {
configType: 'tsconfig',
rootFolder: entryPointFolder,
overrideTsconfig: overrideTsconfig
},
project: {
entryPointSourceFile: entryPointFile
},
apiReviewFile: {
enabled: false
},
apiJsonFile: {
enabled: true,
outputFolder: outputPath
}
}, {
customLogger: {
logVerbose: (message) => { }
}
});
const apiJsonGenerator = new ApiJsonGenerator_1.default();
apiJsonGenerator.writeJsonFile(outputApiJsonFilePath, extractor);
apiExtractor.analyzeProject();
}

@@ -67,0 +72,0 @@ }

@@ -5,7 +5,5 @@ import * as ts from 'typescript';

import DocItemLoader from './DocItemLoader';
export declare type ApiErrorHandler = (message: string, fileName: string, lineNumber: number) => void;
import { ILogger } from './extractor/ILogger';
/**
* Options for Extractor constructor.
*
* @public
*/

@@ -21,11 +19,3 @@ export interface IExtractorOptions {

*/
compilerOptions: ts.CompilerOptions;
errorHandler?: ApiErrorHandler;
}
/**
* Options for Extractor.analyze()
*
* @public
*/
export interface IExtractorAnalyzeOptions {
program: ts.Program;
/**

@@ -37,9 +27,3 @@ * The entry point for the project. This should correspond to the "main" field

entryPointFile: string;
/**
* This can be used to specify other files that should be processed by the TypeScript compiler
* for some reason, e.g. a "typings/tsd.d.ts" file. It is NOT necessary to specify files that
* are explicitly imported/required by the entryPointFile, since the compiler will trace
* (the transitive closure of) ordinary dependencies.
*/
otherFiles?: string[];
logger: ILogger;
}

@@ -50,7 +34,4 @@ /**

* abstract syntax tree.
*
* @public
*/
export default class Extractor {
readonly errorHandler: ApiErrorHandler;
typeChecker: ts.TypeChecker;

@@ -64,9 +45,5 @@ package: AstPackage;

readonly packageJsonLookup: PackageJsonLookup;
private _compilerOptions;
private _packageName;
private _packageFolder;
/**
* The default implementation of ApiErrorHandler, which merely writes to console.log().
*/
static defaultErrorHandler(message: string, fileName: string, lineNumber: number): void;
private _logger;
constructor(options: IExtractorOptions);

@@ -82,6 +59,2 @@ /**

/**
* Analyzes the specified project.
*/
analyze(options: IExtractorAnalyzeOptions): void;
/**
* Reports an error message to the registered ApiErrorHandler.

@@ -88,0 +61,0 @@ */

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

Object.defineProperty(exports, "__esModule", { value: true });
const ts = require("typescript");
const fsx = require("fs-extra");

@@ -16,17 +15,24 @@ const path = require("path");

* abstract syntax tree.
*
* @public
*/
class Extractor {
/**
* The default implementation of ApiErrorHandler, which merely writes to console.log().
*/
static defaultErrorHandler(message, fileName, lineNumber) {
console.log(`ERROR: [${fileName}:${lineNumber}] ${message}`);
}
constructor(options) {
this._compilerOptions = options.compilerOptions;
this.docItemLoader = new DocItemLoader_1.default(options.compilerOptions.rootDir);
this.packageJsonLookup = new node_core_library_1.PackageJsonLookup();
this.errorHandler = options.errorHandler || Extractor.defaultErrorHandler;
this._packageFolder = this.packageJsonLookup.tryGetPackageFolder(options.entryPointFile);
this._packageName = this.packageJsonLookup.getPackageName(this._packageFolder);
this.docItemLoader = new DocItemLoader_1.default(this._packageFolder);
this._logger = options.logger;
// This runs a full type analysis, and then augments the Abstract Syntax Tree (i.e. declarations)
// with semantic information (i.e. symbols). The "diagnostics" are a subset of the everyday
// compile errors that would result from a full compilation.
for (const diagnostic of options.program.getSemanticDiagnostics()) {
this.reportError('TypeScript: ' + diagnostic.messageText, diagnostic.file, diagnostic.start);
}
this.typeChecker = options.program.getTypeChecker();
const rootFile = options.program.getSourceFile(options.entryPointFile);
if (!rootFile) {
throw new Error('Unable to load file: ' + options.entryPointFile);
}
this.package = new AstPackage_1.default(this, rootFile); // construct members
this.package.completeInitialization(); // creates ApiDocumentation
this.package.visitTypeReferencesForAstItem();
}

@@ -46,33 +52,13 @@ /**

/**
* Analyzes the specified project.
*/
analyze(options) {
const rootFiles = [options.entryPointFile].concat(options.otherFiles || []);
const program = ts.createProgram(rootFiles, this._compilerOptions);
// This runs a full type analysis, and then augments the Abstract Syntax Tree (i.e. declarations)
// with semantic information (i.e. symbols). The "diagnostics" are a subset of the everyday
// compile errors that would result from a full compilation.
for (const diagnostic of program.getSemanticDiagnostics()) {
this.reportError('TypeScript: ' + diagnostic.messageText, diagnostic.file, diagnostic.start);
}
this.typeChecker = program.getTypeChecker();
const rootFile = program.getSourceFile(options.entryPointFile);
if (!rootFile) {
throw new Error('Unable to load file: ' + options.entryPointFile);
}
// Assign _packageFolder by probing upwards from entryPointFile until we find a package.json
const currentPath = path.resolve(options.entryPointFile);
// This is guaranteed to succeed since we do check prior to this point
this._packageFolder = this.packageJsonLookup.tryGetPackageFolder(currentPath);
this._packageName = this.packageJsonLookup.getPackageName(this._packageFolder);
this.package = new AstPackage_1.default(this, rootFile); // construct members
this.package.completeInitialization(); // creates ApiDocumentation
this.package.visitTypeReferencesForAstItem();
}
/**
* Reports an error message to the registered ApiErrorHandler.
*/
reportError(message, sourceFile, start) {
const lineNumber = sourceFile.getLineAndCharacterOfPosition(start).line;
this.errorHandler(message, sourceFile.fileName, lineNumber);
const lineAndCharacter = sourceFile.getLineAndCharacterOfPosition(start);
// If the file is under the packageFolder, then show a relative path
const relativePath = path.relative(this.packageFolder, sourceFile.fileName);
const shownPath = relativePath.substr(0, 2) === '..' ? sourceFile.fileName : relativePath;
// Format the error so that VS Code can follow it. For example:
// "src\MyClass.ts(15,1): The JSDoc tag "@blah" is not supported by AEDoc"
this._logger.logError(`${shownPath}(${lineAndCharacter.line + 1},${lineAndCharacter.character + 1}): `
+ message);
}

@@ -79,0 +65,0 @@ /**

@@ -1,2 +0,1 @@

import { JsonSchema } from '@microsoft/node-core-library';
import Extractor from '../Extractor';

@@ -30,7 +29,2 @@ import AstStructuredType from '../ast/AstStructuredType';

private static _EXPORTS_KEY;
private static _jsonSchema;
/**
* The JSON schema for the *.api.json file format.
*/
static readonly jsonSchema: JsonSchema;
protected jsonOutput: Object;

@@ -37,0 +31,0 @@ writeJsonFile(reportFilename: string, extractor: Extractor): void;

@@ -13,2 +13,3 @@ "use strict";

const ReleaseTag_1 = require("../aedoc/ReleaseTag");
const ApiJsonConverter_1 = require("../api/ApiJsonConverter");
const ApiJsonFile_1 = require("../api/ApiJsonFile");

@@ -31,11 +32,2 @@ /**

}
/**
* The JSON schema for the *.api.json file format.
*/
static get jsonSchema() {
if (!ApiJsonGenerator._jsonSchema) {
ApiJsonGenerator._jsonSchema = node_core_library_1.JsonSchema.fromFile(path.join(__dirname, '../api/api-json.schema.json'));
}
return ApiJsonGenerator._jsonSchema;
}
writeJsonFile(reportFilename, extractor) {

@@ -46,3 +38,3 @@ this.visit(extractor.package, this.jsonOutput);

// Validate that the output conforms to our JSON schema
ApiJsonGenerator.jsonSchema.validateObjectWithCallback(this.jsonOutput, (errorInfo) => {
ApiJsonFile_1.ApiJsonFile.jsonSchema.validateObjectWithCallback(this.jsonOutput, (errorInfo) => {
const errorMessage = path.basename(reportFilename)

@@ -71,5 +63,5 @@ + ` does not conform to the expected schema -- please report this API Extractor bug:`

}
const kind = astStructuredType.kind === AstItem_1.AstItemKind.Class ? ApiJsonFile_1.default.convertKindToJson(AstItem_1.AstItemKind.Class) :
const kind = astStructuredType.kind === AstItem_1.AstItemKind.Class ? ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(AstItem_1.AstItemKind.Class) :
astStructuredType.kind === AstItem_1.AstItemKind.Interface ?
ApiJsonFile_1.default.convertKindToJson(AstItem_1.AstItemKind.Interface) : '';
ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(AstItem_1.AstItemKind.Interface) : '';
const structureNode = {

@@ -102,3 +94,3 @@ kind: kind,

const enumNode = {
kind: ApiJsonFile_1.default.convertKindToJson(astEnum.kind),
kind: ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(astEnum.kind),
values: valuesNode,

@@ -124,3 +116,3 @@ deprecatedMessage: astEnum.inheritedDeprecatedMessage || [],

refObject[astEnumValue.name] = {
kind: ApiJsonFile_1.default.convertKindToJson(astEnumValue.kind),
kind: ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(astEnumValue.kind),
value: value,

@@ -142,3 +134,3 @@ deprecatedMessage: astEnumValue.inheritedDeprecatedMessage || [],

const newNode = {
kind: ApiJsonFile_1.default.convertKindToJson(astFunction.kind),
kind: ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(astFunction.kind),
signature: astFunction.getDeclarationLine(),

@@ -156,3 +148,3 @@ returnValue: returnValueNode,

/* tslint:disable:no-string-literal */
refObject['kind'] = ApiJsonFile_1.default.convertKindToJson(astPackage.kind);
refObject['kind'] = ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(astPackage.kind);
refObject['name'] = astPackage.name;

@@ -177,3 +169,3 @@ refObject['summary'] = astPackage.documentation.summary;

const newNode = {
kind: ApiJsonFile_1.default.convertKindToJson(astNamespace.kind),
kind: ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(astNamespace.kind),
deprecatedMessage: astNamespace.inheritedDeprecatedMessage || [],

@@ -201,3 +193,3 @@ summary: astNamespace.documentation.summary || [],

const newNode = {
kind: ApiJsonFile_1.default.convertKindToJson(astProperty.kind),
kind: ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(astProperty.kind),
signature: astProperty.getDeclarationLine(),

@@ -217,3 +209,3 @@ isOptional: !!astProperty.isOptional,

const newNode = {
kind: ApiJsonFile_1.default.convertKindToJson(astModuleVariable.kind),
kind: ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(astModuleVariable.kind),
signature: astModuleVariable.getDeclarationLine(),

@@ -236,3 +228,3 @@ type: astModuleVariable.type,

newNode = {
kind: ApiJsonFile_1.default.convertKindToJson(AstItem_1.AstItemKind.Constructor),
kind: ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(AstItem_1.AstItemKind.Constructor),
signature: astMethod.getDeclarationLine(),

@@ -251,3 +243,3 @@ parameters: this._createParameters(astMethod),

newNode = {
kind: ApiJsonFile_1.default.convertKindToJson(astMethod.kind),
kind: ApiJsonConverter_1.ApiJsonConverter.convertKindToJson(astMethod.kind),
signature: astMethod.getDeclarationLine(),

@@ -292,5 +284,4 @@ accessModifier: astMethod.accessModifier ? AstMember_1.ApiAccessModifier[astMethod.accessModifier].toLowerCase() : '',

ApiJsonGenerator._EXPORTS_KEY = 'exports';
ApiJsonGenerator._jsonSchema = undefined;
exports.default = ApiJsonGenerator;
//# sourceMappingURL=ApiJsonGenerator.js.map

@@ -1,7 +0,8 @@

export { default as Extractor, IExtractorOptions, IExtractorAnalyzeOptions, ApiErrorHandler } from './Extractor';
export { default as ApiFileGenerator } from './generators/ApiFileGenerator';
export { default as ApiJsonGenerator } from './generators/ApiJsonGenerator';
export { default as ExternalApiHelper } from './ExternalApiHelper';
export { ApiExtractor, IAnalyzeProjectOptions, IExtractorOptions } from './extractor/ApiExtractor';
export { IExtractorTsconfigCompilerConfig, IExtractorRuntimeCompilerConfig, IExtractorProjectConfig, IExtractorApiReviewFileConfig, IExtractorApiJsonFileConfig, IExtractorConfig } from './extractor/IExtractorConfig';
export { ILogger } from './extractor/ILogger';
export * from './api/ApiItem';
export { ApiJsonFile } from './api/ApiJsonFile';
export * from './markup/MarkupElement';
export * from './markup/OldMarkup';

@@ -5,11 +5,9 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var Extractor_1 = require("./Extractor");
exports.Extractor = Extractor_1.default;
var ApiFileGenerator_1 = require("./generators/ApiFileGenerator");
exports.ApiFileGenerator = ApiFileGenerator_1.default;
var ApiJsonGenerator_1 = require("./generators/ApiJsonGenerator");
exports.ApiJsonGenerator = ApiJsonGenerator_1.default;
var ExternalApiHelper_1 = require("./ExternalApiHelper");
exports.ExternalApiHelper = ExternalApiHelper_1.default;
var ApiExtractor_1 = require("./extractor/ApiExtractor");
exports.ApiExtractor = ApiExtractor_1.ApiExtractor;
var ApiJsonFile_1 = require("./api/ApiJsonFile");
exports.ApiJsonFile = ApiJsonFile_1.ApiJsonFile;
//# sourceMappingURL=index.js.map

@@ -6,3 +6,3 @@ "use strict";

const ReleaseTag_1 = require("./aedoc/ReleaseTag");
const ApiJsonFile_1 = require("./api/ApiJsonFile");
const ApiJsonConverter_1 = require("./api/ApiJsonConverter");
/**

@@ -39,3 +39,3 @@ * A class to abstract away the difference between an item from our public API that could be

}
return new ResolvedApiItem(ApiJsonFile_1.default.convertJsonToKind(docItem.kind), docItem.summary, docItem.remarks, docItem.deprecatedMessage, docItem.isBeta, parameters, returnsMessage, ReleaseTag_1.ReleaseTag.Public, undefined);
return new ResolvedApiItem(ApiJsonConverter_1.ApiJsonConverter.convertJsonToKind(docItem.kind), docItem.summary, docItem.remarks, docItem.deprecatedMessage, docItem.isBeta, parameters, returnsMessage, ReleaseTag_1.ReleaseTag.Public, undefined);
}

@@ -42,0 +42,0 @@ constructor(kind, summary, remarks, deprecatedMessage, isBeta, params, returnsMessage, releaseTag, astItem) {

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

@@ -30,8 +30,11 @@ "keywords": [

"dependencies": {
"@microsoft/node-core-library": "~0.3.3",
"@microsoft/node-core-library": "~0.3.5",
"@microsoft/ts-command-line": "~2.1.0",
"@types/fs-extra": "0.0.37",
"@types/node": "6.0.88",
"@types/z-schema": "3.16.31",
"colors": "~1.1.2",
"fs-extra": "~0.26.7",
"jju": "~1.3.0",
"lodash": "~4.15.0",
"typescript": "~2.4.1",

@@ -42,2 +45,4 @@ "z-schema": "~3.18.3"

"@types/chai": "3.4.34",
"@types/colors": "1.1.3",
"@types/lodash": "4.14.74",
"@types/mocha": "2.2.38",

@@ -44,0 +49,0 @@ "chai": "~3.5.0",

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

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc