Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/api-extractor

Package Overview
Dependencies
Maintainers
2
Versions
489
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 7.40.6 to 7.41.0

8

dist/rollup.d.ts

@@ -63,3 +63,3 @@ /**

*/
export declare const enum ConsoleMessageId {
export declare enum ConsoleMessageId {
/**

@@ -327,3 +327,3 @@ * "Analysis will use the bundled TypeScript version ___"

*/
export declare const enum ExtractorLogLevel {
export declare enum ExtractorLogLevel {
/**

@@ -450,3 +450,3 @@ * The message will be displayed as an error.

*/
export declare const enum ExtractorMessageCategory {
export declare enum ExtractorMessageCategory {
/**

@@ -497,3 +497,3 @@ * Messages originating from the TypeScript compiler.

*/
export declare const enum ExtractorMessageId {
export declare enum ExtractorMessageId {
/**

@@ -500,0 +500,0 @@ * "The doc comment should not contain more than one release tag."

@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.

"packageName": "@microsoft/api-extractor",
"packageVersion": "7.39.1"
"packageVersion": "7.40.6"
}
]
}

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

const ts = __importStar(require("typescript"));
const ExtractorMessageId_1 = require("../api/ExtractorMessageId");
class PackageDocComment {

@@ -73,3 +74,3 @@ /**

if (/\@packageDocumentation/i.test(commentBody)) {
collector.messageRouter.addAnalyzerIssueForPosition("ae-misplaced-package-tag" /* ExtractorMessageId.MisplacedPackageTag */, 'The @packageDocumentation comment must appear at the top of entry point *.d.ts file', sourceFile, commentRange.pos);
collector.messageRouter.addAnalyzerIssueForPosition(ExtractorMessageId_1.ExtractorMessageId.MisplacedPackageTag, 'The @packageDocumentation comment must appear at the top of entry point *.d.ts file', sourceFile, commentRange.pos);
break;

@@ -76,0 +77,0 @@ }

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

const Extractor_1 = require("../api/Extractor");
const ConsoleMessageId_1 = require("../api/ConsoleMessageId");
/**

@@ -143,3 +144,3 @@ * Represents analyzed information for a package.json file.

if (node_core_library_1.FileSystem.exists(tsdocMetadataPath)) {
this._messageRouter.logVerbose("console-found-tsdoc-metadata" /* ConsoleMessageId.FoundTSDocMetadata */, 'Found metadata in ' + tsdocMetadataPath);
this._messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.FoundTSDocMetadata, 'Found metadata in ' + tsdocMetadataPath);
// If the file exists at all, assume it was written by API Extractor

@@ -146,0 +147,0 @@ aedocSupported = true;

@@ -11,3 +11,3 @@ /**

*/
export declare const enum ConsoleMessageId {
export declare enum ConsoleMessageId {
/**

@@ -14,0 +14,0 @@ * "Analysis will use the bundled TypeScript version ___"

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.ConsoleMessageId = void 0;
/**
* Unique identifiers for console messages reported by API Extractor.
*
* @remarks
*
* These strings are possible values for the {@link ExtractorMessage.messageId} property
* when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Console}.
*
* @public
*/
var ConsoleMessageId;
(function (ConsoleMessageId) {
/**
* "Analysis will use the bundled TypeScript version ___"
*/
ConsoleMessageId["Preamble"] = "console-preamble";
/**
* "The target project appears to use TypeScript ___ which is newer than the bundled compiler engine;
* consider upgrading API Extractor."
*/
ConsoleMessageId["CompilerVersionNotice"] = "console-compiler-version-notice";
/**
* "Using custom TSDoc config from ___"
*/
ConsoleMessageId["UsingCustomTSDocConfig"] = "console-using-custom-tsdoc-config";
/**
* "Found metadata in ___"
*/
ConsoleMessageId["FoundTSDocMetadata"] = "console-found-tsdoc-metadata";
/**
* "Writing: ___"
*/
ConsoleMessageId["WritingDocModelFile"] = "console-writing-doc-model-file";
/**
* "Writing package typings: ___"
*/
ConsoleMessageId["WritingDtsRollup"] = "console-writing-dts-rollup";
/**
* "You have changed the public API signature for this project.
* Please copy the file ___ to ___, or perform a local build (which does this automatically).
* See the Git repo documentation for more info."
*
* OR
*
* "The API report file is missing.
* Please copy the file ___ to ___, or perform a local build (which does this automatically).
* See the Git repo documentation for more info."
*/
ConsoleMessageId["ApiReportNotCopied"] = "console-api-report-not-copied";
/**
* "You have changed the public API signature for this project. Updating ___"
*/
ConsoleMessageId["ApiReportCopied"] = "console-api-report-copied";
/**
* "The API report is up to date: ___"
*/
ConsoleMessageId["ApiReportUnchanged"] = "console-api-report-unchanged";
/**
* "The API report file was missing, so a new file was created. Please add this file to Git: ___"
*/
ConsoleMessageId["ApiReportCreated"] = "console-api-report-created";
/**
* "Unable to create the API report file. Please make sure the target folder exists: ___"
*/
ConsoleMessageId["ApiReportFolderMissing"] = "console-api-report-folder-missing";
/**
* Used for the information printed when the "--diagnostics" flag is enabled.
*/
ConsoleMessageId["Diagnostics"] = "console-diagnostics";
})(ConsoleMessageId || (exports.ConsoleMessageId = ConsoleMessageId = {}));
//# sourceMappingURL=ConsoleMessageId.js.map

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

const MessageRouter_1 = require("../collector/MessageRouter");
const ConsoleMessageId_1 = require("./ConsoleMessageId");
const tsdoc_config_1 = require("@microsoft/tsdoc-config");

@@ -118,3 +119,3 @@ const SourceMapper_1 = require("../collector/SourceMapper");

if (!node_core_library_1.Path.isEqual(extractorConfig.tsdocConfigFile.filePath, ExtractorConfig_1.ExtractorConfig._tsdocBaseFilePath)) {
messageRouter.logVerbose("console-using-custom-tsdoc-config" /* ConsoleMessageId.UsingCustomTSDocConfig */, 'Using custom TSDoc config from ' + extractorConfig.tsdocConfigFile.filePath);
messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.UsingCustomTSDocConfig, 'Using custom TSDoc config from ' + extractorConfig.tsdocConfigFile.filePath);
}

@@ -154,3 +155,3 @@ }

if (extractorConfig.docModelEnabled) {
messageRouter.logVerbose("console-writing-doc-model-file" /* ConsoleMessageId.WritingDocModelFile */, 'Writing: ' + extractorConfig.apiJsonFilePath);
messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.WritingDocModelFile, 'Writing: ' + extractorConfig.apiJsonFilePath);
apiPackage.saveToJsonFile(extractorConfig.apiJsonFilePath, {

@@ -183,3 +184,3 @@ toolPackage: Extractor.packageName,

// For a production build, issue a warning that will break the CI build.
messageRouter.logWarning("console-api-report-not-copied" /* ConsoleMessageId.ApiReportNotCopied */, 'You have changed the public API signature for this project.' +
messageRouter.logWarning(ConsoleMessageId_1.ConsoleMessageId.ApiReportNotCopied, 'You have changed the public API signature for this project.' +
` Please copy the file "${actualApiReportShortPath}" to "${expectedApiReportShortPath}",` +

@@ -191,3 +192,3 @@ ` or perform a local build (which does this automatically).` +

// For a local build, just copy the file automatically.
messageRouter.logWarning("console-api-report-copied" /* ConsoleMessageId.ApiReportCopied */, 'You have changed the public API signature for this project.' +
messageRouter.logWarning(ConsoleMessageId_1.ConsoleMessageId.ApiReportCopied, 'You have changed the public API signature for this project.' +
` Updating ${expectedApiReportShortPath}`);

@@ -201,3 +202,3 @@ node_core_library_1.FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {

else {
messageRouter.logVerbose("console-api-report-unchanged" /* ConsoleMessageId.ApiReportUnchanged */, `The API report is up to date: ${actualApiReportShortPath}`);
messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.ApiReportUnchanged, `The API report is up to date: ${actualApiReportShortPath}`);
}

@@ -214,3 +215,3 @@ }

// For a production build, issue a warning that will break the CI build.
messageRouter.logWarning("console-api-report-not-copied" /* ConsoleMessageId.ApiReportNotCopied */, 'The API report file is missing.' +
messageRouter.logWarning(ConsoleMessageId_1.ConsoleMessageId.ApiReportNotCopied, 'The API report file is missing.' +
` Please copy the file "${actualApiReportShortPath}" to "${expectedApiReportShortPath}",` +

@@ -223,3 +224,3 @@ ` or perform a local build (which does this automatically).` +

if (!node_core_library_1.FileSystem.exists(expectedApiReportFolder)) {
messageRouter.logError("console-api-report-folder-missing" /* ConsoleMessageId.ApiReportFolderMissing */, 'Unable to create the API report file. Please make sure the target folder exists:\n' +
messageRouter.logError(ConsoleMessageId_1.ConsoleMessageId.ApiReportFolderMissing, 'Unable to create the API report file. Please make sure the target folder exists:\n' +
expectedApiReportFolder);

@@ -231,3 +232,3 @@ }

});
messageRouter.logWarning("console-api-report-created" /* ConsoleMessageId.ApiReportCreated */, 'The API report file was missing, so a new file was created. Please add this file to Git:\n' +
messageRouter.logWarning(ConsoleMessageId_1.ConsoleMessageId.ApiReportCreated, 'The API report file was missing, so a new file was created. Please add this file to Git:\n' +
expectedApiReportPath);

@@ -270,3 +271,3 @@ }

static _checkCompilerCompatibility(extractorConfig, messageRouter) {
messageRouter.logInfo("console-preamble" /* ConsoleMessageId.Preamble */, `Analysis will use the bundled TypeScript version ${ts.version}`);
messageRouter.logInfo(ConsoleMessageId_1.ConsoleMessageId.Preamble, `Analysis will use the bundled TypeScript version ${ts.version}`);
try {

@@ -286,3 +287,3 @@ const typescriptPath = resolve.sync('typescript', {

if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {
messageRouter.logInfo("console-compiler-version-notice" /* ConsoleMessageId.CompilerVersionNotice */, `*** The target project appears to use TypeScript ${packageJson.version} which is newer than the` +
messageRouter.logInfo(ConsoleMessageId_1.ConsoleMessageId.CompilerVersionNotice, `*** The target project appears to use TypeScript ${packageJson.version} which is newer than the` +
` bundled compiler engine; consider upgrading API Extractor.`);

@@ -298,3 +299,3 @@ }

if (outputPath !== '') {
collector.messageRouter.logVerbose("console-writing-dts-rollup" /* ConsoleMessageId.WritingDtsRollup */, `Writing package typings: ${outputPath}`);
collector.messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.WritingDtsRollup, `Writing package typings: ${outputPath}`);
DtsRollupGenerator_1.DtsRollupGenerator.writeTypingsFile(collector, outputPath, dtsKind, newlineKind);

@@ -301,0 +302,0 @@ }

@@ -9,3 +9,3 @@ /**

*/
export declare const enum ExtractorLogLevel {
export declare enum ExtractorLogLevel {
/**

@@ -12,0 +12,0 @@ * The message will be displayed as an error.

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.ExtractorLogLevel = void 0;
/**
* Used with {@link IConfigMessageReportingRule.logLevel} and {@link IExtractorInvokeOptions.messageCallback}.
*
* @remarks
* This is part of the {@link IConfigFile} structure.
*
* @public
*/
var ExtractorLogLevel;
(function (ExtractorLogLevel) {
/**
* The message will be displayed as an error.
*
* @remarks
* Errors typically cause the build to fail and return a nonzero exit code.
*/
ExtractorLogLevel["Error"] = "error";
/**
* The message will be displayed as an warning.
*
* @remarks
* Warnings typically cause a production build fail and return a nonzero exit code. For a non-production build
* (e.g. using the `--local` option with `api-extractor run`), the warning is displayed but the build will not fail.
*/
ExtractorLogLevel["Warning"] = "warning";
/**
* The message will be displayed as an informational message.
*
* @remarks
* Informational messages may contain newlines to ensure nice formatting of the output,
* however word-wrapping is the responsibility of the message handler.
*/
ExtractorLogLevel["Info"] = "info";
/**
* The message will be displayed only when "verbose" output is requested, e.g. using the `--verbose`
* command line option.
*/
ExtractorLogLevel["Verbose"] = "verbose";
/**
* The message will be discarded entirely.
*/
ExtractorLogLevel["None"] = "none";
})(ExtractorLogLevel || (exports.ExtractorLogLevel = ExtractorLogLevel = {}));
//# sourceMappingURL=ExtractorLogLevel.js.map

@@ -25,3 +25,3 @@ import type * as tsdoc from '@microsoft/tsdoc';

*/
export declare const enum ExtractorMessageCategory {
export declare enum ExtractorMessageCategory {
/**

@@ -28,0 +28,0 @@ * Messages originating from the TypeScript compiler.

@@ -5,5 +5,46 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ExtractorMessage = void 0;
exports.ExtractorMessage = exports.ExtractorMessageCategory = void 0;
const ExtractorLogLevel_1 = require("./ExtractorLogLevel");
const SourceFileLocationFormatter_1 = require("../analyzer/SourceFileLocationFormatter");
/**
* Specifies a category of messages for use with {@link ExtractorMessage}.
* @public
*/
var ExtractorMessageCategory;
(function (ExtractorMessageCategory) {
/**
* Messages originating from the TypeScript compiler.
*
* @remarks
* These strings begin with the prefix "TS" and have a numeric error code.
* Example: `TS2551`
*/
ExtractorMessageCategory["Compiler"] = "Compiler";
/**
* Messages related to parsing of TSDoc comments.
*
* @remarks
* These strings begin with the prefix "tsdoc-".
* Example: `tsdoc-link-tag-unescaped-text`
*/
ExtractorMessageCategory["TSDoc"] = "TSDoc";
/**
* Messages related to API Extractor's analysis.
*
* @remarks
* These strings begin with the prefix "ae-".
* Example: `ae-extra-release-tag`
*/
ExtractorMessageCategory["Extractor"] = "Extractor";
/**
* Console messages communicate the progress of the overall operation. They may include newlines to ensure
* nice formatting. They are output in real time, and cannot be routed to the API Report file.
*
* @remarks
* These strings begin with the prefix "console-".
* Example: `console-writing-typings-file`
*/
ExtractorMessageCategory["Console"] = "console";
})(ExtractorMessageCategory || (exports.ExtractorMessageCategory = ExtractorMessageCategory = {}));
/**
* This object is used to report an error or warning that occurred during API Extractor's analysis.

@@ -24,3 +65,3 @@ *

this._handled = false;
this._logLevel = options.logLevel || "none" /* ExtractorLogLevel.None */;
this._logLevel = options.logLevel || ExtractorLogLevel_1.ExtractorLogLevel.None;
}

@@ -66,7 +107,7 @@ /**

switch (value) {
case "error" /* ExtractorLogLevel.Error */:
case "info" /* ExtractorLogLevel.Info */:
case "none" /* ExtractorLogLevel.None */:
case "verbose" /* ExtractorLogLevel.Verbose */:
case "warning" /* ExtractorLogLevel.Warning */:
case ExtractorLogLevel_1.ExtractorLogLevel.Error:
case ExtractorLogLevel_1.ExtractorLogLevel.Info:
case ExtractorLogLevel_1.ExtractorLogLevel.None:
case ExtractorLogLevel_1.ExtractorLogLevel.Verbose:
case ExtractorLogLevel_1.ExtractorLogLevel.Warning:
break;

@@ -73,0 +114,0 @@ default:

@@ -11,3 +11,3 @@ /**

*/
export declare const enum ExtractorMessageId {
export declare enum ExtractorMessageId {
/**

@@ -14,0 +14,0 @@ * "The doc comment should not contain more than one release tag."

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.allExtractorMessageIds = void 0;
exports.allExtractorMessageIds = exports.ExtractorMessageId = void 0;
/**
* Unique identifiers for messages reported by API Extractor during its analysis.
*
* @remarks
*
* These strings are possible values for the {@link ExtractorMessage.messageId} property
* when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Extractor}.
*
* @public
*/
var ExtractorMessageId;
(function (ExtractorMessageId) {
/**
* "The doc comment should not contain more than one release tag."
*/
ExtractorMessageId["ExtraReleaseTag"] = "ae-extra-release-tag";
/**
* "Missing documentation for ___."
* @remarks
* The `ae-undocumented` message is only generated if the API report feature is enabled.
*
* Because the API report file already annotates undocumented items with `// (undocumented)`,
* the `ae-undocumented` message is not logged by default. To see it, add a setting such as:
* ```json
* "messages": {
* "extractorMessageReporting": {
* "ae-undocumented": {
* "logLevel": "warning"
* }
* }
* }
* ```
*/
ExtractorMessageId["Undocumented"] = "ae-undocumented";
/**
* "This symbol has another declaration with a different release tag."
*/
ExtractorMessageId["DifferentReleaseTags"] = "ae-different-release-tags";
/**
* "The symbol ___ is marked as ___, but its signature references ___ which is marked as ___."
*/
ExtractorMessageId["IncompatibleReleaseTags"] = "ae-incompatible-release-tags";
/**
* "___ is part of the package's API, but it is missing a release tag (`@alpha`, `@beta`, `@public`, or `@internal`)."
*/
ExtractorMessageId["MissingReleaseTag"] = "ae-missing-release-tag";
/**
* "The `@packageDocumentation` comment must appear at the top of entry point *.d.ts file."
*/
ExtractorMessageId["MisplacedPackageTag"] = "ae-misplaced-package-tag";
/**
* "The symbol ___ needs to be exported by the entry point ___."
*/
ExtractorMessageId["ForgottenExport"] = "ae-forgotten-export";
/**
* "The name ___ should be prefixed with an underscore because the declaration is marked as `@internal`."
*/
ExtractorMessageId["InternalMissingUnderscore"] = "ae-internal-missing-underscore";
/**
* "Mixed release tags are not allowed for ___ because one of its declarations is marked as `@internal`."
*/
ExtractorMessageId["InternalMixedReleaseTag"] = "ae-internal-mixed-release-tag";
/**
* "The `@preapproved` tag cannot be applied to ___ because it is not a supported declaration type."
*/
ExtractorMessageId["PreapprovedUnsupportedType"] = "ae-preapproved-unsupported-type";
/**
* "The `@preapproved` tag cannot be applied to ___ without an `@internal` release tag."
*/
ExtractorMessageId["PreapprovedBadReleaseTag"] = "ae-preapproved-bad-release-tag";
/**
* "The `@inheritDoc` reference could not be resolved."
*/
ExtractorMessageId["UnresolvedInheritDocReference"] = "ae-unresolved-inheritdoc-reference";
/**
* "The `@inheritDoc` tag needs a TSDoc declaration reference; signature matching is not supported yet."
*
* @privateRemarks
* In the future, we will implement signature matching so that you can write `{@inheritDoc}` and API Extractor
* will find a corresponding member from a base class (or implemented interface). Until then, the tag
* always needs an explicit declaration reference such as `{@inhertDoc MyBaseClass.sameMethod}`.
*/
ExtractorMessageId["UnresolvedInheritDocBase"] = "ae-unresolved-inheritdoc-base";
/**
* "The `@inheritDoc` tag for ___ refers to its own declaration."
*/
ExtractorMessageId["CyclicInheritDoc"] = "ae-cyclic-inherit-doc";
/**
* "The `@link` reference could not be resolved."
*/
ExtractorMessageId["UnresolvedLink"] = "ae-unresolved-link";
/**
* "The doc comment for the property ___ must appear on the getter, not the setter."
*/
ExtractorMessageId["SetterWithDocs"] = "ae-setter-with-docs";
/**
* "The property ___ has a setter but no getter."
*/
ExtractorMessageId["MissingGetter"] = "ae-missing-getter";
/**
* "Incorrect file type; API Extractor expects to analyze compiler outputs with the .d.ts file extension.
* Troubleshooting tips: `https://api-extractor.com/link/dts-error`"
*/
ExtractorMessageId["WrongInputFileType"] = "ae-wrong-input-file-type";
})(ExtractorMessageId || (exports.ExtractorMessageId = ExtractorMessageId = {}));
exports.allExtractorMessageIds = new Set([

@@ -8,0 +113,0 @@ 'ae-extra-release-tag',

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

const api_extractor_model_1 = require("@microsoft/api-extractor-model");
const ExtractorMessageId_1 = require("../api/ExtractorMessageId");
const CollectorEntity_1 = require("./CollectorEntity");

@@ -151,3 +152,3 @@ const AstSymbolTable_1 = require("../analyzer/AstSymbolTable");

if (badSourceFile) {
this.messageRouter.addAnalyzerIssueForPosition("ae-wrong-input-file-type" /* ExtractorMessageId.WrongInputFileType */, 'Incorrect file type; API Extractor expects to analyze compiler outputs with the .d.ts file extension. ' +
this.messageRouter.addAnalyzerIssueForPosition(ExtractorMessageId_1.ExtractorMessageId.WrongInputFileType, 'Incorrect file type; API Extractor expects to analyze compiler outputs with the .d.ts file extension. ' +
'Troubleshooting tips: https://api-extractor.com/link/dts-error', badSourceFile, 0);

@@ -501,3 +502,3 @@ }

if (!foundGetter) {
this.messageRouter.addAnalyzerIssue("ae-missing-getter" /* ExtractorMessageId.MissingGetter */, `The property "${astDeclaration.astSymbol.localName}" has a setter but no getter.`, astDeclaration);
this.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.MissingGetter, `The property "${astDeclaration.astSymbol.localName}" has a setter but no getter.`, astDeclaration);
}

@@ -536,3 +537,3 @@ }

if (declarationMetadata.tsdocParserContext) {
this.messageRouter.addAnalyzerIssue("ae-setter-with-docs" /* ExtractorMessageId.SetterWithDocs */, `The doc comment for the property "${astDeclaration.astSymbol.localName}"` +
this.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.SetterWithDocs, `The doc comment for the property "${astDeclaration.astSymbol.localName}"` +
` must appear on the getter, not the setter.`, astDeclaration);

@@ -590,3 +591,3 @@ }

// for now, don't report errors for external code
this.messageRouter.addAnalyzerIssue("ae-extra-release-tag" /* ExtractorMessageId.ExtraReleaseTag */, 'The doc comment should not contain more than one release tag', astDeclaration);
this.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.ExtraReleaseTag, 'The doc comment should not contain more than one release tag', astDeclaration);
}

@@ -611,3 +612,3 @@ }

else {
this.messageRouter.addAnalyzerIssue("ae-preapproved-bad-release-tag" /* ExtractorMessageId.PreapprovedBadReleaseTag */, `The @preapproved tag cannot be applied to "${astDeclaration.astSymbol.localName}"` +
this.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.PreapprovedBadReleaseTag, `The @preapproved tag cannot be applied to "${astDeclaration.astSymbol.localName}"` +
` without an @internal release tag`, astDeclaration);

@@ -617,3 +618,3 @@ }

default:
this.messageRouter.addAnalyzerIssue("ae-preapproved-unsupported-type" /* ExtractorMessageId.PreapprovedUnsupportedType */, `The @preapproved tag cannot be applied to "${astDeclaration.astSymbol.localName}"` +
this.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.PreapprovedUnsupportedType, `The @preapproved tag cannot be applied to "${astDeclaration.astSymbol.localName}"` +
` because it is not a supported declaration type`, astDeclaration);

@@ -651,3 +652,3 @@ break;

if (astSymbol.rootAstSymbol.localName !== '_default') {
this.messageRouter.addAnalyzerIssue("ae-missing-release-tag" /* ExtractorMessageId.MissingReleaseTag */, `"${entity.astEntity.localName}" is part of the package's API, but it is missing ` +
this.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.MissingReleaseTag, `"${entity.astEntity.localName}" is part of the package's API, but it is missing ` +
`a release tag (@alpha, @beta, @public, or @internal)`, astSymbol);

@@ -654,0 +655,0 @@ }

@@ -35,2 +35,4 @@ "use strict";

const ExtractorMessageId_1 = require("../api/ExtractorMessageId");
const ExtractorLogLevel_1 = require("../api/ExtractorLogLevel");
const ConsoleMessageId_1 = require("../api/ConsoleMessageId");
class MessageRouter {

@@ -41,10 +43,10 @@ constructor(options) {

this._compilerDefaultRule = {
logLevel: "none" /* ExtractorLogLevel.None */,
logLevel: ExtractorLogLevel_1.ExtractorLogLevel.None,
addToApiReportFile: false
};
this._extractorDefaultRule = {
logLevel: "none" /* ExtractorLogLevel.None */,
logLevel: ExtractorLogLevel_1.ExtractorLogLevel.None,
addToApiReportFile: false
};
this._tsdocDefaultRule = { logLevel: "none" /* ExtractorLogLevel.None */, addToApiReportFile: false };
this._tsdocDefaultRule = { logLevel: ExtractorLogLevel_1.ExtractorLogLevel.None, addToApiReportFile: false };
this.errorCount = 0;

@@ -141,3 +143,3 @@ this.warningCount = 0;

const options = {
category: "Compiler" /* ExtractorMessageCategory.Compiler */,
category: ExtractorMessage_1.ExtractorMessageCategory.Compiler,
messageId: `TS${diagnostic.code}`,

@@ -182,3 +184,3 @@ text: messageText

const options = {
category: "TSDoc" /* ExtractorMessageCategory.TSDoc */,
category: ExtractorMessage_1.ExtractorMessageCategory.TSDoc,
messageId: message.messageId,

@@ -273,3 +275,3 @@ text: message.unformattedText

const options = {
category: "Extractor" /* ExtractorMessageCategory.Extractor */,
category: ExtractorMessage_1.ExtractorMessageCategory.Extractor,
messageId,

@@ -354,7 +356,7 @@ text: messageText,

this._handleMessage(new ExtractorMessage_1.ExtractorMessage({
category: "console" /* ExtractorMessageCategory.Console */,
category: ExtractorMessage_1.ExtractorMessageCategory.Console,
messageId,
text: message,
properties,
logLevel: "error" /* ExtractorLogLevel.Error */
logLevel: ExtractorLogLevel_1.ExtractorLogLevel.Error
}));

@@ -364,7 +366,7 @@ }

this._handleMessage(new ExtractorMessage_1.ExtractorMessage({
category: "console" /* ExtractorMessageCategory.Console */,
category: ExtractorMessage_1.ExtractorMessageCategory.Console,
messageId,
text: message,
properties,
logLevel: "warning" /* ExtractorLogLevel.Warning */
logLevel: ExtractorLogLevel_1.ExtractorLogLevel.Warning
}));

@@ -374,7 +376,7 @@ }

this._handleMessage(new ExtractorMessage_1.ExtractorMessage({
category: "console" /* ExtractorMessageCategory.Console */,
category: ExtractorMessage_1.ExtractorMessageCategory.Console,
messageId,
text: message,
properties,
logLevel: "info" /* ExtractorLogLevel.Info */
logLevel: ExtractorLogLevel_1.ExtractorLogLevel.Info
}));

@@ -384,7 +386,7 @@ }

this._handleMessage(new ExtractorMessage_1.ExtractorMessage({
category: "console" /* ExtractorMessageCategory.Console */,
category: ExtractorMessage_1.ExtractorMessageCategory.Console,
messageId,
text: message,
properties,
logLevel: "verbose" /* ExtractorLogLevel.Verbose */
logLevel: ExtractorLogLevel_1.ExtractorLogLevel.Verbose
}));

@@ -402,3 +404,3 @@ }

if (this.showDiagnostics) {
this.logVerbose("console-diagnostics" /* ConsoleMessageId.Diagnostics */, message);
this.logVerbose(ConsoleMessageId_1.ConsoleMessageId.Diagnostics, message);
}

@@ -415,3 +417,3 @@ }

// Assign the ExtractorMessage.logLevel; the message callback may adjust it below
if (message.category === "console" /* ExtractorMessageCategory.Console */) {
if (message.category === ExtractorMessage_1.ExtractorMessageCategory.Console) {
// Console messages have their category log level assigned via logInfo(), logVerbose(), etc.

@@ -429,6 +431,6 @@ }

switch (message.logLevel) {
case "error" /* ExtractorLogLevel.Error */:
case ExtractorLogLevel_1.ExtractorLogLevel.Error:
++this.errorCount;
break;
case "warning" /* ExtractorLogLevel.Warning */:
case ExtractorLogLevel_1.ExtractorLogLevel.Warning:
++this.warningCount;

@@ -442,7 +444,7 @@ break;

message.handled = true;
if (message.logLevel === "none" /* ExtractorLogLevel.None */) {
if (message.logLevel === ExtractorLogLevel_1.ExtractorLogLevel.None) {
return;
}
let messageText;
if (message.category === "console" /* ExtractorMessageCategory.Console */) {
if (message.category === ExtractorMessage_1.ExtractorMessageCategory.Console) {
messageText = message.text;

@@ -454,12 +456,12 @@ }

switch (message.logLevel) {
case "error" /* ExtractorLogLevel.Error */:
case ExtractorLogLevel_1.ExtractorLogLevel.Error:
console.error(terminal_1.Colorize.red('Error: ' + messageText));
break;
case "warning" /* ExtractorLogLevel.Warning */:
case ExtractorLogLevel_1.ExtractorLogLevel.Warning:
console.warn(terminal_1.Colorize.yellow('Warning: ' + messageText));
break;
case "info" /* ExtractorLogLevel.Info */:
case ExtractorLogLevel_1.ExtractorLogLevel.Info:
console.log(messageText);
break;
case "verbose" /* ExtractorLogLevel.Verbose */:
case ExtractorLogLevel_1.ExtractorLogLevel.Verbose:
if (this.showVerboseMessages) {

@@ -482,9 +484,9 @@ console.log(terminal_1.Colorize.cyan(messageText));

switch (message.category) {
case "Compiler" /* ExtractorMessageCategory.Compiler */:
case ExtractorMessage_1.ExtractorMessageCategory.Compiler:
return this._compilerDefaultRule;
case "Extractor" /* ExtractorMessageCategory.Extractor */:
case ExtractorMessage_1.ExtractorMessageCategory.Extractor:
return this._extractorDefaultRule;
case "TSDoc" /* ExtractorMessageCategory.TSDoc */:
case ExtractorMessage_1.ExtractorMessageCategory.TSDoc:
return this._tsdocDefaultRule;
case "console" /* ExtractorMessageCategory.Console */:
case ExtractorMessage_1.ExtractorMessageCategory.Console:
throw new node_core_library_1.InternalError('ExtractorMessageCategory.Console is not supported with IReportingRule');

@@ -491,0 +493,0 @@ }

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

const api_extractor_model_1 = require("@microsoft/api-extractor-model");
const ExtractorMessageId_1 = require("../api/ExtractorMessageId");
const VisitorState_1 = require("../collector/VisitorState");

@@ -63,3 +64,3 @@ const AstReferenceResolver_1 = require("../analyzer/AstReferenceResolver");

if (metadata.docCommentEnhancerVisitorState === VisitorState_1.VisitorState.Visiting) {
this._collector.messageRouter.addAnalyzerIssue("ae-cyclic-inherit-doc" /* ExtractorMessageId.CyclicInheritDoc */, `The @inheritDoc tag for "${astDeclaration.astSymbol.localName}" refers to its own declaration`, astDeclaration);
this._collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.CyclicInheritDoc, `The @inheritDoc tag for "${astDeclaration.astSymbol.localName}" refers to its own declaration`, astDeclaration);
return;

@@ -152,3 +153,3 @@ }

if (referencedAstDeclaration instanceof AstReferenceResolver_1.ResolverFailure) {
this._collector.messageRouter.addAnalyzerIssue("ae-unresolved-link" /* ExtractorMessageId.UnresolvedLink */, 'The @link reference could not be resolved: ' + referencedAstDeclaration.reason, astDeclaration);
this._collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.UnresolvedLink, 'The @link reference could not be resolved: ' + referencedAstDeclaration.reason, astDeclaration);
}

@@ -167,3 +168,3 @@ }

if (!inheritDocTag.declarationReference) {
this._collector.messageRouter.addAnalyzerIssue("ae-unresolved-inheritdoc-base" /* ExtractorMessageId.UnresolvedInheritDocBase */, 'The @inheritDoc tag needs a TSDoc declaration reference; signature matching is not supported yet', astDeclaration);
this._collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.UnresolvedInheritDocBase, 'The @inheritDoc tag needs a TSDoc declaration reference; signature matching is not supported yet', astDeclaration);
return;

@@ -181,3 +182,3 @@ }

if (referencedAstDeclaration instanceof AstReferenceResolver_1.ResolverFailure) {
this._collector.messageRouter.addAnalyzerIssue("ae-unresolved-inheritdoc-reference" /* ExtractorMessageId.UnresolvedInheritDocReference */, 'The @inheritDoc reference could not be resolved: ' + referencedAstDeclaration.reason, astDeclaration);
this._collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.UnresolvedInheritDocReference, 'The @inheritDoc reference could not be resolved: ' + referencedAstDeclaration.reason, astDeclaration);
return;

@@ -184,0 +185,0 @@ }

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

const AstSymbol_1 = require("../analyzer/AstSymbol");
const ExtractorMessageId_1 = require("../api/ExtractorMessageId");
const api_extractor_model_1 = require("@microsoft/api-extractor-model");

@@ -112,3 +113,3 @@ const AstNamespaceImport_1 = require("../analyzer/AstNamespaceImport");

if (exportName[0] !== '_') {
collector.messageRouter.addAnalyzerIssue("ae-internal-missing-underscore" /* ExtractorMessageId.InternalMissingUnderscore */, `The name "${exportName}" should be prefixed with an underscore` +
collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.InternalMissingUnderscore, `The name "${exportName}" should be prefixed with an underscore` +
` because the declaration is marked as @internal`, astSymbol, { exportName });

@@ -153,6 +154,6 @@ }

if (!onlyFunctionOverloads) {
collector.messageRouter.addAnalyzerIssue("ae-different-release-tags" /* ExtractorMessageId.DifferentReleaseTags */, 'This symbol has another declaration with a different release tag', astSymbol);
collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.DifferentReleaseTags, 'This symbol has another declaration with a different release tag', astSymbol);
}
if (anyInternalReleaseTags) {
collector.messageRouter.addAnalyzerIssue("ae-internal-mixed-release-tag" /* ExtractorMessageId.InternalMixedReleaseTag */, `Mixed release tags are not allowed for "${astSymbol.localName}" because one of its declarations` +
collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.InternalMixedReleaseTag, `Mixed release tags are not allowed for "${astSymbol.localName}" because one of its declarations` +
` is marked as @internal`, astSymbol);

@@ -194,3 +195,3 @@ }

if (api_extractor_model_1.ReleaseTag.compare(declarationReleaseTag, referencedReleaseTag) > 0) {
collector.messageRouter.addAnalyzerIssue("ae-incompatible-release-tags" /* ExtractorMessageId.IncompatibleReleaseTags */, `The symbol "${astDeclaration.astSymbol.localName}"` +
collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.IncompatibleReleaseTags, `The symbol "${astDeclaration.astSymbol.localName}"` +
` is marked as ${api_extractor_model_1.ReleaseTag.getTagName(declarationReleaseTag)},` +

@@ -211,3 +212,3 @@ ` but its signature references "${localName}"` +

else {
collector.messageRouter.addAnalyzerIssue("ae-forgotten-export" /* ExtractorMessageId.ForgottenExport */, `The symbol "${localName}" needs to be exported by the entry point ${entryPointFilename}`, astDeclaration);
collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.ForgottenExport, `The symbol "${localName}" needs to be exported by the entry point ${entryPointFilename}`, astDeclaration);
}

@@ -214,0 +215,0 @@ }

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

const SourceFileLocationFormatter_1 = require("../analyzer/SourceFileLocationFormatter");
const ExtractorMessageId_1 = require("../api/ExtractorMessageId");
class ApiReportGenerator {

@@ -434,3 +435,3 @@ /**

footerParts.push('(undocumented)');
collector.messageRouter.addAnalyzerIssue("ae-undocumented" /* ExtractorMessageId.Undocumented */, `Missing documentation for "${astDeclaration.astSymbol.localName}".`, astDeclaration);
collector.messageRouter.addAnalyzerIssue(ExtractorMessageId_1.ExtractorMessageId.Undocumented, `Missing documentation for "${astDeclaration.astSymbol.localName}".`, astDeclaration);
}

@@ -437,0 +438,0 @@ if (footerParts.length > 0) {

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.ExtractorMessage = exports.ExtractorConfig = exports.ExtractorResult = exports.Extractor = exports.CompilerState = void 0;
exports.ExtractorMessageId = exports.ExtractorMessageCategory = exports.ExtractorMessage = exports.ExtractorLogLevel = exports.ExtractorConfig = exports.ExtractorResult = exports.Extractor = exports.CompilerState = exports.ConsoleMessageId = void 0;
/**
* API Extractor helps with validation, documentation, and reviewing of the exported API for a TypeScript library.
* The `@microsoft/api-extractor` package provides the command-line tool. It also exposes a developer API that you
* can use to invoke API Extractor programmatically.
*
* @packageDocumentation
*/
var ConsoleMessageId_1 = require("./api/ConsoleMessageId");
Object.defineProperty(exports, "ConsoleMessageId", { enumerable: true, get: function () { return ConsoleMessageId_1.ConsoleMessageId; } });
var CompilerState_1 = require("./api/CompilerState");

@@ -14,4 +23,9 @@ Object.defineProperty(exports, "CompilerState", { enumerable: true, get: function () { return CompilerState_1.CompilerState; } });

Object.defineProperty(exports, "ExtractorConfig", { enumerable: true, get: function () { return ExtractorConfig_1.ExtractorConfig; } });
var ExtractorLogLevel_1 = require("./api/ExtractorLogLevel");
Object.defineProperty(exports, "ExtractorLogLevel", { enumerable: true, get: function () { return ExtractorLogLevel_1.ExtractorLogLevel; } });
var ExtractorMessage_1 = require("./api/ExtractorMessage");
Object.defineProperty(exports, "ExtractorMessage", { enumerable: true, get: function () { return ExtractorMessage_1.ExtractorMessage; } });
Object.defineProperty(exports, "ExtractorMessageCategory", { enumerable: true, get: function () { return ExtractorMessage_1.ExtractorMessageCategory; } });
var ExtractorMessageId_1 = require("./api/ExtractorMessageId");
Object.defineProperty(exports, "ExtractorMessageId", { enumerable: true, get: function () { return ExtractorMessageId_1.ExtractorMessageId; } });
//# sourceMappingURL=index.js.map
{
"name": "@microsoft/api-extractor",
"version": "7.40.6",
"version": "7.41.0",
"description": "Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups",

@@ -43,10 +43,10 @@ "keywords": [

"@microsoft/api-extractor-model": "7.28.13",
"@rushstack/terminal": "0.9.0",
"@rushstack/node-core-library": "4.0.2",
"@rushstack/rig-package": "0.5.2",
"@rushstack/ts-command-line": "4.17.3"
"@rushstack/terminal": "0.10.0",
"@rushstack/ts-command-line": "4.17.4"
},
"devDependencies": {
"@rushstack/heft-node-rig": "2.4.0",
"@rushstack/heft": "0.64.0",
"@rushstack/heft-node-rig": "2.4.16",
"@rushstack/heft": "0.65.4",
"@types/heft-jest": "1.0.1",

@@ -53,0 +53,0 @@ "@types/lodash": "4.14.116",

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

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

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