Initial commit
This commit is contained in:
47
node_modules/@microsoft/api-extractor/lib/api/CompilerState.d.ts
generated
vendored
Normal file
47
node_modules/@microsoft/api-extractor/lib/api/CompilerState.d.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { ExtractorConfig } from './ExtractorConfig';
|
||||
/**
|
||||
* Options for {@link CompilerState.create}
|
||||
* @public
|
||||
*/
|
||||
export interface ICompilerStateCreateOptions {
|
||||
/** {@inheritDoc IExtractorInvokeOptions.typescriptCompilerFolder} */
|
||||
typescriptCompilerFolder?: string;
|
||||
/**
|
||||
* Additional .d.ts files to include in the analysis.
|
||||
*/
|
||||
additionalEntryPoints?: string[];
|
||||
}
|
||||
/**
|
||||
* This class represents the TypeScript compiler state. This allows an optimization where multiple invocations
|
||||
* of API Extractor can reuse the same TypeScript compiler analysis.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export declare class CompilerState {
|
||||
/**
|
||||
* The TypeScript compiler's `Program` object, which represents a complete scope of analysis.
|
||||
*/
|
||||
readonly program: unknown;
|
||||
private constructor();
|
||||
/**
|
||||
* Create a compiler state for use with the specified `IExtractorInvokeOptions`.
|
||||
*/
|
||||
static create(extractorConfig: ExtractorConfig, options?: ICompilerStateCreateOptions): CompilerState;
|
||||
/**
|
||||
* Given a list of absolute file paths, return a list containing only the declaration
|
||||
* files. Duplicates are also eliminated.
|
||||
*
|
||||
* @remarks
|
||||
* The tsconfig.json settings specify the compiler's input (a set of *.ts source files,
|
||||
* plus some *.d.ts declaration files used for legacy typings). However API Extractor
|
||||
* analyzes the compiler's output (a set of *.d.ts entry point files, plus any legacy
|
||||
* typings). This requires API Extractor to generate a special file list when it invokes
|
||||
* the compiler.
|
||||
*
|
||||
* Duplicates are removed so that entry points can be appended without worrying whether they
|
||||
* may already appear in the tsconfig.json file list.
|
||||
*/
|
||||
private static _generateFilePathsForAnalysis;
|
||||
private static _createCompilerHost;
|
||||
}
|
||||
//# sourceMappingURL=CompilerState.d.ts.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/CompilerState.d.ts.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/CompilerState.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CompilerState.d.ts","sourceRoot":"","sources":["../../src/api/CompilerState.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC,OAAO;IAIP;;OAEG;WACW,MAAM,CAClB,eAAe,EAAE,eAAe,EAChC,OAAO,CAAC,EAAE,2BAA2B,GACpC,aAAa;IAoDhB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAuB5C,OAAO,CAAC,MAAM,CAAC,mBAAmB;CAwEnC"}
|
||||
186
node_modules/@microsoft/api-extractor/lib/api/CompilerState.js
generated
vendored
Normal file
186
node_modules/@microsoft/api-extractor/lib/api/CompilerState.js
generated
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CompilerState = void 0;
|
||||
const path = __importStar(require("node:path"));
|
||||
const ts = __importStar(require("typescript"));
|
||||
const node_core_library_1 = require("@rushstack/node-core-library");
|
||||
const terminal_1 = require("@rushstack/terminal");
|
||||
const ExtractorConfig_1 = require("./ExtractorConfig");
|
||||
/**
|
||||
* This class represents the TypeScript compiler state. This allows an optimization where multiple invocations
|
||||
* of API Extractor can reuse the same TypeScript compiler analysis.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
class CompilerState {
|
||||
constructor(properties) {
|
||||
this.program = properties.program;
|
||||
}
|
||||
/**
|
||||
* Create a compiler state for use with the specified `IExtractorInvokeOptions`.
|
||||
*/
|
||||
static create(extractorConfig, options) {
|
||||
let tsconfig = extractorConfig.overrideTsconfig;
|
||||
let configBasePath = extractorConfig.projectFolder;
|
||||
if (!tsconfig) {
|
||||
// If it wasn't overridden, then load it from disk
|
||||
tsconfig = node_core_library_1.JsonFile.load(extractorConfig.tsconfigFilePath);
|
||||
configBasePath = path.resolve(path.dirname(extractorConfig.tsconfigFilePath));
|
||||
}
|
||||
const commandLine = ts.parseJsonConfigFileContent(tsconfig, ts.sys, configBasePath);
|
||||
if (!commandLine.options.skipLibCheck && extractorConfig.skipLibCheck) {
|
||||
commandLine.options.skipLibCheck = true;
|
||||
console.log(terminal_1.Colorize.cyan('API Extractor was invoked with skipLibCheck. This is not recommended and may cause ' +
|
||||
'incorrect type analysis.'));
|
||||
}
|
||||
// Delete outDir and declarationDir to prevent TypeScript from redirecting self-package
|
||||
// imports to source files. When these options are set, TypeScript's module resolution
|
||||
// tries to map output .d.ts files back to their source .ts files to avoid analyzing
|
||||
// build outputs during compilation. However, API Extractor specifically wants to analyze
|
||||
// the .d.ts build artifacts, not the source files. Since API Extractor doesn't emit any
|
||||
// files, these options are unnecessary and interfere with correct module resolution.
|
||||
delete commandLine.options.outDir;
|
||||
delete commandLine.options.declarationDir;
|
||||
const inputFilePaths = commandLine.fileNames.concat(extractorConfig.mainEntryPointFilePath);
|
||||
if (options && options.additionalEntryPoints) {
|
||||
inputFilePaths.push(...options.additionalEntryPoints);
|
||||
}
|
||||
// Append the entry points and remove any non-declaration files from the list
|
||||
const analysisFilePaths = CompilerState._generateFilePathsForAnalysis(inputFilePaths);
|
||||
const compilerHost = CompilerState._createCompilerHost(commandLine, options);
|
||||
const program = ts.createProgram(analysisFilePaths, commandLine.options, compilerHost);
|
||||
if (commandLine.errors.length > 0) {
|
||||
const errorText = ts.flattenDiagnosticMessageText(commandLine.errors[0].messageText, '\n');
|
||||
throw new Error(`Error parsing tsconfig.json content: ${errorText}`);
|
||||
}
|
||||
return new CompilerState({
|
||||
program
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Given a list of absolute file paths, return a list containing only the declaration
|
||||
* files. Duplicates are also eliminated.
|
||||
*
|
||||
* @remarks
|
||||
* The tsconfig.json settings specify the compiler's input (a set of *.ts source files,
|
||||
* plus some *.d.ts declaration files used for legacy typings). However API Extractor
|
||||
* analyzes the compiler's output (a set of *.d.ts entry point files, plus any legacy
|
||||
* typings). This requires API Extractor to generate a special file list when it invokes
|
||||
* the compiler.
|
||||
*
|
||||
* Duplicates are removed so that entry points can be appended without worrying whether they
|
||||
* may already appear in the tsconfig.json file list.
|
||||
*/
|
||||
static _generateFilePathsForAnalysis(inputFilePaths) {
|
||||
const analysisFilePaths = [];
|
||||
const seenFiles = new Set();
|
||||
for (const inputFilePath of inputFilePaths) {
|
||||
const inputFileToUpper = inputFilePath.toUpperCase();
|
||||
if (!seenFiles.has(inputFileToUpper)) {
|
||||
seenFiles.add(inputFileToUpper);
|
||||
if (!path.isAbsolute(inputFilePath)) {
|
||||
throw new Error('Input file is not an absolute path: ' + inputFilePath);
|
||||
}
|
||||
if (ExtractorConfig_1.ExtractorConfig.hasDtsFileExtension(inputFilePath)) {
|
||||
analysisFilePaths.push(inputFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
return analysisFilePaths;
|
||||
}
|
||||
static _createCompilerHost(commandLine, options) {
|
||||
// Create a default CompilerHost that we will override
|
||||
const compilerHost = ts.createCompilerHost(commandLine.options);
|
||||
// Save a copy of the original members. Note that "compilerHost" cannot be the copy, because
|
||||
// createCompilerHost() captures that instance in a closure that is used by the members.
|
||||
const defaultCompilerHost = { ...compilerHost };
|
||||
if (options && options.typescriptCompilerFolder) {
|
||||
// Prevent a closure parameter
|
||||
const typescriptCompilerLibFolder = path.join(options.typescriptCompilerFolder, 'lib');
|
||||
compilerHost.getDefaultLibLocation = () => typescriptCompilerLibFolder;
|
||||
}
|
||||
// Used by compilerHost.fileExists()
|
||||
// .d.ts file path --> whether the file exists
|
||||
const dtsExistsCache = new Map();
|
||||
// Used by compilerHost.fileExists()
|
||||
// Example: "c:/folder/file.part.ts"
|
||||
const fileExtensionRegExp = /^(.+)(\.[a-z0-9_]+)$/i;
|
||||
compilerHost.fileExists = (fileName) => {
|
||||
// In certain deprecated setups, the compiler may write its output files (.js and .d.ts)
|
||||
// in the same folder as the corresponding input file (.ts or .tsx). When following imports,
|
||||
// API Extractor wants to analyze the .d.ts file; however recent versions of the compiler engine
|
||||
// will instead choose the .ts file. To work around this, we hook fileExists() to hide the
|
||||
// existence of those files.
|
||||
// Is "fileName" a .d.ts file? The double extension ".d.ts" needs to be matched specially.
|
||||
if (!ExtractorConfig_1.ExtractorConfig.hasDtsFileExtension(fileName)) {
|
||||
// It's not a .d.ts file. Is the file extension a potential source file?
|
||||
const match = fileExtensionRegExp.exec(fileName);
|
||||
if (match) {
|
||||
// Example: "c:/folder/file.part"
|
||||
const pathWithoutExtension = match[1];
|
||||
// Example: ".ts"
|
||||
const fileExtension = match[2];
|
||||
switch (fileExtension.toLocaleLowerCase()) {
|
||||
case '.ts':
|
||||
case '.tsx':
|
||||
case '.js':
|
||||
case '.jsx':
|
||||
// Yes, this is a possible source file. Is there a corresponding .d.ts file in the same folder?
|
||||
const dtsFileName = `${pathWithoutExtension}.d.ts`;
|
||||
let dtsFileExists = dtsExistsCache.get(dtsFileName);
|
||||
if (dtsFileExists === undefined) {
|
||||
dtsFileExists = defaultCompilerHost.fileExists(dtsFileName);
|
||||
dtsExistsCache.set(dtsFileName, dtsFileExists);
|
||||
}
|
||||
if (dtsFileExists) {
|
||||
// fileName is a potential source file and a corresponding .d.ts file exists.
|
||||
// Thus, API Extractor should ignore this file (so the .d.ts file will get analyzed instead).
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fall through to the default implementation
|
||||
return defaultCompilerHost.fileExists(fileName);
|
||||
};
|
||||
return compilerHost;
|
||||
}
|
||||
}
|
||||
exports.CompilerState = CompilerState;
|
||||
//# sourceMappingURL=CompilerState.js.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/CompilerState.js.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/CompilerState.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
79
node_modules/@microsoft/api-extractor/lib/api/ConsoleMessageId.d.ts
generated
vendored
Normal file
79
node_modules/@microsoft/api-extractor/lib/api/ConsoleMessageId.d.ts
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
export declare enum ConsoleMessageId {
|
||||
/**
|
||||
* "Analysis will use the bundled TypeScript version ___"
|
||||
*/
|
||||
Preamble = "console-preamble",
|
||||
/**
|
||||
* "The target project appears to use TypeScript ___ which is newer than the bundled compiler engine;
|
||||
* consider upgrading API Extractor."
|
||||
*/
|
||||
CompilerVersionNotice = "console-compiler-version-notice",
|
||||
/**
|
||||
* "Using custom TSDoc config from ___"
|
||||
*/
|
||||
UsingCustomTSDocConfig = "console-using-custom-tsdoc-config",
|
||||
/**
|
||||
* "Found metadata in ___"
|
||||
*/
|
||||
FoundTSDocMetadata = "console-found-tsdoc-metadata",
|
||||
/**
|
||||
* "Writing: ___"
|
||||
*/
|
||||
WritingDocModelFile = "console-writing-doc-model-file",
|
||||
/**
|
||||
* "Writing package typings: ___"
|
||||
*/
|
||||
WritingDtsRollup = "console-writing-dts-rollup",
|
||||
/**
|
||||
* "Generating ___ API report: ___"
|
||||
*/
|
||||
WritingApiReport = "console-writing-api-report",
|
||||
/**
|
||||
* "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."
|
||||
*/
|
||||
ApiReportNotCopied = "console-api-report-not-copied",
|
||||
/**
|
||||
* Changes to the API report:
|
||||
* ___
|
||||
*/
|
||||
ApiReportDiff = "console-api-report-diff",
|
||||
/**
|
||||
* "You have changed the public API signature for this project. Updating ___"
|
||||
*/
|
||||
ApiReportCopied = "console-api-report-copied",
|
||||
/**
|
||||
* "The API report is up to date: ___"
|
||||
*/
|
||||
ApiReportUnchanged = "console-api-report-unchanged",
|
||||
/**
|
||||
* "The API report file was missing, so a new file was created. Please add this file to Git: ___"
|
||||
*/
|
||||
ApiReportCreated = "console-api-report-created",
|
||||
/**
|
||||
* "Unable to create the API report file. Please make sure the target folder exists: ___"
|
||||
*/
|
||||
ApiReportFolderMissing = "console-api-report-folder-missing",
|
||||
/**
|
||||
* Used for the information printed when the "--diagnostics" flag is enabled.
|
||||
*/
|
||||
Diagnostics = "console-diagnostics"
|
||||
}
|
||||
//# sourceMappingURL=ConsoleMessageId.d.ts.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ConsoleMessageId.d.ts.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ConsoleMessageId.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ConsoleMessageId.d.ts","sourceRoot":"","sources":["../../src/api/ConsoleMessageId.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,oBAAY,gBAAgB;IAC1B;;OAEG;IACH,QAAQ,qBAAqB;IAE7B;;;OAGG;IACH,qBAAqB,oCAAoC;IAEzD;;OAEG;IACH,sBAAsB,sCAAsC;IAE5D;;OAEG;IACH,kBAAkB,iCAAiC;IAEnD;;OAEG;IACH,mBAAmB,mCAAmC;IAEtD;;OAEG;IACH,gBAAgB,+BAA+B;IAE/C;;OAEG;IACH,gBAAgB,+BAA+B;IAE/C;;;;;;;;;;OAUG;IACH,kBAAkB,kCAAkC;IAEpD;;;OAGG;IACH,aAAa,4BAA4B;IAEzC;;OAEG;IACH,eAAe,8BAA8B;IAE7C;;OAEG;IACH,kBAAkB,iCAAiC;IAEnD;;OAEG;IACH,gBAAgB,+BAA+B;IAE/C;;OAEG;IACH,sBAAsB,sCAAsC;IAE5D;;OAEG;IACH,WAAW,wBAAwB;CACpC"}
|
||||
85
node_modules/@microsoft/api-extractor/lib/api/ConsoleMessageId.js
generated
vendored
Normal file
85
node_modules/@microsoft/api-extractor/lib/api/ConsoleMessageId.js
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
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";
|
||||
/**
|
||||
* "Generating ___ API report: ___"
|
||||
*/
|
||||
ConsoleMessageId["WritingApiReport"] = "console-writing-api-report";
|
||||
/**
|
||||
* "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";
|
||||
/**
|
||||
* Changes to the API report:
|
||||
* ___
|
||||
*/
|
||||
ConsoleMessageId["ApiReportDiff"] = "console-api-report-diff";
|
||||
/**
|
||||
* "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
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ConsoleMessageId.js.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ConsoleMessageId.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ConsoleMessageId.js","sourceRoot":"","sources":["../../src/api/ConsoleMessageId.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;;;GASG;AACH,IAAY,gBAgFX;AAhFD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,iDAA6B,CAAA;IAE7B;;;OAGG;IACH,6EAAyD,CAAA;IAEzD;;OAEG;IACH,gFAA4D,CAAA;IAE5D;;OAEG;IACH,uEAAmD,CAAA;IAEnD;;OAEG;IACH,0EAAsD,CAAA;IAEtD;;OAEG;IACH,mEAA+C,CAAA;IAE/C;;OAEG;IACH,mEAA+C,CAAA;IAE/C;;;;;;;;;;OAUG;IACH,wEAAoD,CAAA;IAEpD;;;OAGG;IACH,6DAAyC,CAAA;IAEzC;;OAEG;IACH,iEAA6C,CAAA;IAE7C;;OAEG;IACH,uEAAmD,CAAA;IAEnD;;OAEG;IACH,mEAA+C,CAAA;IAE/C;;OAEG;IACH,gFAA4D,CAAA;IAE5D;;OAEG;IACH,uDAAmC,CAAA;AACrC,CAAC,EAhFW,gBAAgB,gCAAhB,gBAAgB,QAgF3B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * Unique identifiers for console messages reported by API Extractor.\n *\n * @remarks\n *\n * These strings are possible values for the {@link ExtractorMessage.messageId} property\n * when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Console}.\n *\n * @public\n */\nexport enum ConsoleMessageId {\n /**\n * \"Analysis will use the bundled TypeScript version ___\"\n */\n Preamble = 'console-preamble',\n\n /**\n * \"The target project appears to use TypeScript ___ which is newer than the bundled compiler engine;\n * consider upgrading API Extractor.\"\n */\n CompilerVersionNotice = 'console-compiler-version-notice',\n\n /**\n * \"Using custom TSDoc config from ___\"\n */\n UsingCustomTSDocConfig = 'console-using-custom-tsdoc-config',\n\n /**\n * \"Found metadata in ___\"\n */\n FoundTSDocMetadata = 'console-found-tsdoc-metadata',\n\n /**\n * \"Writing: ___\"\n */\n WritingDocModelFile = 'console-writing-doc-model-file',\n\n /**\n * \"Writing package typings: ___\"\n */\n WritingDtsRollup = 'console-writing-dts-rollup',\n\n /**\n * \"Generating ___ API report: ___\"\n */\n WritingApiReport = 'console-writing-api-report',\n\n /**\n * \"You have changed the public API signature for this project.\n * Please copy the file ___ to ___, or perform a local build (which does this automatically).\n * See the Git repo documentation for more info.\"\n *\n * OR\n *\n * \"The API report file is missing.\n * Please copy the file ___ to ___, or perform a local build (which does this automatically).\n * See the Git repo documentation for more info.\"\n */\n ApiReportNotCopied = 'console-api-report-not-copied',\n\n /**\n * Changes to the API report:\n * ___\n */\n ApiReportDiff = 'console-api-report-diff',\n\n /**\n * \"You have changed the public API signature for this project. Updating ___\"\n */\n ApiReportCopied = 'console-api-report-copied',\n\n /**\n * \"The API report is up to date: ___\"\n */\n ApiReportUnchanged = 'console-api-report-unchanged',\n\n /**\n * \"The API report file was missing, so a new file was created. Please add this file to Git: ___\"\n */\n ApiReportCreated = 'console-api-report-created',\n\n /**\n * \"Unable to create the API report file. Please make sure the target folder exists: ___\"\n */\n ApiReportFolderMissing = 'console-api-report-folder-missing',\n\n /**\n * Used for the information printed when the \"--diagnostics\" flag is enabled.\n */\n Diagnostics = 'console-diagnostics'\n}\n"]}
|
||||
152
node_modules/@microsoft/api-extractor/lib/api/Extractor.d.ts
generated
vendored
Normal file
152
node_modules/@microsoft/api-extractor/lib/api/Extractor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
import { ExtractorConfig } from './ExtractorConfig';
|
||||
import { CompilerState } from './CompilerState';
|
||||
import type { ExtractorMessage } from './ExtractorMessage';
|
||||
/**
|
||||
* Runtime options for Extractor.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IExtractorInvokeOptions {
|
||||
/**
|
||||
* An optional TypeScript compiler state. This allows an optimization where multiple invocations of API Extractor
|
||||
* can reuse the same TypeScript compiler analysis.
|
||||
*/
|
||||
compilerState?: CompilerState;
|
||||
/**
|
||||
* Indicates that API Extractor is running as part of a local build, e.g. on developer's
|
||||
* machine.
|
||||
*
|
||||
* @remarks
|
||||
* This disables certain validation that would normally be performed for a ship/production build. For example,
|
||||
* the *.api.md report file is automatically updated in a local build.
|
||||
*
|
||||
* The default value is false.
|
||||
*/
|
||||
localBuild?: boolean;
|
||||
/**
|
||||
* If true, API Extractor will include {@link ExtractorLogLevel.Verbose} messages in its output.
|
||||
*/
|
||||
showVerboseMessages?: boolean;
|
||||
/**
|
||||
* If true, API Extractor will print diagnostic information used for troubleshooting problems.
|
||||
* These messages will be included as {@link ExtractorLogLevel.Verbose} output.
|
||||
*
|
||||
* @remarks
|
||||
* Setting `showDiagnostics=true` forces `showVerboseMessages=true`.
|
||||
*/
|
||||
showDiagnostics?: boolean;
|
||||
/**
|
||||
* Specifies an alternate folder path to be used when loading the TypeScript system typings.
|
||||
*
|
||||
* @remarks
|
||||
* API Extractor uses its own TypeScript compiler engine to analyze your project. If your project
|
||||
* is built with a significantly different TypeScript version, sometimes API Extractor may report compilation
|
||||
* errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the "--typescriptCompilerFolder"
|
||||
* option to specify the folder path where you installed the TypeScript package, and API Extractor's compiler will
|
||||
* use those system typings instead.
|
||||
*/
|
||||
typescriptCompilerFolder?: string;
|
||||
/**
|
||||
* An optional callback function that will be called for each `ExtractorMessage` before it is displayed by
|
||||
* API Extractor. The callback can customize the message, handle it, or discard it.
|
||||
*
|
||||
* @remarks
|
||||
* If a `messageCallback` is not provided, then by default API Extractor will print the messages to
|
||||
* the STDERR/STDOUT console.
|
||||
*/
|
||||
messageCallback?: (message: ExtractorMessage) => void;
|
||||
/**
|
||||
* If true, then any differences between the actual and expected API reports will be
|
||||
* printed on the console.
|
||||
*
|
||||
* @remarks
|
||||
* The diff is not printed if the expected API report file has not been created yet.
|
||||
*/
|
||||
printApiReportDiff?: boolean;
|
||||
}
|
||||
/**
|
||||
* This object represents the outcome of an invocation of API Extractor.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export declare class ExtractorResult {
|
||||
/**
|
||||
* The TypeScript compiler state that was used.
|
||||
*/
|
||||
readonly compilerState: CompilerState;
|
||||
/**
|
||||
* The API Extractor configuration that was used.
|
||||
*/
|
||||
readonly extractorConfig: ExtractorConfig;
|
||||
/**
|
||||
* Whether the invocation of API Extractor was successful. For example, if `succeeded` is false, then the build task
|
||||
* would normally return a nonzero process exit code, indicating that the operation failed.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* Normally the operation "succeeds" if `errorCount` and `warningCount` are both zero. However if
|
||||
* {@link IExtractorInvokeOptions.localBuild} is `true`, then the operation "succeeds" if `errorCount` is zero
|
||||
* (i.e. warnings are ignored).
|
||||
*/
|
||||
readonly succeeded: boolean;
|
||||
/**
|
||||
* Returns true if the API report was found to have changed.
|
||||
*/
|
||||
readonly apiReportChanged: boolean;
|
||||
/**
|
||||
* Reports the number of errors encountered during analysis.
|
||||
*
|
||||
* @remarks
|
||||
* This does not count exceptions, where unexpected issues prematurely abort the operation.
|
||||
*/
|
||||
readonly errorCount: number;
|
||||
/**
|
||||
* Reports the number of warnings encountered during analysis.
|
||||
*
|
||||
* @remarks
|
||||
* This does not count warnings that are emitted in the API report file.
|
||||
*/
|
||||
readonly warningCount: number;
|
||||
/** @internal */
|
||||
constructor(properties: ExtractorResult);
|
||||
}
|
||||
/**
|
||||
* The starting point for invoking the API Extractor tool.
|
||||
* @public
|
||||
*/
|
||||
export declare class Extractor {
|
||||
/**
|
||||
* Returns the version number of the API Extractor NPM package.
|
||||
*/
|
||||
static get version(): string;
|
||||
/**
|
||||
* Returns the package name of the API Extractor NPM package.
|
||||
*/
|
||||
static get packageName(): string;
|
||||
private static _getPackageJson;
|
||||
/**
|
||||
* Load the api-extractor.json config file from the specified path, and then invoke API Extractor.
|
||||
*/
|
||||
static loadConfigAndInvoke(configFilePath: string, options?: IExtractorInvokeOptions): ExtractorResult;
|
||||
/**
|
||||
* Invoke API Extractor using an already prepared `ExtractorConfig` object.
|
||||
*/
|
||||
static invoke(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): ExtractorResult;
|
||||
/**
|
||||
* Generates the API report at the specified release level, writes it to the specified file path, and compares
|
||||
* the output to the existing report (if one exists).
|
||||
*
|
||||
* @param reportTempDirectoryPath - The path to the directory under which the temp report file will be written prior
|
||||
* to comparison with an existing report.
|
||||
* @param reportDirectoryPath - The path to the directory under which the existing report file is located, and to
|
||||
* which the new report will be written post-comparison.
|
||||
* @param reportConfig - API report configuration, including its file name and {@link ApiReportVariant}.
|
||||
* @param printApiReportDiff - {@link IExtractorInvokeOptions.printApiReportDiff}
|
||||
*
|
||||
* @returns Whether or not the newly generated report differs from the existing report (if one exists).
|
||||
*/
|
||||
private static _writeApiReport;
|
||||
private static _checkCompilerCompatibility;
|
||||
private static _generateRollupDtsFile;
|
||||
}
|
||||
//# sourceMappingURL=Extractor.d.ts.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/Extractor.d.ts.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/Extractor.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Extractor.d.ts","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,eAAe,EAAkC,MAAM,mBAAmB,CAAC;AAQpF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;;;;;OASG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAEtD;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAC1B;;OAEG;IACH,SAAgB,aAAa,EAAE,aAAa,CAAC;IAE7C;;OAEG;IACH,SAAgB,eAAe,EAAE,eAAe,CAAC;IAEjD;;;;;;;;;OASG;IACH,SAAgB,SAAS,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,SAAgB,gBAAgB,EAAE,OAAO,CAAC;IAE1C;;;;;OAKG;IACH,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC;;;;;OAKG;IACH,SAAgB,YAAY,EAAE,MAAM,CAAC;IAErC,gBAAgB;gBACG,UAAU,EAAE,eAAe;CAQ/C;AAED;;;GAGG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,WAAkB,OAAO,IAAI,MAAM,CAElC;IAED;;OAEG;IACH,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED,OAAO,CAAC,MAAM,CAAC,eAAe;IAI9B;;OAEG;WACW,mBAAmB,CAC/B,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,uBAAuB,GAChC,eAAe;IAMlB;;OAEG;WACW,MAAM,CAAC,eAAe,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,eAAe;IAsL1G;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAoI9B,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAsC1C,OAAO,CAAC,MAAM,CAAC,sBAAsB;CActC"}
|
||||
328
node_modules/@microsoft/api-extractor/lib/api/Extractor.js
generated
vendored
Normal file
328
node_modules/@microsoft/api-extractor/lib/api/Extractor.js
generated
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Extractor = exports.ExtractorResult = void 0;
|
||||
const path = __importStar(require("node:path"));
|
||||
const semver = __importStar(require("semver"));
|
||||
const ts = __importStar(require("typescript"));
|
||||
const resolve = __importStar(require("resolve"));
|
||||
const tsdoc_config_1 = require("@microsoft/tsdoc-config");
|
||||
const node_core_library_1 = require("@rushstack/node-core-library");
|
||||
const ExtractorConfig_1 = require("./ExtractorConfig");
|
||||
const Collector_1 = require("../collector/Collector");
|
||||
const DtsRollupGenerator_1 = require("../generators/DtsRollupGenerator");
|
||||
const ApiModelGenerator_1 = require("../generators/ApiModelGenerator");
|
||||
const ApiReportGenerator_1 = require("../generators/ApiReportGenerator");
|
||||
const PackageMetadataManager_1 = require("../analyzer/PackageMetadataManager");
|
||||
const ValidationEnhancer_1 = require("../enhancers/ValidationEnhancer");
|
||||
const DocCommentEnhancer_1 = require("../enhancers/DocCommentEnhancer");
|
||||
const CompilerState_1 = require("./CompilerState");
|
||||
const MessageRouter_1 = require("../collector/MessageRouter");
|
||||
const ConsoleMessageId_1 = require("./ConsoleMessageId");
|
||||
const SourceMapper_1 = require("../collector/SourceMapper");
|
||||
/**
|
||||
* This object represents the outcome of an invocation of API Extractor.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
class ExtractorResult {
|
||||
/** @internal */
|
||||
constructor(properties) {
|
||||
this.compilerState = properties.compilerState;
|
||||
this.extractorConfig = properties.extractorConfig;
|
||||
this.succeeded = properties.succeeded;
|
||||
this.apiReportChanged = properties.apiReportChanged;
|
||||
this.errorCount = properties.errorCount;
|
||||
this.warningCount = properties.warningCount;
|
||||
}
|
||||
}
|
||||
exports.ExtractorResult = ExtractorResult;
|
||||
/**
|
||||
* The starting point for invoking the API Extractor tool.
|
||||
* @public
|
||||
*/
|
||||
class Extractor {
|
||||
/**
|
||||
* Returns the version number of the API Extractor NPM package.
|
||||
*/
|
||||
static get version() {
|
||||
return Extractor._getPackageJson().version;
|
||||
}
|
||||
/**
|
||||
* Returns the package name of the API Extractor NPM package.
|
||||
*/
|
||||
static get packageName() {
|
||||
return Extractor._getPackageJson().name;
|
||||
}
|
||||
static _getPackageJson() {
|
||||
return node_core_library_1.PackageJsonLookup.loadOwnPackageJson(__dirname);
|
||||
}
|
||||
/**
|
||||
* Load the api-extractor.json config file from the specified path, and then invoke API Extractor.
|
||||
*/
|
||||
static loadConfigAndInvoke(configFilePath, options) {
|
||||
const extractorConfig = ExtractorConfig_1.ExtractorConfig.loadFileAndPrepare(configFilePath);
|
||||
return Extractor.invoke(extractorConfig, options);
|
||||
}
|
||||
/**
|
||||
* Invoke API Extractor using an already prepared `ExtractorConfig` object.
|
||||
*/
|
||||
static invoke(extractorConfig, options) {
|
||||
const { packageFolder, messages, tsdocConfiguration, tsdocConfigFile: { filePath: tsdocConfigFilePath, fileNotFound: tsdocConfigFileNotFound }, apiJsonFilePath, newlineKind, reportTempFolder, reportFolder, apiReportEnabled, reportConfigs, testMode, rollupEnabled, publicTrimmedFilePath, alphaTrimmedFilePath, betaTrimmedFilePath, untrimmedFilePath, tsdocMetadataEnabled, tsdocMetadataFilePath } = extractorConfig;
|
||||
const { localBuild = false, compilerState = CompilerState_1.CompilerState.create(extractorConfig, options), messageCallback, showVerboseMessages = false, showDiagnostics = false, printApiReportDiff = false } = options !== null && options !== void 0 ? options : {};
|
||||
const sourceMapper = new SourceMapper_1.SourceMapper();
|
||||
const messageRouter = new MessageRouter_1.MessageRouter({
|
||||
workingPackageFolder: packageFolder,
|
||||
messageCallback,
|
||||
messagesConfig: messages || {},
|
||||
showVerboseMessages,
|
||||
showDiagnostics,
|
||||
tsdocConfiguration,
|
||||
sourceMapper
|
||||
});
|
||||
if (tsdocConfigFilePath && !tsdocConfigFileNotFound) {
|
||||
if (!node_core_library_1.Path.isEqual(tsdocConfigFilePath, ExtractorConfig_1.ExtractorConfig._tsdocBaseFilePath)) {
|
||||
messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.UsingCustomTSDocConfig, `Using custom TSDoc config from ${tsdocConfigFilePath}`);
|
||||
}
|
||||
}
|
||||
this._checkCompilerCompatibility(extractorConfig, messageRouter);
|
||||
if (messageRouter.showDiagnostics) {
|
||||
messageRouter.logDiagnostic('');
|
||||
messageRouter.logDiagnosticHeader('Final prepared ExtractorConfig');
|
||||
messageRouter.logDiagnostic(extractorConfig.getDiagnosticDump());
|
||||
messageRouter.logDiagnosticFooter();
|
||||
messageRouter.logDiagnosticHeader('Compiler options');
|
||||
const serializedCompilerOptions = MessageRouter_1.MessageRouter.buildJsonDumpObject(compilerState.program.getCompilerOptions());
|
||||
messageRouter.logDiagnostic(JSON.stringify(serializedCompilerOptions, undefined, 2));
|
||||
messageRouter.logDiagnosticFooter();
|
||||
messageRouter.logDiagnosticHeader('TSDoc configuration');
|
||||
// Convert the TSDocConfiguration into a tsdoc.json representation
|
||||
const combinedConfigFile = tsdoc_config_1.TSDocConfigFile.loadFromParser(tsdocConfiguration);
|
||||
const serializedTSDocConfig = MessageRouter_1.MessageRouter.buildJsonDumpObject(combinedConfigFile.saveToObject());
|
||||
messageRouter.logDiagnostic(JSON.stringify(serializedTSDocConfig, undefined, 2));
|
||||
messageRouter.logDiagnosticFooter();
|
||||
}
|
||||
const collector = new Collector_1.Collector({
|
||||
program: compilerState.program,
|
||||
messageRouter,
|
||||
extractorConfig,
|
||||
sourceMapper
|
||||
});
|
||||
collector.analyze();
|
||||
DocCommentEnhancer_1.DocCommentEnhancer.analyze(collector);
|
||||
ValidationEnhancer_1.ValidationEnhancer.analyze(collector);
|
||||
const modelBuilder = new ApiModelGenerator_1.ApiModelGenerator(collector, extractorConfig);
|
||||
const apiPackage = modelBuilder.buildApiPackage();
|
||||
if (messageRouter.showDiagnostics) {
|
||||
messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages
|
||||
}
|
||||
if (modelBuilder.docModelEnabled) {
|
||||
messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.WritingDocModelFile, `Writing: ${apiJsonFilePath}`);
|
||||
apiPackage.saveToJsonFile(apiJsonFilePath, {
|
||||
toolPackage: Extractor.packageName,
|
||||
toolVersion: Extractor.version,
|
||||
newlineConversion: newlineKind,
|
||||
ensureFolderExists: true,
|
||||
testMode
|
||||
});
|
||||
}
|
||||
function writeApiReport(reportConfig) {
|
||||
return Extractor._writeApiReport(collector, extractorConfig, messageRouter, reportTempFolder, reportFolder, reportConfig, localBuild, printApiReportDiff);
|
||||
}
|
||||
let anyReportChanged = false;
|
||||
if (apiReportEnabled) {
|
||||
for (const reportConfig of reportConfigs) {
|
||||
anyReportChanged = writeApiReport(reportConfig) || anyReportChanged;
|
||||
}
|
||||
}
|
||||
if (rollupEnabled) {
|
||||
Extractor._generateRollupDtsFile(collector, publicTrimmedFilePath, DtsRollupGenerator_1.DtsRollupKind.PublicRelease, newlineKind);
|
||||
Extractor._generateRollupDtsFile(collector, alphaTrimmedFilePath, DtsRollupGenerator_1.DtsRollupKind.AlphaRelease, newlineKind);
|
||||
Extractor._generateRollupDtsFile(collector, betaTrimmedFilePath, DtsRollupGenerator_1.DtsRollupKind.BetaRelease, newlineKind);
|
||||
Extractor._generateRollupDtsFile(collector, untrimmedFilePath, DtsRollupGenerator_1.DtsRollupKind.InternalRelease, newlineKind);
|
||||
}
|
||||
if (tsdocMetadataEnabled) {
|
||||
// Write the tsdoc-metadata.json file for this project
|
||||
PackageMetadataManager_1.PackageMetadataManager.writeTsdocMetadataFile(tsdocMetadataFilePath, newlineKind);
|
||||
}
|
||||
// Show all the messages that we collected during analysis
|
||||
messageRouter.handleRemainingNonConsoleMessages();
|
||||
// Determine success
|
||||
let succeeded;
|
||||
if (localBuild) {
|
||||
// For a local build, fail if there were errors (but ignore warnings)
|
||||
succeeded = messageRouter.errorCount === 0;
|
||||
}
|
||||
else {
|
||||
// For a production build, fail if there were any errors or warnings
|
||||
succeeded = messageRouter.errorCount + messageRouter.warningCount === 0;
|
||||
}
|
||||
return new ExtractorResult({
|
||||
compilerState,
|
||||
extractorConfig,
|
||||
succeeded,
|
||||
apiReportChanged: anyReportChanged,
|
||||
errorCount: messageRouter.errorCount,
|
||||
warningCount: messageRouter.warningCount
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Generates the API report at the specified release level, writes it to the specified file path, and compares
|
||||
* the output to the existing report (if one exists).
|
||||
*
|
||||
* @param reportTempDirectoryPath - The path to the directory under which the temp report file will be written prior
|
||||
* to comparison with an existing report.
|
||||
* @param reportDirectoryPath - The path to the directory under which the existing report file is located, and to
|
||||
* which the new report will be written post-comparison.
|
||||
* @param reportConfig - API report configuration, including its file name and {@link ApiReportVariant}.
|
||||
* @param printApiReportDiff - {@link IExtractorInvokeOptions.printApiReportDiff}
|
||||
*
|
||||
* @returns Whether or not the newly generated report differs from the existing report (if one exists).
|
||||
*/
|
||||
static _writeApiReport(collector, extractorConfig, messageRouter, reportTempDirectoryPath, reportDirectoryPath, reportConfig, localBuild, printApiReportDiff) {
|
||||
let apiReportChanged = false;
|
||||
const actualApiReportPath = path.resolve(reportTempDirectoryPath, reportConfig.fileName);
|
||||
const actualApiReportShortPath = extractorConfig._getShortFilePath(actualApiReportPath);
|
||||
const expectedApiReportPath = path.resolve(reportDirectoryPath, reportConfig.fileName);
|
||||
const expectedApiReportShortPath = extractorConfig._getShortFilePath(expectedApiReportPath);
|
||||
collector.messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.WritingApiReport, `Generating ${reportConfig.variant} API report: ${expectedApiReportPath}`);
|
||||
const actualApiReportContent = ApiReportGenerator_1.ApiReportGenerator.generateReviewFileContent(collector, reportConfig.variant);
|
||||
// Write the actual file
|
||||
node_core_library_1.FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {
|
||||
ensureFolderExists: true,
|
||||
convertLineEndings: extractorConfig.newlineKind
|
||||
});
|
||||
// Compare it against the expected file
|
||||
if (node_core_library_1.FileSystem.exists(expectedApiReportPath)) {
|
||||
const expectedApiReportContent = node_core_library_1.FileSystem.readFile(expectedApiReportPath, {
|
||||
convertLineEndings: node_core_library_1.NewlineKind.Lf
|
||||
});
|
||||
if (!ApiReportGenerator_1.ApiReportGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)) {
|
||||
apiReportChanged = true;
|
||||
if (!localBuild) {
|
||||
// For a production build, issue a warning that will break the CI build.
|
||||
messageRouter.logWarning(ConsoleMessageId_1.ConsoleMessageId.ApiReportNotCopied, 'You have changed the API signature for this project.' +
|
||||
` Please copy the file "${actualApiReportShortPath}" to "${expectedApiReportShortPath}",` +
|
||||
` or perform a local build (which does this automatically).` +
|
||||
` See the Git repo documentation for more info.`);
|
||||
}
|
||||
else {
|
||||
// For a local build, just copy the file automatically.
|
||||
messageRouter.logWarning(ConsoleMessageId_1.ConsoleMessageId.ApiReportCopied, `You have changed the API signature for this project. Updating ${expectedApiReportShortPath}`);
|
||||
node_core_library_1.FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {
|
||||
ensureFolderExists: true,
|
||||
convertLineEndings: extractorConfig.newlineKind
|
||||
});
|
||||
}
|
||||
if (messageRouter.showVerboseMessages || printApiReportDiff) {
|
||||
const Diff = require('diff');
|
||||
const patch = Diff.structuredPatch(expectedApiReportShortPath, actualApiReportShortPath, expectedApiReportContent, actualApiReportContent);
|
||||
const logFunction = printApiReportDiff
|
||||
? messageRouter.logWarning.bind(messageRouter)
|
||||
: messageRouter.logVerbose.bind(messageRouter);
|
||||
logFunction(ConsoleMessageId_1.ConsoleMessageId.ApiReportDiff, 'Changes to the API report:\n\n' + Diff.formatPatch(patch));
|
||||
}
|
||||
}
|
||||
else {
|
||||
messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.ApiReportUnchanged, `The API report is up to date: ${actualApiReportShortPath}`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The target file does not exist, so we are setting up the API review file for the first time.
|
||||
//
|
||||
// NOTE: People sometimes make a mistake where they move a project and forget to update the "reportFolder"
|
||||
// setting, which causes a new file to silently get written to the wrong place. This can be confusing.
|
||||
// Thus we treat the initial creation of the file specially.
|
||||
apiReportChanged = true;
|
||||
if (!localBuild) {
|
||||
// For a production build, issue a warning that will break the CI build.
|
||||
messageRouter.logWarning(ConsoleMessageId_1.ConsoleMessageId.ApiReportNotCopied, 'The API report file is missing.' +
|
||||
` Please copy the file "${actualApiReportShortPath}" to "${expectedApiReportShortPath}",` +
|
||||
` or perform a local build (which does this automatically).` +
|
||||
` See the Git repo documentation for more info.`);
|
||||
}
|
||||
else {
|
||||
const expectedApiReportFolder = path.dirname(expectedApiReportPath);
|
||||
if (!node_core_library_1.FileSystem.exists(expectedApiReportFolder)) {
|
||||
messageRouter.logError(ConsoleMessageId_1.ConsoleMessageId.ApiReportFolderMissing, 'Unable to create the API report file. Please make sure the target folder exists:\n' +
|
||||
expectedApiReportFolder);
|
||||
}
|
||||
else {
|
||||
node_core_library_1.FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {
|
||||
convertLineEndings: extractorConfig.newlineKind
|
||||
});
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
return apiReportChanged;
|
||||
}
|
||||
static _checkCompilerCompatibility(extractorConfig, messageRouter) {
|
||||
messageRouter.logInfo(ConsoleMessageId_1.ConsoleMessageId.Preamble, `Analysis will use the bundled TypeScript version ${ts.version}`);
|
||||
try {
|
||||
const typescriptPath = resolve.sync('typescript', {
|
||||
basedir: extractorConfig.projectFolder,
|
||||
preserveSymlinks: false
|
||||
});
|
||||
const packageJsonLookup = new node_core_library_1.PackageJsonLookup();
|
||||
const packageJson = packageJsonLookup.tryLoadNodePackageJsonFor(typescriptPath);
|
||||
if (packageJson && packageJson.version && semver.valid(packageJson.version)) {
|
||||
// Consider a newer MINOR release to be incompatible
|
||||
const ourMajor = semver.major(ts.version);
|
||||
const ourMinor = semver.minor(ts.version);
|
||||
const theirMajor = semver.major(packageJson.version);
|
||||
const theirMinor = semver.minor(packageJson.version);
|
||||
if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {
|
||||
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.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// The compiler detection heuristic is not expected to work in many configurations
|
||||
}
|
||||
}
|
||||
static _generateRollupDtsFile(collector, outputPath, dtsKind, newlineKind) {
|
||||
if (outputPath !== '') {
|
||||
collector.messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.WritingDtsRollup, `Writing package typings: ${outputPath}`);
|
||||
DtsRollupGenerator_1.DtsRollupGenerator.writeTypingsFile(collector, outputPath, dtsKind, newlineKind);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Extractor = Extractor;
|
||||
//# sourceMappingURL=Extractor.js.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/Extractor.js.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/Extractor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
305
node_modules/@microsoft/api-extractor/lib/api/ExtractorConfig.d.ts
generated
vendored
Normal file
305
node_modules/@microsoft/api-extractor/lib/api/ExtractorConfig.d.ts
generated
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
import { EnumMemberOrder } from '@microsoft/api-extractor-model';
|
||||
import { TSDocConfiguration } from '@microsoft/tsdoc';
|
||||
import { TSDocConfigFile } from '@microsoft/tsdoc-config';
|
||||
import { type IRigConfig } from '@rushstack/rig-package';
|
||||
import { JsonSchema, PackageJsonLookup, type INodePackageJson, NewlineKind } from '@rushstack/node-core-library';
|
||||
import type { ApiReportVariant, IConfigFile, IExtractorMessagesConfig } from './IConfigFile';
|
||||
import type { IApiModelGenerationOptions } from '../generators/ApiModelGenerator';
|
||||
/**
|
||||
* Options for {@link ExtractorConfig.tryLoadForFolder}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IExtractorConfigLoadForFolderOptions {
|
||||
/**
|
||||
* The folder path to start from when searching for api-extractor.json.
|
||||
*/
|
||||
startingFolder: string;
|
||||
/**
|
||||
* An already constructed `PackageJsonLookup` cache object to use. If omitted, a temporary one will
|
||||
* be constructed.
|
||||
*/
|
||||
packageJsonLookup?: PackageJsonLookup;
|
||||
/**
|
||||
* An already constructed `RigConfig` object. If omitted, then a new `RigConfig` object will be constructed.
|
||||
*/
|
||||
rigConfig?: IRigConfig;
|
||||
}
|
||||
/**
|
||||
* Options for {@link ExtractorConfig.prepare}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IExtractorConfigPrepareOptions {
|
||||
/**
|
||||
* A configuration object as returned by {@link ExtractorConfig.loadFile}.
|
||||
*/
|
||||
configObject: IConfigFile;
|
||||
/**
|
||||
* The absolute path of the file that the `configObject` object was loaded from. This is used for error messages
|
||||
* and when probing for `tsconfig.json`.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* If `configObjectFullPath` and `projectFolderLookupToken` are both unspecified, then the api-extractor.json
|
||||
* config file must explicitly specify a `projectFolder` setting rather than relying on the `<lookup>` token.
|
||||
*/
|
||||
configObjectFullPath: string | undefined;
|
||||
/**
|
||||
* The parsed package.json file for the working package, or undefined if API Extractor was invoked without
|
||||
* a package.json file.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* If omitted, then the `<unscopedPackageName>` and `<packageName>` tokens will have default values.
|
||||
*/
|
||||
packageJson?: INodePackageJson | undefined;
|
||||
/**
|
||||
* The absolute path of the file that the `packageJson` object was loaded from, or undefined if API Extractor
|
||||
* was invoked without a package.json file.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* This is used for error messages and when resolving paths found in package.json.
|
||||
*
|
||||
* If `packageJsonFullPath` is specified but `packageJson` is omitted, the file will be loaded automatically.
|
||||
*/
|
||||
packageJsonFullPath: string | undefined;
|
||||
/**
|
||||
* The default value for the `projectFolder` setting is the `<lookup>` token, which uses a heuristic to guess
|
||||
* an appropriate project folder. Use `projectFolderLookupValue` to manually specify the `<lookup>` token value
|
||||
* instead.
|
||||
*
|
||||
* @remarks
|
||||
* If the `projectFolder` setting is explicitly specified in api-extractor.json file, it should take precedence
|
||||
* over a value specified via the API. Thus the `projectFolderLookupToken` option provides a way to override
|
||||
* the default value for `projectFolder` setting while still honoring a manually specified value.
|
||||
*/
|
||||
projectFolderLookupToken?: string;
|
||||
/**
|
||||
* Allow customization of the tsdoc.json config file. If omitted, this file will be loaded from its default
|
||||
* location. If the file does not exist, then the standard definitions will be used from
|
||||
* `@microsoft/api-extractor/extends/tsdoc-base.json`.
|
||||
*/
|
||||
tsdocConfigFile?: TSDocConfigFile;
|
||||
/**
|
||||
* When preparing the configuration object, folder and file paths referenced in the configuration are checked
|
||||
* for existence, and an error is reported if they are not found. This option can be used to disable this
|
||||
* check for the main entry point module. This may be useful when preparing a configuration file for an
|
||||
* un-built project.
|
||||
*/
|
||||
ignoreMissingEntryPoint?: boolean;
|
||||
}
|
||||
/**
|
||||
* Configuration for a single API report, including its {@link IExtractorConfigApiReport.variant}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IExtractorConfigApiReport {
|
||||
/**
|
||||
* Report variant.
|
||||
* Determines which API items will be included in the report output, based on their tagged release levels.
|
||||
*/
|
||||
variant: ApiReportVariant;
|
||||
/**
|
||||
* Name of the output report file.
|
||||
* @remarks Relative to the configured report directory path.
|
||||
*/
|
||||
fileName: string;
|
||||
}
|
||||
/**
|
||||
* The `ExtractorConfig` class loads, validates, interprets, and represents the api-extractor.json config file.
|
||||
* @sealed
|
||||
* @public
|
||||
*/
|
||||
export declare class ExtractorConfig {
|
||||
/**
|
||||
* The JSON Schema for API Extractor config file (api-extractor.schema.json).
|
||||
*/
|
||||
static readonly jsonSchema: JsonSchema;
|
||||
/**
|
||||
* The config file name "api-extractor.json".
|
||||
*/
|
||||
static readonly FILENAME: 'api-extractor.json';
|
||||
/**
|
||||
* The full path to `extends/tsdoc-base.json` which contains the standard TSDoc configuration
|
||||
* for API Extractor.
|
||||
* @internal
|
||||
*/
|
||||
static readonly _tsdocBaseFilePath: string;
|
||||
private static readonly _defaultConfig;
|
||||
/** Match all three flavors for type declaration files (.d.ts, .d.mts, .d.cts) */
|
||||
private static readonly _declarationFileExtensionRegExp;
|
||||
/** {@inheritDoc IConfigFile.projectFolder} */
|
||||
readonly projectFolder: string;
|
||||
/**
|
||||
* The parsed package.json file for the working package, or undefined if API Extractor was invoked without
|
||||
* a package.json file.
|
||||
*/
|
||||
readonly packageJson: INodePackageJson | undefined;
|
||||
/**
|
||||
* The absolute path of the folder containing the package.json file for the working package, or undefined
|
||||
* if API Extractor was invoked without a package.json file.
|
||||
*/
|
||||
readonly packageFolder: string | undefined;
|
||||
/** {@inheritDoc IConfigFile.mainEntryPointFilePath} */
|
||||
readonly mainEntryPointFilePath: string;
|
||||
/** {@inheritDoc IConfigFile.bundledPackages} */
|
||||
readonly bundledPackages: string[];
|
||||
/** {@inheritDoc IConfigCompiler.tsconfigFilePath} */
|
||||
readonly tsconfigFilePath: string;
|
||||
/** {@inheritDoc IConfigCompiler.overrideTsconfig} */
|
||||
readonly overrideTsconfig: {} | undefined;
|
||||
/** {@inheritDoc IConfigCompiler.skipLibCheck} */
|
||||
readonly skipLibCheck: boolean;
|
||||
/** {@inheritDoc IConfigApiReport.enabled} */
|
||||
readonly apiReportEnabled: boolean;
|
||||
/**
|
||||
* List of configurations for report files to be generated.
|
||||
* @remarks Derived from {@link IConfigApiReport.reportFileName} and {@link IConfigApiReport.reportVariants}.
|
||||
*/
|
||||
readonly reportConfigs: readonly IExtractorConfigApiReport[];
|
||||
/** {@inheritDoc IConfigApiReport.reportFolder} */
|
||||
readonly reportFolder: string;
|
||||
/** {@inheritDoc IConfigApiReport.reportTempFolder} */
|
||||
readonly reportTempFolder: string;
|
||||
/** {@inheritDoc IConfigApiReport.tagsToReport} */
|
||||
readonly tagsToReport: Readonly<Record<`@${string}`, boolean>>;
|
||||
/**
|
||||
* Gets the file path for the "complete" (default) report configuration, if one was specified.
|
||||
* Otherwise, returns an empty string.
|
||||
* @deprecated Use {@link ExtractorConfig.reportConfigs} to access all report configurations.
|
||||
*/
|
||||
get reportFilePath(): string;
|
||||
/**
|
||||
* Gets the temp file path for the "complete" (default) report configuration, if one was specified.
|
||||
* Otherwise, returns an empty string.
|
||||
* @deprecated Use {@link ExtractorConfig.reportConfigs} to access all report configurations.
|
||||
*/
|
||||
get reportTempFilePath(): string;
|
||||
/** {@inheritDoc IConfigApiReport.includeForgottenExports} */
|
||||
readonly apiReportIncludeForgottenExports: boolean;
|
||||
/**
|
||||
* If specified, the doc model is enabled and the specified options will be used.
|
||||
* @beta
|
||||
*/
|
||||
readonly docModelGenerationOptions: IApiModelGenerationOptions | undefined;
|
||||
/** {@inheritDoc IConfigDocModel.apiJsonFilePath} */
|
||||
readonly apiJsonFilePath: string;
|
||||
/** {@inheritDoc IConfigDocModel.includeForgottenExports} */
|
||||
readonly docModelIncludeForgottenExports: boolean;
|
||||
/** {@inheritDoc IConfigDocModel.projectFolderUrl} */
|
||||
readonly projectFolderUrl: string | undefined;
|
||||
/** {@inheritDoc IConfigDtsRollup.enabled} */
|
||||
readonly rollupEnabled: boolean;
|
||||
/** {@inheritDoc IConfigDtsRollup.untrimmedFilePath} */
|
||||
readonly untrimmedFilePath: string;
|
||||
/** {@inheritDoc IConfigDtsRollup.alphaTrimmedFilePath} */
|
||||
readonly alphaTrimmedFilePath: string;
|
||||
/** {@inheritDoc IConfigDtsRollup.betaTrimmedFilePath} */
|
||||
readonly betaTrimmedFilePath: string;
|
||||
/** {@inheritDoc IConfigDtsRollup.publicTrimmedFilePath} */
|
||||
readonly publicTrimmedFilePath: string;
|
||||
/** {@inheritDoc IConfigDtsRollup.omitTrimmingComments} */
|
||||
readonly omitTrimmingComments: boolean;
|
||||
/** {@inheritDoc IConfigTsdocMetadata.enabled} */
|
||||
readonly tsdocMetadataEnabled: boolean;
|
||||
/** {@inheritDoc IConfigTsdocMetadata.tsdocMetadataFilePath} */
|
||||
readonly tsdocMetadataFilePath: string;
|
||||
/**
|
||||
* The tsdoc.json configuration that will be used when parsing doc comments.
|
||||
*/
|
||||
readonly tsdocConfigFile: TSDocConfigFile;
|
||||
/**
|
||||
* The `TSDocConfiguration` loaded from {@link ExtractorConfig.tsdocConfigFile}.
|
||||
*/
|
||||
readonly tsdocConfiguration: TSDocConfiguration;
|
||||
/**
|
||||
* Specifies what type of newlines API Extractor should use when writing output files. By default, the output files
|
||||
* will be written with Windows-style newlines.
|
||||
*/
|
||||
readonly newlineKind: NewlineKind;
|
||||
/** {@inheritDoc IConfigFile.messages} */
|
||||
readonly messages: IExtractorMessagesConfig;
|
||||
/** {@inheritDoc IConfigFile.testMode} */
|
||||
readonly testMode: boolean;
|
||||
/** {@inheritDoc IConfigFile.enumMemberOrder} */
|
||||
readonly enumMemberOrder: EnumMemberOrder;
|
||||
private constructor();
|
||||
/**
|
||||
* Returns a JSON-like string representing the `ExtractorConfig` state, which can be printed to a console
|
||||
* for diagnostic purposes.
|
||||
*
|
||||
* @remarks
|
||||
* This is used by the "--diagnostics" command-line option. The string is not intended to be deserialized;
|
||||
* its format may be changed at any time.
|
||||
*/
|
||||
getDiagnosticDump(): string;
|
||||
/**
|
||||
* Returns a simplified file path for use in error messages.
|
||||
* @internal
|
||||
*/
|
||||
_getShortFilePath(absolutePath: string): string;
|
||||
/**
|
||||
* Searches for the api-extractor.json config file associated with the specified starting folder,
|
||||
* and loads the file if found. This lookup supports
|
||||
* {@link https://www.npmjs.com/package/@rushstack/rig-package | rig packages}.
|
||||
*
|
||||
* @remarks
|
||||
* The search will first look for a package.json file in a parent folder of the starting folder;
|
||||
* if found, that will be used as the base folder instead of the starting folder. If the config
|
||||
* file is not found in `<baseFolder>/api-extractor.json` or `<baseFolder>/config/api-extractor.json`,
|
||||
* then `<baseFolder/config/rig.json` will be checked to see whether a
|
||||
* {@link https://www.npmjs.com/package/@rushstack/rig-package | rig package} is referenced; if so then
|
||||
* the rig's api-extractor.json file will be used instead. If a config file is found, it will be loaded
|
||||
* and returned with the `IExtractorConfigPrepareOptions` object. Otherwise, `undefined` is returned
|
||||
* to indicate that API Extractor does not appear to be configured for the specified folder.
|
||||
*
|
||||
* @returns An options object that can be passed to {@link ExtractorConfig.prepare}, or `undefined`
|
||||
* if not api-extractor.json file was found.
|
||||
*/
|
||||
static tryLoadForFolder(options: IExtractorConfigLoadForFolderOptions): IExtractorConfigPrepareOptions | undefined;
|
||||
/**
|
||||
* Loads the api-extractor.json config file from the specified file path, and prepares an `ExtractorConfig` object.
|
||||
*
|
||||
* @remarks
|
||||
* Loads the api-extractor.json config file from the specified file path. If the "extends" field is present,
|
||||
* the referenced file(s) will be merged. For any omitted fields, the API Extractor default values are merged.
|
||||
*
|
||||
* The result is prepared using `ExtractorConfig.prepare()`.
|
||||
*/
|
||||
static loadFileAndPrepare(configJsonFilePath: string): ExtractorConfig;
|
||||
/**
|
||||
* Performs only the first half of {@link ExtractorConfig.loadFileAndPrepare}, providing an opportunity to
|
||||
* modify the object before it is passed to {@link ExtractorConfig.prepare}.
|
||||
*
|
||||
* @remarks
|
||||
* Loads the api-extractor.json config file from the specified file path. If the "extends" field is present,
|
||||
* the referenced file(s) will be merged. For any omitted fields, the API Extractor default values are merged.
|
||||
*/
|
||||
static loadFile(jsonFilePath: string): IConfigFile;
|
||||
private static _resolveConfigFileRelativePaths;
|
||||
private static _resolveConfigFileRelativePath;
|
||||
/**
|
||||
* Prepares an `ExtractorConfig` object using a configuration that is provided as a runtime object,
|
||||
* rather than reading it from disk. This allows configurations to be constructed programmatically,
|
||||
* loaded from an alternate source, and/or customized after loading.
|
||||
*/
|
||||
static prepare(options: IExtractorConfigPrepareOptions): ExtractorConfig;
|
||||
/**
|
||||
* Gets the report configuration for the "complete" (default) report configuration, if one was specified.
|
||||
*/
|
||||
private _getCompleteReportConfig;
|
||||
private static _resolvePathWithTokens;
|
||||
private static _expandStringWithTokens;
|
||||
/**
|
||||
* Returns true if the specified file path has the ".d.ts" file extension.
|
||||
*/
|
||||
static hasDtsFileExtension(filePath: string): boolean;
|
||||
/**
|
||||
* Given a path string that may have originally contained expandable tokens such as `<projectFolder>"`
|
||||
* this reports an error if any token-looking substrings remain after expansion (e.g. `c:\blah\<invalid>\blah`).
|
||||
*/
|
||||
private static _rejectAnyTokensInPath;
|
||||
}
|
||||
//# sourceMappingURL=ExtractorConfig.d.ts.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorConfig.d.ts.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorConfig.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ExtractorConfig.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorConfig.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAc,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,KAAK,UAAU,EAAa,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAEL,UAAU,EAEV,iBAAiB,EACjB,KAAK,gBAAgB,EAKrB,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AA6BlF;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACnD;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,YAAY,EAAE,WAAW,CAAC;IAE1B;;;;;;;;OAQG;IACH,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IAEzC;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAE3C;;;;;;;;;OASG;IACH,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IAExC;;;;;;;;;OASG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAE1B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAwDD;;;;GAIG;AACH,qBAAa,eAAe;IAC1B;;OAEG;IACH,gBAAuB,UAAU,EAAE,UAAU,CAAmD;IAEhG;;OAEG;IACH,gBAAuB,QAAQ,EAAE,oBAAoB,CAAwB;IAE7E;;;;OAIG;IACH,gBAAuB,kBAAkB,EAAE,MAAM,CAG/C;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAEpC;IAEF,iFAAiF;IACjF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,+BAA+B,CAA6B;IAEpF,8CAA8C;IAC9C,SAAgB,aAAa,EAAE,MAAM,CAAC;IAEtC;;;OAGG;IACH,SAAgB,WAAW,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAE1D;;;OAGG;IACH,SAAgB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAElD,uDAAuD;IACvD,SAAgB,sBAAsB,EAAE,MAAM,CAAC;IAE/C,gDAAgD;IAChD,SAAgB,eAAe,EAAE,MAAM,EAAE,CAAC;IAE1C,qDAAqD;IACrD,SAAgB,gBAAgB,EAAE,MAAM,CAAC;IAEzC,qDAAqD;IACrD,SAAgB,gBAAgB,EAAE,EAAE,GAAG,SAAS,CAAC;IAEjD,iDAAiD;IACjD,SAAgB,YAAY,EAAE,OAAO,CAAC;IAEtC,6CAA6C;IAC7C,SAAgB,gBAAgB,EAAE,OAAO,CAAC;IAE1C;;;OAGG;IACH,SAAgB,aAAa,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACpE,kDAAkD;IAClD,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,sDAAsD;IACtD,SAAgB,gBAAgB,EAAE,MAAM,CAAC;IACzC,kDAAkD;IAClD,SAAgB,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IAEtE;;;;OAIG;IACH,IAAW,cAAc,IAAI,MAAM,CAGlC;IAED;;;;OAIG;IACH,IAAW,kBAAkB,IAAI,MAAM,CAGtC;IAED,6DAA6D;IAC7D,SAAgB,gCAAgC,EAAE,OAAO,CAAC;IAE1D;;;OAGG;IACH,SAAgB,yBAAyB,EAAE,0BAA0B,GAAG,SAAS,CAAC;IAClF,oDAAoD;IACpD,SAAgB,eAAe,EAAE,MAAM,CAAC;IACxC,4DAA4D;IAC5D,SAAgB,+BAA+B,EAAE,OAAO,CAAC;IACzD,qDAAqD;IACrD,SAAgB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IAErD,6CAA6C;IAC7C,SAAgB,aAAa,EAAE,OAAO,CAAC;IACvC,uDAAuD;IACvD,SAAgB,iBAAiB,EAAE,MAAM,CAAC;IAC1C,0DAA0D;IAC1D,SAAgB,oBAAoB,EAAE,MAAM,CAAC;IAC7C,yDAAyD;IACzD,SAAgB,mBAAmB,EAAE,MAAM,CAAC;IAC5C,2DAA2D;IAC3D,SAAgB,qBAAqB,EAAE,MAAM,CAAC;IAC9C,0DAA0D;IAC1D,SAAgB,oBAAoB,EAAE,OAAO,CAAC;IAE9C,iDAAiD;IACjD,SAAgB,oBAAoB,EAAE,OAAO,CAAC;IAC9C,+DAA+D;IAC/D,SAAgB,qBAAqB,EAAE,MAAM,CAAC;IAE9C;;OAEG;IACH,SAAgB,eAAe,EAAE,eAAe,CAAC;IAEjD;;OAEG;IACH,SAAgB,kBAAkB,EAAE,kBAAkB,CAAC;IAEvD;;;OAGG;IACH,SAAgB,WAAW,EAAE,WAAW,CAAC;IAEzC,yCAAyC;IACzC,SAAgB,QAAQ,EAAE,wBAAwB,CAAC;IAEnD,yCAAyC;IACzC,SAAgB,QAAQ,EAAE,OAAO,CAAC;IAElC,gDAAgD;IAChD,SAAgB,eAAe,EAAE,eAAe,CAAC;IAEjD,OAAO;IAoEP;;;;;;;OAOG;IACI,iBAAiB,IAAI,MAAM;IAiBlC;;;OAGG;IACI,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAUtD;;;;;;;;;;;;;;;;;OAiBG;WACW,gBAAgB,CAC5B,OAAO,EAAE,oCAAoC,GAC5C,8BAA8B,GAAG,SAAS;IA6E7C;;;;;;;;OAQG;WACW,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,GAAG,eAAe;IAiB7E;;;;;;;OAOG;WACW,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAoFzD,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAmG9C,OAAO,CAAC,MAAM,CAAC,8BAA8B;IAgB7C;;;;OAIG;WACW,OAAO,CAAC,OAAO,EAAE,8BAA8B,GAAG,eAAe;IAsc/E;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAYrC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAgCtC;;OAEG;WACW,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI5D;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAatC"}
|
||||
842
node_modules/@microsoft/api-extractor/lib/api/ExtractorConfig.js
generated
vendored
Normal file
842
node_modules/@microsoft/api-extractor/lib/api/ExtractorConfig.js
generated
vendored
Normal file
@@ -0,0 +1,842 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ExtractorConfig = void 0;
|
||||
const path = __importStar(require("node:path"));
|
||||
const resolve = __importStar(require("resolve"));
|
||||
const lodash = require("lodash");
|
||||
const api_extractor_model_1 = require("@microsoft/api-extractor-model");
|
||||
const tsdoc_1 = require("@microsoft/tsdoc");
|
||||
const tsdoc_config_1 = require("@microsoft/tsdoc-config");
|
||||
const rig_package_1 = require("@rushstack/rig-package");
|
||||
const node_core_library_1 = require("@rushstack/node-core-library");
|
||||
const PackageMetadataManager_1 = require("../analyzer/PackageMetadataManager");
|
||||
const MessageRouter_1 = require("../collector/MessageRouter");
|
||||
const api_extractor_schema_json_1 = __importDefault(require("../schemas/api-extractor.schema.json"));
|
||||
/** Default {@link IConfigApiReport.reportVariants} */
|
||||
const defaultApiReportVariants = ['complete'];
|
||||
/**
|
||||
* Default {@link IConfigApiReport.tagsToReport}.
|
||||
*
|
||||
* @remarks
|
||||
* Note that this list is externally documented, and directly affects report output.
|
||||
* Also note that the order of tags in this list is significant, as it determines the order of tags in the report.
|
||||
* Any changes to this list should be considered breaking.
|
||||
*/
|
||||
const defaultTagsToReport = {
|
||||
'@sealed': true,
|
||||
'@virtual': true,
|
||||
'@override': true,
|
||||
'@eventProperty': true,
|
||||
'@deprecated': true
|
||||
};
|
||||
/**
|
||||
* The `ExtractorConfig` class loads, validates, interprets, and represents the api-extractor.json config file.
|
||||
* @sealed
|
||||
* @public
|
||||
*/
|
||||
class ExtractorConfig {
|
||||
/**
|
||||
* Gets the file path for the "complete" (default) report configuration, if one was specified.
|
||||
* Otherwise, returns an empty string.
|
||||
* @deprecated Use {@link ExtractorConfig.reportConfigs} to access all report configurations.
|
||||
*/
|
||||
get reportFilePath() {
|
||||
const completeConfig = this._getCompleteReportConfig();
|
||||
return completeConfig === undefined ? '' : path.join(this.reportFolder, completeConfig.fileName);
|
||||
}
|
||||
/**
|
||||
* Gets the temp file path for the "complete" (default) report configuration, if one was specified.
|
||||
* Otherwise, returns an empty string.
|
||||
* @deprecated Use {@link ExtractorConfig.reportConfigs} to access all report configurations.
|
||||
*/
|
||||
get reportTempFilePath() {
|
||||
const completeConfig = this._getCompleteReportConfig();
|
||||
return completeConfig === undefined ? '' : path.join(this.reportTempFolder, completeConfig.fileName);
|
||||
}
|
||||
constructor({ projectFolder, packageJson, packageFolder, mainEntryPointFilePath, bundledPackages, tsconfigFilePath, overrideTsconfig, skipLibCheck, apiReportEnabled, apiReportIncludeForgottenExports, reportConfigs, reportFolder, reportTempFolder, tagsToReport, docModelGenerationOptions, apiJsonFilePath, docModelIncludeForgottenExports, projectFolderUrl, rollupEnabled, untrimmedFilePath, alphaTrimmedFilePath, betaTrimmedFilePath, publicTrimmedFilePath, omitTrimmingComments, tsdocMetadataEnabled, tsdocMetadataFilePath, tsdocConfigFile, tsdocConfiguration, newlineKind, messages, testMode, enumMemberOrder }) {
|
||||
this.projectFolder = projectFolder;
|
||||
this.packageJson = packageJson;
|
||||
this.packageFolder = packageFolder;
|
||||
this.mainEntryPointFilePath = mainEntryPointFilePath;
|
||||
this.bundledPackages = bundledPackages;
|
||||
this.tsconfigFilePath = tsconfigFilePath;
|
||||
this.overrideTsconfig = overrideTsconfig;
|
||||
this.skipLibCheck = skipLibCheck;
|
||||
this.apiReportEnabled = apiReportEnabled;
|
||||
this.apiReportIncludeForgottenExports = apiReportIncludeForgottenExports;
|
||||
this.reportConfigs = reportConfigs;
|
||||
this.reportFolder = reportFolder;
|
||||
this.reportTempFolder = reportTempFolder;
|
||||
this.tagsToReport = tagsToReport;
|
||||
this.docModelGenerationOptions = docModelGenerationOptions;
|
||||
this.apiJsonFilePath = apiJsonFilePath;
|
||||
this.docModelIncludeForgottenExports = docModelIncludeForgottenExports;
|
||||
this.projectFolderUrl = projectFolderUrl;
|
||||
this.rollupEnabled = rollupEnabled;
|
||||
this.untrimmedFilePath = untrimmedFilePath;
|
||||
this.alphaTrimmedFilePath = alphaTrimmedFilePath;
|
||||
this.betaTrimmedFilePath = betaTrimmedFilePath;
|
||||
this.publicTrimmedFilePath = publicTrimmedFilePath;
|
||||
this.omitTrimmingComments = omitTrimmingComments;
|
||||
this.tsdocMetadataEnabled = tsdocMetadataEnabled;
|
||||
this.tsdocMetadataFilePath = tsdocMetadataFilePath;
|
||||
this.tsdocConfigFile = tsdocConfigFile;
|
||||
this.tsdocConfiguration = tsdocConfiguration;
|
||||
this.newlineKind = newlineKind;
|
||||
this.messages = messages;
|
||||
this.testMode = testMode;
|
||||
this.enumMemberOrder = enumMemberOrder;
|
||||
}
|
||||
/**
|
||||
* Returns a JSON-like string representing the `ExtractorConfig` state, which can be printed to a console
|
||||
* for diagnostic purposes.
|
||||
*
|
||||
* @remarks
|
||||
* This is used by the "--diagnostics" command-line option. The string is not intended to be deserialized;
|
||||
* its format may be changed at any time.
|
||||
*/
|
||||
getDiagnosticDump() {
|
||||
// Handle the simple JSON-serializable properties using buildJsonDumpObject()
|
||||
const result = MessageRouter_1.MessageRouter.buildJsonDumpObject(this, {
|
||||
keyNamesToOmit: ['tsdocConfigFile', 'tsdocConfiguration']
|
||||
});
|
||||
// Implement custom formatting for tsdocConfigFile and tsdocConfiguration
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
result.tsdocConfigFile = {
|
||||
filePath: this.tsdocConfigFile.filePath,
|
||||
log: this.tsdocConfigFile.log.messages.map((x) => x.toString())
|
||||
};
|
||||
return JSON.stringify(result, undefined, 2);
|
||||
}
|
||||
/**
|
||||
* Returns a simplified file path for use in error messages.
|
||||
* @internal
|
||||
*/
|
||||
_getShortFilePath(absolutePath) {
|
||||
if (!path.isAbsolute(absolutePath)) {
|
||||
throw new node_core_library_1.InternalError('Expected absolute path: ' + absolutePath);
|
||||
}
|
||||
if (node_core_library_1.Path.isUnderOrEqual(absolutePath, this.projectFolder)) {
|
||||
return node_core_library_1.Path.convertToSlashes(path.relative(this.projectFolder, absolutePath));
|
||||
}
|
||||
return absolutePath;
|
||||
}
|
||||
/**
|
||||
* Searches for the api-extractor.json config file associated with the specified starting folder,
|
||||
* and loads the file if found. This lookup supports
|
||||
* {@link https://www.npmjs.com/package/@rushstack/rig-package | rig packages}.
|
||||
*
|
||||
* @remarks
|
||||
* The search will first look for a package.json file in a parent folder of the starting folder;
|
||||
* if found, that will be used as the base folder instead of the starting folder. If the config
|
||||
* file is not found in `<baseFolder>/api-extractor.json` or `<baseFolder>/config/api-extractor.json`,
|
||||
* then `<baseFolder/config/rig.json` will be checked to see whether a
|
||||
* {@link https://www.npmjs.com/package/@rushstack/rig-package | rig package} is referenced; if so then
|
||||
* the rig's api-extractor.json file will be used instead. If a config file is found, it will be loaded
|
||||
* and returned with the `IExtractorConfigPrepareOptions` object. Otherwise, `undefined` is returned
|
||||
* to indicate that API Extractor does not appear to be configured for the specified folder.
|
||||
*
|
||||
* @returns An options object that can be passed to {@link ExtractorConfig.prepare}, or `undefined`
|
||||
* if not api-extractor.json file was found.
|
||||
*/
|
||||
static tryLoadForFolder(options) {
|
||||
const packageJsonLookup = options.packageJsonLookup || new node_core_library_1.PackageJsonLookup();
|
||||
const startingFolder = options.startingFolder;
|
||||
// Figure out which project we're in and look for the config file at the project root
|
||||
const packageJsonFullPath = packageJsonLookup.tryGetPackageJsonFilePathFor(startingFolder);
|
||||
const packageFolder = packageJsonFullPath
|
||||
? path.dirname(packageJsonFullPath)
|
||||
: undefined;
|
||||
// If there is no package, then just use the starting folder
|
||||
const baseFolder = packageFolder || startingFolder;
|
||||
let projectFolderLookupToken = undefined;
|
||||
// First try the standard "config" subfolder:
|
||||
let configFilename = path.join(baseFolder, 'config', ExtractorConfig.FILENAME);
|
||||
if (node_core_library_1.FileSystem.exists(configFilename)) {
|
||||
if (node_core_library_1.FileSystem.exists(path.join(baseFolder, ExtractorConfig.FILENAME))) {
|
||||
throw new Error(`Found conflicting ${ExtractorConfig.FILENAME} files in "." and "./config" folders`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Otherwise try the top-level folder
|
||||
configFilename = path.join(baseFolder, ExtractorConfig.FILENAME);
|
||||
if (!node_core_library_1.FileSystem.exists(configFilename)) {
|
||||
// If We didn't find it in <packageFolder>/api-extractor.json or <packageFolder>/config/api-extractor.json
|
||||
// then check for a rig package
|
||||
if (packageFolder) {
|
||||
let rigConfig;
|
||||
if (options.rigConfig) {
|
||||
// The caller provided an already solved RigConfig. Double-check that it is for the right project.
|
||||
if (!node_core_library_1.Path.isEqual(options.rigConfig.projectFolderPath, packageFolder)) {
|
||||
throw new Error('The provided ILoadForFolderOptions.rigConfig is for the wrong project folder:\n' +
|
||||
'\nExpected path: ' +
|
||||
packageFolder +
|
||||
'\nProvided path: ' +
|
||||
options.rigConfig.projectFolderOriginalPath);
|
||||
}
|
||||
rigConfig = options.rigConfig;
|
||||
}
|
||||
else {
|
||||
rigConfig = rig_package_1.RigConfig.loadForProjectFolder({
|
||||
projectFolderPath: packageFolder
|
||||
});
|
||||
}
|
||||
if (rigConfig.rigFound) {
|
||||
configFilename = path.join(rigConfig.getResolvedProfileFolder(), ExtractorConfig.FILENAME);
|
||||
// If the "projectFolder" setting isn't specified in api-extractor.json, it defaults to the
|
||||
// "<lookup>" token which will probe for the tsconfig.json nearest to the api-extractor.json path.
|
||||
// But this won't work if api-extractor.json belongs to the rig. So instead "<lookup>" should be
|
||||
// the "<packageFolder>" that referenced the rig.
|
||||
projectFolderLookupToken = packageFolder;
|
||||
}
|
||||
}
|
||||
if (!node_core_library_1.FileSystem.exists(configFilename)) {
|
||||
// API Extractor does not seem to be configured for this folder
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
const configObjectFullPath = path.resolve(configFilename);
|
||||
const configObject = ExtractorConfig.loadFile(configObjectFullPath);
|
||||
return {
|
||||
configObject,
|
||||
configObjectFullPath,
|
||||
packageJsonFullPath,
|
||||
projectFolderLookupToken
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Loads the api-extractor.json config file from the specified file path, and prepares an `ExtractorConfig` object.
|
||||
*
|
||||
* @remarks
|
||||
* Loads the api-extractor.json config file from the specified file path. If the "extends" field is present,
|
||||
* the referenced file(s) will be merged. For any omitted fields, the API Extractor default values are merged.
|
||||
*
|
||||
* The result is prepared using `ExtractorConfig.prepare()`.
|
||||
*/
|
||||
static loadFileAndPrepare(configJsonFilePath) {
|
||||
const configObjectFullPath = path.resolve(configJsonFilePath);
|
||||
const configObject = ExtractorConfig.loadFile(configObjectFullPath);
|
||||
const packageJsonLookup = new node_core_library_1.PackageJsonLookup();
|
||||
const packageJsonFullPath = packageJsonLookup.tryGetPackageJsonFilePathFor(configObjectFullPath);
|
||||
const extractorConfig = ExtractorConfig.prepare({
|
||||
configObject,
|
||||
configObjectFullPath,
|
||||
packageJsonFullPath
|
||||
});
|
||||
return extractorConfig;
|
||||
}
|
||||
/**
|
||||
* Performs only the first half of {@link ExtractorConfig.loadFileAndPrepare}, providing an opportunity to
|
||||
* modify the object before it is passed to {@link ExtractorConfig.prepare}.
|
||||
*
|
||||
* @remarks
|
||||
* Loads the api-extractor.json config file from the specified file path. If the "extends" field is present,
|
||||
* the referenced file(s) will be merged. For any omitted fields, the API Extractor default values are merged.
|
||||
*/
|
||||
static loadFile(jsonFilePath) {
|
||||
// Set to keep track of config files which have been processed.
|
||||
const visitedPaths = new Set();
|
||||
let currentConfigFilePath = path.resolve(jsonFilePath);
|
||||
let configObject = {};
|
||||
// Lodash merges array values by default, which is unintuitive for config files (and makes it impossible for derived configurations to overwrite arrays).
|
||||
// For example, given a base config containing an array property with value ["foo", "bar"] and a derived config that specifies ["baz"] for that property, lodash will produce ["baz", "bar"], which is unintuitive.
|
||||
// This customizer function ensures that arrays are always overwritten.
|
||||
const mergeCustomizer = (objValue, srcValue) => {
|
||||
if (Array.isArray(srcValue)) {
|
||||
return srcValue;
|
||||
}
|
||||
// Fall back to default merge behavior.
|
||||
return undefined;
|
||||
};
|
||||
try {
|
||||
do {
|
||||
// Check if this file was already processed.
|
||||
if (visitedPaths.has(currentConfigFilePath)) {
|
||||
throw new Error(`The API Extractor "extends" setting contains a cycle.` +
|
||||
` This file is included twice: "${currentConfigFilePath}"`);
|
||||
}
|
||||
visitedPaths.add(currentConfigFilePath);
|
||||
const currentConfigFolderPath = path.dirname(currentConfigFilePath);
|
||||
// Load the extractor config defined in extends property.
|
||||
const baseConfig = node_core_library_1.JsonFile.load(currentConfigFilePath);
|
||||
let extendsField = baseConfig.extends || '';
|
||||
// Delete the "extends" field so it doesn't get merged
|
||||
delete baseConfig.extends;
|
||||
if (extendsField) {
|
||||
if (extendsField.match(/^\.\.?[\\/]/)) {
|
||||
// EXAMPLE: "./subfolder/api-extractor-base.json"
|
||||
extendsField = path.resolve(currentConfigFolderPath, extendsField);
|
||||
}
|
||||
else {
|
||||
// EXAMPLE: "my-package/api-extractor-base.json"
|
||||
//
|
||||
// Resolve "my-package" from the perspective of the current folder.
|
||||
try {
|
||||
extendsField = resolve.sync(extendsField, {
|
||||
basedir: currentConfigFolderPath
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`Error resolving NodeJS path "${extendsField}": ${e.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// This step has to be performed in advance, since the currentConfigFolderPath information will be lost
|
||||
// after lodash.merge() is performed.
|
||||
ExtractorConfig._resolveConfigFileRelativePaths(baseConfig, currentConfigFolderPath);
|
||||
// Merge extractorConfig into baseConfig, mutating baseConfig
|
||||
lodash.mergeWith(baseConfig, configObject, mergeCustomizer);
|
||||
configObject = baseConfig;
|
||||
currentConfigFilePath = extendsField;
|
||||
} while (currentConfigFilePath);
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`Error loading ${currentConfigFilePath}:\n` + e.message);
|
||||
}
|
||||
// Lastly, apply the defaults
|
||||
configObject = lodash.mergeWith(lodash.cloneDeep(ExtractorConfig._defaultConfig), configObject, mergeCustomizer);
|
||||
ExtractorConfig.jsonSchema.validateObject(configObject, jsonFilePath);
|
||||
// The schema validation should ensure that this object conforms to IConfigFile
|
||||
return configObject;
|
||||
}
|
||||
static _resolveConfigFileRelativePaths(configFile, currentConfigFolderPath) {
|
||||
if (configFile.projectFolder) {
|
||||
configFile.projectFolder = ExtractorConfig._resolveConfigFileRelativePath('projectFolder', configFile.projectFolder, currentConfigFolderPath);
|
||||
}
|
||||
if (configFile.mainEntryPointFilePath) {
|
||||
configFile.mainEntryPointFilePath = ExtractorConfig._resolveConfigFileRelativePath('mainEntryPointFilePath', configFile.mainEntryPointFilePath, currentConfigFolderPath);
|
||||
}
|
||||
if (configFile.compiler) {
|
||||
if (configFile.compiler.tsconfigFilePath) {
|
||||
configFile.compiler.tsconfigFilePath = ExtractorConfig._resolveConfigFileRelativePath('tsconfigFilePath', configFile.compiler.tsconfigFilePath, currentConfigFolderPath);
|
||||
}
|
||||
}
|
||||
if (configFile.apiReport) {
|
||||
if (configFile.apiReport.reportFolder) {
|
||||
configFile.apiReport.reportFolder = ExtractorConfig._resolveConfigFileRelativePath('reportFolder', configFile.apiReport.reportFolder, currentConfigFolderPath);
|
||||
}
|
||||
if (configFile.apiReport.reportTempFolder) {
|
||||
configFile.apiReport.reportTempFolder = ExtractorConfig._resolveConfigFileRelativePath('reportTempFolder', configFile.apiReport.reportTempFolder, currentConfigFolderPath);
|
||||
}
|
||||
}
|
||||
if (configFile.docModel) {
|
||||
if (configFile.docModel.apiJsonFilePath) {
|
||||
configFile.docModel.apiJsonFilePath = ExtractorConfig._resolveConfigFileRelativePath('apiJsonFilePath', configFile.docModel.apiJsonFilePath, currentConfigFolderPath);
|
||||
}
|
||||
}
|
||||
if (configFile.dtsRollup) {
|
||||
if (configFile.dtsRollup.untrimmedFilePath) {
|
||||
configFile.dtsRollup.untrimmedFilePath = ExtractorConfig._resolveConfigFileRelativePath('untrimmedFilePath', configFile.dtsRollup.untrimmedFilePath, currentConfigFolderPath);
|
||||
}
|
||||
if (configFile.dtsRollup.alphaTrimmedFilePath) {
|
||||
configFile.dtsRollup.alphaTrimmedFilePath = ExtractorConfig._resolveConfigFileRelativePath('alphaTrimmedFilePath', configFile.dtsRollup.alphaTrimmedFilePath, currentConfigFolderPath);
|
||||
}
|
||||
if (configFile.dtsRollup.betaTrimmedFilePath) {
|
||||
configFile.dtsRollup.betaTrimmedFilePath = ExtractorConfig._resolveConfigFileRelativePath('betaTrimmedFilePath', configFile.dtsRollup.betaTrimmedFilePath, currentConfigFolderPath);
|
||||
}
|
||||
if (configFile.dtsRollup.publicTrimmedFilePath) {
|
||||
configFile.dtsRollup.publicTrimmedFilePath = ExtractorConfig._resolveConfigFileRelativePath('publicTrimmedFilePath', configFile.dtsRollup.publicTrimmedFilePath, currentConfigFolderPath);
|
||||
}
|
||||
}
|
||||
if (configFile.tsdocMetadata) {
|
||||
if (configFile.tsdocMetadata.tsdocMetadataFilePath) {
|
||||
configFile.tsdocMetadata.tsdocMetadataFilePath = ExtractorConfig._resolveConfigFileRelativePath('tsdocMetadataFilePath', configFile.tsdocMetadata.tsdocMetadataFilePath, currentConfigFolderPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
static _resolveConfigFileRelativePath(fieldName, fieldValue, currentConfigFolderPath) {
|
||||
if (!path.isAbsolute(fieldValue)) {
|
||||
if (fieldValue.indexOf('<projectFolder>') !== 0) {
|
||||
// If the path is not absolute and does not start with "<projectFolder>", then resolve it relative
|
||||
// to the folder of the config file that it appears in
|
||||
return path.join(currentConfigFolderPath, fieldValue);
|
||||
}
|
||||
}
|
||||
return fieldValue;
|
||||
}
|
||||
/**
|
||||
* Prepares an `ExtractorConfig` object using a configuration that is provided as a runtime object,
|
||||
* rather than reading it from disk. This allows configurations to be constructed programmatically,
|
||||
* loaded from an alternate source, and/or customized after loading.
|
||||
*/
|
||||
static prepare(options) {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||||
const filenameForErrors = options.configObjectFullPath || 'the configuration object';
|
||||
const configObject = options.configObject;
|
||||
if (configObject.extends) {
|
||||
throw new Error('The IConfigFile.extends field must be expanded before calling ExtractorConfig.prepare()');
|
||||
}
|
||||
if (options.configObjectFullPath) {
|
||||
if (!path.isAbsolute(options.configObjectFullPath)) {
|
||||
throw new Error('The "configObjectFullPath" setting must be an absolute path');
|
||||
}
|
||||
}
|
||||
ExtractorConfig.jsonSchema.validateObject(configObject, filenameForErrors);
|
||||
const packageJsonFullPath = options.packageJsonFullPath;
|
||||
let packageFolder = undefined;
|
||||
let packageJson = undefined;
|
||||
if (packageJsonFullPath) {
|
||||
if (!/.json$/i.test(packageJsonFullPath)) {
|
||||
// Catch common mistakes e.g. where someone passes a folder path instead of a file path
|
||||
throw new Error('The "packageJsonFullPath" setting does not have a .json file extension');
|
||||
}
|
||||
if (!path.isAbsolute(packageJsonFullPath)) {
|
||||
throw new Error('The "packageJsonFullPath" setting must be an absolute path');
|
||||
}
|
||||
if (options.packageJson) {
|
||||
packageJson = options.packageJson;
|
||||
}
|
||||
else {
|
||||
const packageJsonLookup = new node_core_library_1.PackageJsonLookup();
|
||||
packageJson = packageJsonLookup.loadNodePackageJson(packageJsonFullPath);
|
||||
}
|
||||
packageFolder = path.dirname(packageJsonFullPath);
|
||||
}
|
||||
// "tsdocConfigFile" and "tsdocConfiguration" are prepared outside the try-catch block,
|
||||
// so that if exceptions are thrown, it will not get the "Error parsing api-extractor.json:" header
|
||||
let extractorConfigParameters;
|
||||
try {
|
||||
if (!configObject.compiler) {
|
||||
// A merged configuration should have this
|
||||
throw new Error('The "compiler" section is missing');
|
||||
}
|
||||
if (!configObject.projectFolder) {
|
||||
// A merged configuration should have this
|
||||
throw new Error('The "projectFolder" setting is missing');
|
||||
}
|
||||
let projectFolder;
|
||||
if (configObject.projectFolder.trim() === '<lookup>') {
|
||||
if (options.projectFolderLookupToken) {
|
||||
// Use the manually specified "<lookup>" value
|
||||
projectFolder = options.projectFolderLookupToken;
|
||||
if (!node_core_library_1.FileSystem.exists(options.projectFolderLookupToken)) {
|
||||
throw new Error('The specified "projectFolderLookupToken" path does not exist: ' +
|
||||
options.projectFolderLookupToken);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!options.configObjectFullPath) {
|
||||
throw new Error('The "projectFolder" setting uses the "<lookup>" token, but it cannot be expanded because' +
|
||||
' the "configObjectFullPath" setting was not specified');
|
||||
}
|
||||
// "The default value for `projectFolder` is the token `<lookup>`, which means the folder is determined
|
||||
// by traversing parent folders, starting from the folder containing api-extractor.json, and stopping
|
||||
// at the first folder that contains a tsconfig.json file. If a tsconfig.json file cannot be found in
|
||||
// this way, then an error will be reported."
|
||||
let currentFolder = path.dirname(options.configObjectFullPath);
|
||||
for (;;) {
|
||||
const tsconfigPath = path.join(currentFolder, 'tsconfig.json');
|
||||
if (node_core_library_1.FileSystem.exists(tsconfigPath)) {
|
||||
projectFolder = currentFolder;
|
||||
break;
|
||||
}
|
||||
const parentFolder = path.dirname(currentFolder);
|
||||
if (parentFolder === '' || parentFolder === currentFolder) {
|
||||
throw new Error('The "projectFolder" setting uses the "<lookup>" token, but a tsconfig.json file cannot be' +
|
||||
' found in this folder or any parent folder.');
|
||||
}
|
||||
currentFolder = parentFolder;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
ExtractorConfig._rejectAnyTokensInPath(configObject.projectFolder, 'projectFolder');
|
||||
if (!node_core_library_1.FileSystem.exists(configObject.projectFolder)) {
|
||||
throw new Error('The specified "projectFolder" path does not exist: ' + configObject.projectFolder);
|
||||
}
|
||||
projectFolder = configObject.projectFolder;
|
||||
}
|
||||
const tokenContext = {
|
||||
unscopedPackageName: 'unknown-package',
|
||||
packageName: 'unknown-package',
|
||||
projectFolder: projectFolder
|
||||
};
|
||||
if (packageJson) {
|
||||
tokenContext.packageName = packageJson.name;
|
||||
tokenContext.unscopedPackageName = node_core_library_1.PackageName.getUnscopedName(packageJson.name);
|
||||
}
|
||||
if (!configObject.mainEntryPointFilePath) {
|
||||
// A merged configuration should have this
|
||||
throw new Error('The "mainEntryPointFilePath" setting is missing');
|
||||
}
|
||||
const mainEntryPointFilePath = ExtractorConfig._resolvePathWithTokens('mainEntryPointFilePath', configObject.mainEntryPointFilePath, tokenContext);
|
||||
if (!ExtractorConfig.hasDtsFileExtension(mainEntryPointFilePath)) {
|
||||
throw new Error('The "mainEntryPointFilePath" value is not a declaration file: ' + mainEntryPointFilePath);
|
||||
}
|
||||
if (!options.ignoreMissingEntryPoint && !node_core_library_1.FileSystem.exists(mainEntryPointFilePath)) {
|
||||
throw new Error('The "mainEntryPointFilePath" path does not exist: ' + mainEntryPointFilePath);
|
||||
}
|
||||
const bundledPackages = configObject.bundledPackages || [];
|
||||
// Note: we cannot fully validate package name patterns, as the strings may contain wildcards.
|
||||
// We won't know if the entries are valid until we can compare them against the package.json "dependencies" contents.
|
||||
const tsconfigFilePath = ExtractorConfig._resolvePathWithTokens('tsconfigFilePath', configObject.compiler.tsconfigFilePath, tokenContext);
|
||||
if (configObject.compiler.overrideTsconfig === undefined) {
|
||||
if (!tsconfigFilePath) {
|
||||
throw new Error('Either the "tsconfigFilePath" or "overrideTsconfig" setting must be specified');
|
||||
}
|
||||
if (!node_core_library_1.FileSystem.exists(tsconfigFilePath)) {
|
||||
throw new Error('The file referenced by "tsconfigFilePath" does not exist: ' + tsconfigFilePath);
|
||||
}
|
||||
}
|
||||
if ((_a = configObject.apiReport) === null || _a === void 0 ? void 0 : _a.tagsToReport) {
|
||||
_validateTagsToReport(configObject.apiReport.tagsToReport);
|
||||
}
|
||||
const apiReportEnabled = (_c = (_b = configObject.apiReport) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : false;
|
||||
const apiReportIncludeForgottenExports = (_e = (_d = configObject.apiReport) === null || _d === void 0 ? void 0 : _d.includeForgottenExports) !== null && _e !== void 0 ? _e : false;
|
||||
let reportFolder = tokenContext.projectFolder;
|
||||
let reportTempFolder = tokenContext.projectFolder;
|
||||
const reportConfigs = [];
|
||||
let tagsToReport = {};
|
||||
if (apiReportEnabled) {
|
||||
// Undefined case checked above where we assign `apiReportEnabled`
|
||||
const apiReportConfig = configObject.apiReport;
|
||||
const reportFileNameSuffix = '.api.md';
|
||||
let reportFileNameBase;
|
||||
if (apiReportConfig.reportFileName) {
|
||||
if (apiReportConfig.reportFileName.indexOf('/') >= 0 ||
|
||||
apiReportConfig.reportFileName.indexOf('\\') >= 0) {
|
||||
throw new Error(`The "reportFileName" setting contains invalid characters: "${apiReportConfig.reportFileName}"`);
|
||||
}
|
||||
if (!apiReportConfig.reportFileName.endsWith(reportFileNameSuffix)) {
|
||||
// `.api.md` extension was not specified. Use provided file name base as is.
|
||||
reportFileNameBase = apiReportConfig.reportFileName;
|
||||
}
|
||||
else {
|
||||
// The system previously asked users to specify their filenames in a form containing the `.api.md` extension.
|
||||
// This guidance has changed, but to maintain backwards compatibility, we will temporarily support input
|
||||
// that ends with the `.api.md` extension specially, by stripping it out.
|
||||
// This should be removed in version 8, possibly replaced with an explicit error to help users
|
||||
// migrate their configs.
|
||||
reportFileNameBase = apiReportConfig.reportFileName.slice(0, -reportFileNameSuffix.length);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Default value
|
||||
reportFileNameBase = '<unscopedPackageName>';
|
||||
}
|
||||
const reportVariantKinds = (_f = apiReportConfig.reportVariants) !== null && _f !== void 0 ? _f : defaultApiReportVariants;
|
||||
for (const reportVariantKind of reportVariantKinds) {
|
||||
// Omit the variant kind from the "complete" report file name for simplicity and for backwards compatibility.
|
||||
const fileNameWithTokens = `${reportFileNameBase}${reportVariantKind === 'complete' ? '' : `.${reportVariantKind}`}${reportFileNameSuffix}`;
|
||||
const normalizedFileName = ExtractorConfig._expandStringWithTokens('reportFileName', fileNameWithTokens, tokenContext);
|
||||
reportConfigs.push({
|
||||
fileName: normalizedFileName,
|
||||
variant: reportVariantKind
|
||||
});
|
||||
}
|
||||
if (apiReportConfig.reportFolder) {
|
||||
reportFolder = ExtractorConfig._resolvePathWithTokens('reportFolder', apiReportConfig.reportFolder, tokenContext);
|
||||
}
|
||||
if (apiReportConfig.reportTempFolder) {
|
||||
reportTempFolder = ExtractorConfig._resolvePathWithTokens('reportTempFolder', apiReportConfig.reportTempFolder, tokenContext);
|
||||
}
|
||||
tagsToReport = {
|
||||
...defaultTagsToReport,
|
||||
...apiReportConfig.tagsToReport
|
||||
};
|
||||
}
|
||||
let docModelGenerationOptions = undefined;
|
||||
let apiJsonFilePath = '';
|
||||
let docModelIncludeForgottenExports = false;
|
||||
let projectFolderUrl;
|
||||
if ((_g = configObject.docModel) === null || _g === void 0 ? void 0 : _g.enabled) {
|
||||
apiJsonFilePath = ExtractorConfig._resolvePathWithTokens('apiJsonFilePath', configObject.docModel.apiJsonFilePath, tokenContext);
|
||||
docModelIncludeForgottenExports = !!configObject.docModel.includeForgottenExports;
|
||||
projectFolderUrl = configObject.docModel.projectFolderUrl;
|
||||
const releaseTagsToTrim = new Set();
|
||||
const releaseTagsToTrimOption = configObject.docModel.releaseTagsToTrim || ['@internal'];
|
||||
for (const releaseTagToTrim of releaseTagsToTrimOption) {
|
||||
let releaseTag;
|
||||
switch (releaseTagToTrim) {
|
||||
case '@internal': {
|
||||
releaseTag = api_extractor_model_1.ReleaseTag.Internal;
|
||||
break;
|
||||
}
|
||||
case '@alpha': {
|
||||
releaseTag = api_extractor_model_1.ReleaseTag.Alpha;
|
||||
break;
|
||||
}
|
||||
case '@beta': {
|
||||
releaseTag = api_extractor_model_1.ReleaseTag.Beta;
|
||||
break;
|
||||
}
|
||||
case '@public': {
|
||||
releaseTag = api_extractor_model_1.ReleaseTag.Public;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
throw new Error(`The release tag "${releaseTagToTrim}" is not supported`);
|
||||
}
|
||||
}
|
||||
releaseTagsToTrim.add(releaseTag);
|
||||
}
|
||||
docModelGenerationOptions = {
|
||||
releaseTagsToTrim
|
||||
};
|
||||
}
|
||||
let tsdocMetadataEnabled = false;
|
||||
let tsdocMetadataFilePath = '';
|
||||
if (configObject.tsdocMetadata) {
|
||||
tsdocMetadataEnabled = !!configObject.tsdocMetadata.enabled;
|
||||
if (tsdocMetadataEnabled) {
|
||||
tsdocMetadataFilePath = configObject.tsdocMetadata.tsdocMetadataFilePath || '';
|
||||
if (tsdocMetadataFilePath.trim() === '<lookup>') {
|
||||
if (!packageJson) {
|
||||
throw new Error('The "<lookup>" token cannot be used with the "tsdocMetadataFilePath" setting because' +
|
||||
' the "packageJson" option was not provided');
|
||||
}
|
||||
if (!packageJsonFullPath) {
|
||||
throw new Error('The "<lookup>" token cannot be used with "tsdocMetadataFilePath" because' +
|
||||
'the "packageJsonFullPath" option was not provided');
|
||||
}
|
||||
tsdocMetadataFilePath = PackageMetadataManager_1.PackageMetadataManager.resolveTsdocMetadataPath(path.dirname(packageJsonFullPath), packageJson);
|
||||
}
|
||||
else {
|
||||
tsdocMetadataFilePath = ExtractorConfig._resolvePathWithTokens('tsdocMetadataFilePath', configObject.tsdocMetadata.tsdocMetadataFilePath, tokenContext);
|
||||
}
|
||||
if (!tsdocMetadataFilePath) {
|
||||
throw new Error('The "tsdocMetadata.enabled" setting is enabled,' +
|
||||
' but "tsdocMetadataFilePath" is not specified');
|
||||
}
|
||||
}
|
||||
}
|
||||
let rollupEnabled = false;
|
||||
let untrimmedFilePath = '';
|
||||
let betaTrimmedFilePath = '';
|
||||
let alphaTrimmedFilePath = '';
|
||||
let publicTrimmedFilePath = '';
|
||||
let omitTrimmingComments = false;
|
||||
if (configObject.dtsRollup) {
|
||||
rollupEnabled = !!configObject.dtsRollup.enabled;
|
||||
untrimmedFilePath = ExtractorConfig._resolvePathWithTokens('untrimmedFilePath', configObject.dtsRollup.untrimmedFilePath, tokenContext);
|
||||
alphaTrimmedFilePath = ExtractorConfig._resolvePathWithTokens('alphaTrimmedFilePath', configObject.dtsRollup.alphaTrimmedFilePath, tokenContext);
|
||||
betaTrimmedFilePath = ExtractorConfig._resolvePathWithTokens('betaTrimmedFilePath', configObject.dtsRollup.betaTrimmedFilePath, tokenContext);
|
||||
publicTrimmedFilePath = ExtractorConfig._resolvePathWithTokens('publicTrimmedFilePath', configObject.dtsRollup.publicTrimmedFilePath, tokenContext);
|
||||
omitTrimmingComments = !!configObject.dtsRollup.omitTrimmingComments;
|
||||
}
|
||||
let newlineKind;
|
||||
switch (configObject.newlineKind) {
|
||||
case 'lf':
|
||||
newlineKind = node_core_library_1.NewlineKind.Lf;
|
||||
break;
|
||||
case 'os':
|
||||
newlineKind = node_core_library_1.NewlineKind.OsDefault;
|
||||
break;
|
||||
default:
|
||||
newlineKind = node_core_library_1.NewlineKind.CrLf;
|
||||
break;
|
||||
}
|
||||
const enumMemberOrder = (_h = configObject.enumMemberOrder) !== null && _h !== void 0 ? _h : api_extractor_model_1.EnumMemberOrder.ByName;
|
||||
extractorConfigParameters = {
|
||||
projectFolder: projectFolder,
|
||||
packageJson,
|
||||
packageFolder,
|
||||
mainEntryPointFilePath,
|
||||
bundledPackages,
|
||||
tsconfigFilePath,
|
||||
overrideTsconfig: configObject.compiler.overrideTsconfig,
|
||||
skipLibCheck: !!configObject.compiler.skipLibCheck,
|
||||
apiReportEnabled,
|
||||
reportConfigs,
|
||||
reportFolder,
|
||||
reportTempFolder,
|
||||
apiReportIncludeForgottenExports,
|
||||
tagsToReport,
|
||||
docModelGenerationOptions,
|
||||
apiJsonFilePath,
|
||||
docModelIncludeForgottenExports,
|
||||
projectFolderUrl,
|
||||
rollupEnabled,
|
||||
untrimmedFilePath,
|
||||
alphaTrimmedFilePath,
|
||||
betaTrimmedFilePath,
|
||||
publicTrimmedFilePath,
|
||||
omitTrimmingComments,
|
||||
tsdocMetadataEnabled,
|
||||
tsdocMetadataFilePath,
|
||||
newlineKind,
|
||||
messages: configObject.messages || {},
|
||||
testMode: !!configObject.testMode,
|
||||
enumMemberOrder
|
||||
};
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`Error parsing ${filenameForErrors}:\n` + e.message);
|
||||
}
|
||||
let tsdocConfigFile = options.tsdocConfigFile;
|
||||
if (!tsdocConfigFile) {
|
||||
// Example: "my-project/tsdoc.json"
|
||||
let packageTSDocConfigPath = tsdoc_config_1.TSDocConfigFile.findConfigPathForFolder(extractorConfigParameters.projectFolder);
|
||||
if (!packageTSDocConfigPath || !node_core_library_1.FileSystem.exists(packageTSDocConfigPath)) {
|
||||
// If the project does not have a tsdoc.json config file, then use API Extractor's base file.
|
||||
packageTSDocConfigPath = ExtractorConfig._tsdocBaseFilePath;
|
||||
if (!node_core_library_1.FileSystem.exists(packageTSDocConfigPath)) {
|
||||
throw new node_core_library_1.InternalError('Unable to load the built-in TSDoc config file: ' + packageTSDocConfigPath);
|
||||
}
|
||||
}
|
||||
tsdocConfigFile = tsdoc_config_1.TSDocConfigFile.loadFile(packageTSDocConfigPath);
|
||||
}
|
||||
// IMPORTANT: After calling TSDocConfigFile.loadFile(), we need to check for errors.
|
||||
if (tsdocConfigFile.hasErrors) {
|
||||
throw new Error(tsdocConfigFile.getErrorSummary());
|
||||
}
|
||||
const tsdocConfiguration = new tsdoc_1.TSDocConfiguration();
|
||||
tsdocConfigFile.configureParser(tsdocConfiguration);
|
||||
// IMPORTANT: After calling TSDocConfigFile.configureParser(), we need to check for errors a second time.
|
||||
if (tsdocConfigFile.hasErrors) {
|
||||
throw new Error(tsdocConfigFile.getErrorSummary());
|
||||
}
|
||||
return new ExtractorConfig({ ...extractorConfigParameters, tsdocConfigFile, tsdocConfiguration });
|
||||
}
|
||||
/**
|
||||
* Gets the report configuration for the "complete" (default) report configuration, if one was specified.
|
||||
*/
|
||||
_getCompleteReportConfig() {
|
||||
return this.reportConfigs.find((x) => x.variant === 'complete');
|
||||
}
|
||||
static _resolvePathWithTokens(fieldName, value, tokenContext) {
|
||||
value = ExtractorConfig._expandStringWithTokens(fieldName, value, tokenContext);
|
||||
if (value !== '') {
|
||||
value = path.resolve(tokenContext.projectFolder, value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
static _expandStringWithTokens(fieldName, value, tokenContext) {
|
||||
value = value ? value.trim() : '';
|
||||
if (value !== '') {
|
||||
value = node_core_library_1.Text.replaceAll(value, '<unscopedPackageName>', tokenContext.unscopedPackageName);
|
||||
value = node_core_library_1.Text.replaceAll(value, '<packageName>', tokenContext.packageName);
|
||||
const projectFolderToken = '<projectFolder>';
|
||||
if (value.indexOf(projectFolderToken) === 0) {
|
||||
// Replace "<projectFolder>" at the start of a string
|
||||
value = path.join(tokenContext.projectFolder, value.substr(projectFolderToken.length));
|
||||
}
|
||||
if (value.indexOf(projectFolderToken) >= 0) {
|
||||
// If after all replacements, "<projectFolder>" appears somewhere in the string, report an error
|
||||
throw new Error(`The "${fieldName}" value incorrectly uses the "<projectFolder>" token.` +
|
||||
` It must appear at the start of the string.`);
|
||||
}
|
||||
if (value.indexOf('<lookup>') >= 0) {
|
||||
throw new Error(`The "${fieldName}" value incorrectly uses the "<lookup>" token`);
|
||||
}
|
||||
ExtractorConfig._rejectAnyTokensInPath(value, fieldName);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* Returns true if the specified file path has the ".d.ts" file extension.
|
||||
*/
|
||||
static hasDtsFileExtension(filePath) {
|
||||
return ExtractorConfig._declarationFileExtensionRegExp.test(filePath);
|
||||
}
|
||||
/**
|
||||
* Given a path string that may have originally contained expandable tokens such as `<projectFolder>"`
|
||||
* this reports an error if any token-looking substrings remain after expansion (e.g. `c:\blah\<invalid>\blah`).
|
||||
*/
|
||||
static _rejectAnyTokensInPath(value, fieldName) {
|
||||
if (value.indexOf('<') < 0 && value.indexOf('>') < 0) {
|
||||
return;
|
||||
}
|
||||
// Can we determine the name of a token?
|
||||
const tokenRegExp = /(\<[^<]*?\>)/;
|
||||
const match = tokenRegExp.exec(value);
|
||||
if (match) {
|
||||
throw new Error(`The "${fieldName}" value contains an unrecognized token "${match[1]}"`);
|
||||
}
|
||||
throw new Error(`The "${fieldName}" value contains extra token characters ("<" or ">"): ${value}`);
|
||||
}
|
||||
}
|
||||
exports.ExtractorConfig = ExtractorConfig;
|
||||
/**
|
||||
* The JSON Schema for API Extractor config file (api-extractor.schema.json).
|
||||
*/
|
||||
ExtractorConfig.jsonSchema = node_core_library_1.JsonSchema.fromLoadedObject(api_extractor_schema_json_1.default);
|
||||
/**
|
||||
* The config file name "api-extractor.json".
|
||||
*/
|
||||
ExtractorConfig.FILENAME = 'api-extractor.json';
|
||||
/**
|
||||
* The full path to `extends/tsdoc-base.json` which contains the standard TSDoc configuration
|
||||
* for API Extractor.
|
||||
* @internal
|
||||
*/
|
||||
ExtractorConfig._tsdocBaseFilePath = path.resolve(__dirname, '../../extends/tsdoc-base.json');
|
||||
ExtractorConfig._defaultConfig = node_core_library_1.JsonFile.load(path.join(__dirname, '../schemas/api-extractor-defaults.json'));
|
||||
/** Match all three flavors for type declaration files (.d.ts, .d.mts, .d.cts) */
|
||||
ExtractorConfig._declarationFileExtensionRegExp = /\.d\.(c|m)?ts$/i;
|
||||
const releaseTags = new Set(['@public', '@alpha', '@beta', '@internal']);
|
||||
/**
|
||||
* Validate {@link ExtractorConfig.tagsToReport}.
|
||||
*/
|
||||
function _validateTagsToReport(tagsToReport) {
|
||||
const includedReleaseTags = [];
|
||||
const invalidTags = []; // tag name, error
|
||||
for (const tag of Object.keys(tagsToReport)) {
|
||||
if (releaseTags.has(tag)) {
|
||||
// If a release tags is specified, regardless of whether it is enabled, we will throw an error.
|
||||
// Release tags must not be specified.
|
||||
includedReleaseTags.push(tag);
|
||||
}
|
||||
// If the tag is invalid, generate an error string from the inner error message.
|
||||
try {
|
||||
tsdoc_1.TSDocTagDefinition.validateTSDocTagName(tag);
|
||||
}
|
||||
catch (error) {
|
||||
invalidTags.push([tag, error.message]);
|
||||
}
|
||||
}
|
||||
const errorMessages = [];
|
||||
for (const includedReleaseTag of includedReleaseTags) {
|
||||
errorMessages.push(`${includedReleaseTag}: Release tags are always included in API reports and must not be specified`);
|
||||
}
|
||||
for (const [invalidTag, innerError] of invalidTags) {
|
||||
errorMessages.push(`${invalidTag}: ${innerError}`);
|
||||
}
|
||||
if (errorMessages.length > 0) {
|
||||
const errorMessage = [
|
||||
`"tagsToReport" contained one or more invalid tags:`,
|
||||
...errorMessages
|
||||
].join('\n\t- ');
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=ExtractorConfig.js.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorConfig.js.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorConfig.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
43
node_modules/@microsoft/api-extractor/lib/api/ExtractorLogLevel.d.ts
generated
vendored
Normal file
43
node_modules/@microsoft/api-extractor/lib/api/ExtractorLogLevel.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Used with {@link IConfigMessageReportingRule.logLevel} and {@link IExtractorInvokeOptions.messageCallback}.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export declare enum ExtractorLogLevel {
|
||||
/**
|
||||
* The message will be displayed as an error.
|
||||
*
|
||||
* @remarks
|
||||
* Errors typically cause the build to fail and return a nonzero exit code.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
Info = "info",
|
||||
/**
|
||||
* The message will be displayed only when "verbose" output is requested, e.g. using the `--verbose`
|
||||
* command line option.
|
||||
*/
|
||||
Verbose = "verbose",
|
||||
/**
|
||||
* The message will be discarded entirely.
|
||||
*/
|
||||
None = "none"
|
||||
}
|
||||
//# sourceMappingURL=ExtractorLogLevel.d.ts.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorLogLevel.d.ts.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorLogLevel.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ExtractorLogLevel.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorLogLevel.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B;;;;;OAKG;IACH,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,OAAO,YAAY;IAEnB;;;;;;OAMG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,IAAI,SAAS;CACd"}
|
||||
49
node_modules/@microsoft/api-extractor/lib/api/ExtractorLogLevel.js
generated
vendored
Normal file
49
node_modules/@microsoft/api-extractor/lib/api/ExtractorLogLevel.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
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
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorLogLevel.js.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorLogLevel.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ExtractorLogLevel.js","sourceRoot":"","sources":["../../src/api/ExtractorLogLevel.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;GAOG;AACH,IAAY,iBAqCX;AArCD,WAAY,iBAAiB;IAC3B;;;;;OAKG;IACH,oCAAe,CAAA;IAEf;;;;;;OAMG;IACH,wCAAmB,CAAA;IAEnB;;;;;;OAMG;IACH,kCAAa,CAAA;IAEb;;;OAGG;IACH,wCAAmB,CAAA;IAEnB;;OAEG;IACH,kCAAa,CAAA;AACf,CAAC,EArCW,iBAAiB,iCAAjB,iBAAiB,QAqC5B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * Used with {@link IConfigMessageReportingRule.logLevel} and {@link IExtractorInvokeOptions.messageCallback}.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport enum ExtractorLogLevel {\n /**\n * The message will be displayed as an error.\n *\n * @remarks\n * Errors typically cause the build to fail and return a nonzero exit code.\n */\n Error = 'error',\n\n /**\n * The message will be displayed as an warning.\n *\n * @remarks\n * Warnings typically cause a production build fail and return a nonzero exit code. For a non-production build\n * (e.g. using the `--local` option with `api-extractor run`), the warning is displayed but the build will not fail.\n */\n Warning = 'warning',\n\n /**\n * The message will be displayed as an informational message.\n *\n * @remarks\n * Informational messages may contain newlines to ensure nice formatting of the output,\n * however word-wrapping is the responsibility of the message handler.\n */\n Info = 'info',\n\n /**\n * The message will be displayed only when \"verbose\" output is requested, e.g. using the `--verbose`\n * command line option.\n */\n Verbose = 'verbose',\n\n /**\n * The message will be discarded entirely.\n */\n None = 'none'\n}\n"]}
|
||||
155
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessage.d.ts
generated
vendored
Normal file
155
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
import type * as tsdoc from '@microsoft/tsdoc';
|
||||
import type { ExtractorMessageId } from './ExtractorMessageId';
|
||||
import { ExtractorLogLevel } from './ExtractorLogLevel';
|
||||
import type { ConsoleMessageId } from './ConsoleMessageId';
|
||||
/**
|
||||
* Used by {@link ExtractorMessage.properties}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IExtractorMessageProperties {
|
||||
/**
|
||||
* A declaration can have multiple names if it is exported more than once.
|
||||
* If an `ExtractorMessage` applies to a specific export name, this property can indicate that.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* Used by {@link ExtractorMessageId.InternalMissingUnderscore}.
|
||||
*/
|
||||
readonly exportName?: string;
|
||||
}
|
||||
/**
|
||||
* Specifies a category of messages for use with {@link ExtractorMessage}.
|
||||
* @public
|
||||
*/
|
||||
export declare enum ExtractorMessageCategory {
|
||||
/**
|
||||
* Messages originating from the TypeScript compiler.
|
||||
*
|
||||
* @remarks
|
||||
* These strings begin with the prefix "TS" and have a numeric error code.
|
||||
* Example: `TS2551`
|
||||
*/
|
||||
Compiler = "Compiler",
|
||||
/**
|
||||
* Messages related to parsing of TSDoc comments.
|
||||
*
|
||||
* @remarks
|
||||
* These strings begin with the prefix "tsdoc-".
|
||||
* Example: `tsdoc-link-tag-unescaped-text`
|
||||
*/
|
||||
TSDoc = "TSDoc",
|
||||
/**
|
||||
* Messages related to API Extractor's analysis.
|
||||
*
|
||||
* @remarks
|
||||
* These strings begin with the prefix "ae-".
|
||||
* Example: `ae-extra-release-tag`
|
||||
*/
|
||||
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`
|
||||
*/
|
||||
Console = "console"
|
||||
}
|
||||
/**
|
||||
* Constructor options for `ExtractorMessage`.
|
||||
*/
|
||||
export interface IExtractorMessageOptions {
|
||||
category: ExtractorMessageCategory;
|
||||
messageId: tsdoc.TSDocMessageId | ExtractorMessageId | ConsoleMessageId | string;
|
||||
text: string;
|
||||
sourceFilePath?: string;
|
||||
sourceFileLine?: number;
|
||||
sourceFileColumn?: number;
|
||||
properties?: IExtractorMessageProperties;
|
||||
logLevel?: ExtractorLogLevel;
|
||||
}
|
||||
/**
|
||||
* This object is used to report an error or warning that occurred during API Extractor's analysis.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export declare class ExtractorMessage {
|
||||
private _handled;
|
||||
private _logLevel;
|
||||
/**
|
||||
* The category of issue.
|
||||
*/
|
||||
readonly category: ExtractorMessageCategory;
|
||||
/**
|
||||
* A text string that uniquely identifies the issue type. This identifier can be used to suppress
|
||||
* or configure the reporting of issues, and also to search for help about an issue.
|
||||
*/
|
||||
readonly messageId: tsdoc.TSDocMessageId | ExtractorMessageId | ConsoleMessageId | string;
|
||||
/**
|
||||
* The text description of this issue.
|
||||
*/
|
||||
readonly text: string;
|
||||
/**
|
||||
* The absolute path to the affected input source file, if there is one.
|
||||
*/
|
||||
readonly sourceFilePath: string | undefined;
|
||||
/**
|
||||
* The line number where the issue occurred in the input source file. This is not used if `sourceFilePath`
|
||||
* is undefined. The first line number is 1.
|
||||
*/
|
||||
readonly sourceFileLine: number | undefined;
|
||||
/**
|
||||
* The column number where the issue occurred in the input source file. This is not used if `sourceFilePath`
|
||||
* is undefined. The first column number is 1.
|
||||
*/
|
||||
readonly sourceFileColumn: number | undefined;
|
||||
/**
|
||||
* Additional contextual information about the message that may be useful when reporting errors.
|
||||
* All properties are optional.
|
||||
*/
|
||||
readonly properties: IExtractorMessageProperties;
|
||||
/** @internal */
|
||||
constructor(options: IExtractorMessageOptions);
|
||||
/**
|
||||
* If the {@link IExtractorInvokeOptions.messageCallback} sets this property to true, it will prevent the message
|
||||
* from being displayed by API Extractor.
|
||||
*
|
||||
* @remarks
|
||||
* If the `messageCallback` routes the message to a custom handler (e.g. a toolchain logger), it should
|
||||
* assign `handled = true` to prevent API Extractor from displaying it. Assigning `handled = true` for all messages
|
||||
* would effectively disable all console output from the `Extractor` API.
|
||||
*
|
||||
* If `handled` is set to true, the message will still be included in the count of errors/warnings;
|
||||
* to discard a message entirely, instead assign `logLevel = none`.
|
||||
*/
|
||||
get handled(): boolean;
|
||||
set handled(value: boolean);
|
||||
/**
|
||||
* Specifies how the message should be reported.
|
||||
*
|
||||
* @remarks
|
||||
* If the {@link IExtractorInvokeOptions.messageCallback} handles the message (i.e. sets `handled = true`),
|
||||
* it can use the `logLevel` to determine how to display the message.
|
||||
*
|
||||
* Alternatively, if API Extractor is handling the message, the `messageCallback` could assign `logLevel` to change
|
||||
* how it will be processed. However, in general the recommended practice is to configure message routing
|
||||
* using the `messages` section in api-extractor.json.
|
||||
*
|
||||
* To discard a message entirely, assign `logLevel = none`.
|
||||
*/
|
||||
get logLevel(): ExtractorLogLevel;
|
||||
set logLevel(value: ExtractorLogLevel);
|
||||
/**
|
||||
* Returns the message formatted with its identifier and file position.
|
||||
* @remarks
|
||||
* Example:
|
||||
* ```
|
||||
* src/folder/File.ts:123:4 - (ae-extra-release-tag) The doc comment should not contain more than one release tag.
|
||||
* ```
|
||||
*/
|
||||
formatMessageWithLocation(workingPackageFolderPath: string | undefined): string;
|
||||
formatMessageWithoutLocation(): string;
|
||||
}
|
||||
//# sourceMappingURL=ExtractorMessage.d.ts.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessage.d.ts.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ExtractorMessage.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorMessage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,oBAAY,wBAAwB;IAClC;;;;;;OAMG;IACH,QAAQ,aAAa;IAErB;;;;;;OAMG;IACH,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,SAAS,cAAc;IAEvB;;;;;;;OAOG;IACH,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,cAAc,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,MAAM,CAAC;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,SAAS,CAAoB;IAErC;;OAEG;IACH,SAAgB,QAAQ,EAAE,wBAAwB,CAAC;IAEnD;;;OAGG;IACH,SAAgB,SAAS,EAAE,KAAK,CAAC,cAAc,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,MAAM,CAAC;IAEjG;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,SAAgB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnD;;;OAGG;IACH,SAAgB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnD;;;OAGG;IACH,SAAgB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IAErD;;;OAGG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD,gBAAgB;gBACG,OAAO,EAAE,wBAAwB;IAapD;;;;;;;;;;;OAWG;IACH,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAOhC;IAED;;;;;;;;;;;;OAYG;IACH,IAAW,QAAQ,IAAI,iBAAiB,CAEvC;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAY3C;IAED;;;;;;;OAOG;IACI,yBAAyB,CAAC,wBAAwB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IAoB/E,4BAA4B,IAAI,MAAM;CAG9C"}
|
||||
144
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessage.js
generated
vendored
Normal file
144
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessage.js
generated
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
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.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
class ExtractorMessage {
|
||||
/** @internal */
|
||||
constructor(options) {
|
||||
this.category = options.category;
|
||||
this.messageId = options.messageId;
|
||||
this.text = options.text;
|
||||
this.sourceFilePath = options.sourceFilePath;
|
||||
this.sourceFileLine = options.sourceFileLine;
|
||||
this.sourceFileColumn = options.sourceFileColumn;
|
||||
this.properties = options.properties || {};
|
||||
this._handled = false;
|
||||
this._logLevel = options.logLevel || ExtractorLogLevel_1.ExtractorLogLevel.None;
|
||||
}
|
||||
/**
|
||||
* If the {@link IExtractorInvokeOptions.messageCallback} sets this property to true, it will prevent the message
|
||||
* from being displayed by API Extractor.
|
||||
*
|
||||
* @remarks
|
||||
* If the `messageCallback` routes the message to a custom handler (e.g. a toolchain logger), it should
|
||||
* assign `handled = true` to prevent API Extractor from displaying it. Assigning `handled = true` for all messages
|
||||
* would effectively disable all console output from the `Extractor` API.
|
||||
*
|
||||
* If `handled` is set to true, the message will still be included in the count of errors/warnings;
|
||||
* to discard a message entirely, instead assign `logLevel = none`.
|
||||
*/
|
||||
get handled() {
|
||||
return this._handled;
|
||||
}
|
||||
set handled(value) {
|
||||
if (this._handled && !value) {
|
||||
throw new Error('One a message has been marked as handled, the "handled" property cannot be set to false');
|
||||
}
|
||||
this._handled = value;
|
||||
}
|
||||
/**
|
||||
* Specifies how the message should be reported.
|
||||
*
|
||||
* @remarks
|
||||
* If the {@link IExtractorInvokeOptions.messageCallback} handles the message (i.e. sets `handled = true`),
|
||||
* it can use the `logLevel` to determine how to display the message.
|
||||
*
|
||||
* Alternatively, if API Extractor is handling the message, the `messageCallback` could assign `logLevel` to change
|
||||
* how it will be processed. However, in general the recommended practice is to configure message routing
|
||||
* using the `messages` section in api-extractor.json.
|
||||
*
|
||||
* To discard a message entirely, assign `logLevel = none`.
|
||||
*/
|
||||
get logLevel() {
|
||||
return this._logLevel;
|
||||
}
|
||||
set logLevel(value) {
|
||||
switch (value) {
|
||||
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;
|
||||
default:
|
||||
throw new Error('Invalid log level');
|
||||
}
|
||||
this._logLevel = value;
|
||||
}
|
||||
/**
|
||||
* Returns the message formatted with its identifier and file position.
|
||||
* @remarks
|
||||
* Example:
|
||||
* ```
|
||||
* src/folder/File.ts:123:4 - (ae-extra-release-tag) The doc comment should not contain more than one release tag.
|
||||
* ```
|
||||
*/
|
||||
formatMessageWithLocation(workingPackageFolderPath) {
|
||||
let result = '';
|
||||
if (this.sourceFilePath) {
|
||||
result += SourceFileLocationFormatter_1.SourceFileLocationFormatter.formatPath(this.sourceFilePath, {
|
||||
sourceFileLine: this.sourceFileLine,
|
||||
sourceFileColumn: this.sourceFileColumn,
|
||||
workingPackageFolderPath
|
||||
});
|
||||
if (result.length > 0) {
|
||||
result += ' - ';
|
||||
}
|
||||
}
|
||||
result += this.formatMessageWithoutLocation();
|
||||
return result;
|
||||
}
|
||||
formatMessageWithoutLocation() {
|
||||
return `(${this.messageId}) ${this.text}`;
|
||||
}
|
||||
}
|
||||
exports.ExtractorMessage = ExtractorMessage;
|
||||
//# sourceMappingURL=ExtractorMessage.js.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessage.js.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessage.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
106
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessageId.d.ts
generated
vendored
Normal file
106
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessageId.d.ts
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
export declare enum ExtractorMessageId {
|
||||
/**
|
||||
* "The doc comment should not contain more than one release tag."
|
||||
*/
|
||||
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"
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
Undocumented = "ae-undocumented",
|
||||
/**
|
||||
* "This symbol has another declaration with a different release tag."
|
||||
*/
|
||||
DifferentReleaseTags = "ae-different-release-tags",
|
||||
/**
|
||||
* "The symbol ___ is marked as ___, but its signature references ___ which is marked as ___."
|
||||
*/
|
||||
IncompatibleReleaseTags = "ae-incompatible-release-tags",
|
||||
/**
|
||||
* "___ is part of the package's API, but it is missing a release tag (`@alpha`, `@beta`, `@public`, or `@internal`)."
|
||||
*/
|
||||
MissingReleaseTag = "ae-missing-release-tag",
|
||||
/**
|
||||
* "The `@packageDocumentation` comment must appear at the top of entry point *.d.ts file."
|
||||
*/
|
||||
MisplacedPackageTag = "ae-misplaced-package-tag",
|
||||
/**
|
||||
* "The symbol ___ needs to be exported by the entry point ___."
|
||||
*/
|
||||
ForgottenExport = "ae-forgotten-export",
|
||||
/**
|
||||
* "The name ___ should be prefixed with an underscore because the declaration is marked as `@internal`."
|
||||
*/
|
||||
InternalMissingUnderscore = "ae-internal-missing-underscore",
|
||||
/**
|
||||
* "Mixed release tags are not allowed for ___ because one of its declarations is marked as `@internal`."
|
||||
*/
|
||||
InternalMixedReleaseTag = "ae-internal-mixed-release-tag",
|
||||
/**
|
||||
* "The `@preapproved` tag cannot be applied to ___ because it is not a supported declaration type."
|
||||
*/
|
||||
PreapprovedUnsupportedType = "ae-preapproved-unsupported-type",
|
||||
/**
|
||||
* "The `@preapproved` tag cannot be applied to ___ without an `@internal` release tag."
|
||||
*/
|
||||
PreapprovedBadReleaseTag = "ae-preapproved-bad-release-tag",
|
||||
/**
|
||||
* "The `@inheritDoc` reference could not be resolved."
|
||||
*/
|
||||
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}`.
|
||||
*/
|
||||
UnresolvedInheritDocBase = "ae-unresolved-inheritdoc-base",
|
||||
/**
|
||||
* "The `@inheritDoc` tag for ___ refers to its own declaration."
|
||||
*/
|
||||
CyclicInheritDoc = "ae-cyclic-inherit-doc",
|
||||
/**
|
||||
* "The `@link` reference could not be resolved."
|
||||
*/
|
||||
UnresolvedLink = "ae-unresolved-link",
|
||||
/**
|
||||
* "The doc comment for the property ___ must appear on the getter, not the setter."
|
||||
*/
|
||||
SetterWithDocs = "ae-setter-with-docs",
|
||||
/**
|
||||
* "The property ___ has a setter but no getter."
|
||||
*/
|
||||
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`"
|
||||
*/
|
||||
WrongInputFileType = "ae-wrong-input-file-type"
|
||||
}
|
||||
export declare const allExtractorMessageIds: Set<string>;
|
||||
//# sourceMappingURL=ExtractorMessageId.d.ts.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessageId.d.ts.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessageId.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ExtractorMessageId.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorMessageId.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,eAAe,yBAAyB;IAExC;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,oBAAoB;IAEhC;;OAEG;IACH,oBAAoB,8BAA8B;IAElD;;OAEG;IACH,uBAAuB,iCAAiC;IAExD;;OAEG;IACH,iBAAiB,2BAA2B;IAE5C;;OAEG;IACH,mBAAmB,6BAA6B;IAEhD;;OAEG;IACH,eAAe,wBAAwB;IAEvC;;OAEG;IACH,yBAAyB,mCAAmC;IAE5D;;OAEG;IACH,uBAAuB,kCAAkC;IAEzD;;OAEG;IACH,0BAA0B,oCAAoC;IAE9D;;OAEG;IACH,wBAAwB,mCAAmC;IAE3D;;OAEG;IACH,6BAA6B,uCAAuC;IAEpE;;;;;;;OAOG;IACH,wBAAwB,kCAAkC;IAE1D;;OAEG;IACH,gBAAgB,0BAA0B;IAE1C;;OAEG;IACH,cAAc,uBAAuB;IAErC;;OAEG;IACH,cAAc,wBAAwB;IAEtC;;OAEG;IACH,aAAa,sBAAsB;IAEnC;;;OAGG;IACH,kBAAkB,6BAA6B;CAChD;AAED,eAAO,MAAM,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAmB7C,CAAC"}
|
||||
131
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessageId.js
generated
vendored
Normal file
131
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessageId.js
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
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([
|
||||
'ae-extra-release-tag',
|
||||
'ae-undocumented',
|
||||
'ae-different-release-tags',
|
||||
'ae-incompatible-release-tags',
|
||||
'ae-missing-release-tag',
|
||||
'ae-misplaced-package-tag',
|
||||
'ae-forgotten-export',
|
||||
'ae-internal-missing-underscore',
|
||||
'ae-internal-mixed-release-tag',
|
||||
'ae-preapproved-unsupported-type',
|
||||
'ae-preapproved-bad-release-tag',
|
||||
'ae-unresolved-inheritdoc-reference',
|
||||
'ae-unresolved-inheritdoc-base',
|
||||
'ae-cyclic-inherit-doc',
|
||||
'ae-unresolved-link',
|
||||
'ae-setter-with-docs',
|
||||
'ae-missing-getter',
|
||||
'ae-wrong-input-file-type'
|
||||
]);
|
||||
//# sourceMappingURL=ExtractorMessageId.js.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessageId.js.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/ExtractorMessageId.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
499
node_modules/@microsoft/api-extractor/lib/api/IConfigFile.d.ts
generated
vendored
Normal file
499
node_modules/@microsoft/api-extractor/lib/api/IConfigFile.d.ts
generated
vendored
Normal file
@@ -0,0 +1,499 @@
|
||||
import type { EnumMemberOrder } from '@microsoft/api-extractor-model';
|
||||
import type { ExtractorLogLevel } from './ExtractorLogLevel';
|
||||
/**
|
||||
* Determines how the TypeScript compiler engine will be invoked by API Extractor.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IConfigCompiler {
|
||||
/**
|
||||
* Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
|
||||
*
|
||||
* @remarks
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*
|
||||
* Note: This setting will be ignored if `overrideTsconfig` is used.
|
||||
*/
|
||||
tsconfigFilePath?: string;
|
||||
/**
|
||||
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
|
||||
*
|
||||
* @remarks
|
||||
* The value must conform to the TypeScript tsconfig schema:
|
||||
*
|
||||
* http://json.schemastore.org/tsconfig
|
||||
*
|
||||
* If omitted, then the tsconfig.json file will instead be read from the projectFolder.
|
||||
*/
|
||||
overrideTsconfig?: {};
|
||||
/**
|
||||
* This option causes the compiler to be invoked with the `--skipLibCheck` option.
|
||||
*
|
||||
* @remarks
|
||||
* This option is not recommended and may cause API Extractor to produce incomplete or incorrect declarations,
|
||||
* but it may be required when dependencies contain declarations that are incompatible with the TypeScript engine
|
||||
* that API Extractor uses for its analysis. Where possible, the underlying issue should be fixed rather than
|
||||
* relying on skipLibCheck.
|
||||
*/
|
||||
skipLibCheck?: boolean;
|
||||
}
|
||||
/**
|
||||
* The allowed variations of API reports.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type ApiReportVariant = 'public' | 'beta' | 'alpha' | 'complete';
|
||||
/**
|
||||
* Configures how the API report files (*.api.md) will be generated.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IConfigApiReport {
|
||||
/**
|
||||
* Whether to generate an API report.
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The base filename for the API report files, to be combined with {@link IConfigApiReport.reportFolder} or
|
||||
* {@link IConfigApiReport.reportTempFolder} to produce the full file path.
|
||||
*
|
||||
* @remarks
|
||||
* The `reportFileName` should not include any path separators such as `\` or `/`. The `reportFileName` should
|
||||
* not include a file extension, since API Extractor will automatically append an appropriate file extension such
|
||||
* as `.api.md`. If the {@link IConfigApiReport.reportVariants} setting is used, then the file extension includes
|
||||
* the variant name, for example `my-report.public.api.md` or `my-report.beta.api.md`. The `complete` variant always
|
||||
* uses the simple extension `my-report.api.md`.
|
||||
*
|
||||
* Previous versions of API Extractor required `reportFileName` to include the `.api.md` extension explicitly;
|
||||
* for backwards compatibility, that is still accepted but will be discarded before applying the above rules.
|
||||
*
|
||||
* @defaultValue `<unscopedPackageName>`
|
||||
*/
|
||||
reportFileName?: string;
|
||||
/**
|
||||
* The set of report variants to generate.
|
||||
*
|
||||
* @remarks
|
||||
* To support different approval requirements for different API levels, multiple "variants" of the API report can
|
||||
* be generated. The `reportVariants` setting specifies a list of variants to be generated. If omitted,
|
||||
* by default only the `complete` variant will be generated, which includes all `@internal`, `@alpha`, `@beta`,
|
||||
* and `@public` items. Other possible variants are `alpha` (`@alpha` + `@beta` + `@public`),
|
||||
* `beta` (`@beta` + `@public`), and `public` (`@public only`).
|
||||
*
|
||||
* The resulting API report file names will be derived from the {@link IConfigApiReport.reportFileName}.
|
||||
*
|
||||
* @defaultValue `[ "complete" ]`
|
||||
*/
|
||||
reportVariants?: ApiReportVariant[];
|
||||
/**
|
||||
* Specifies the folder where the API report file is written. The file name portion is determined by
|
||||
* the `reportFileName` setting.
|
||||
*
|
||||
* @remarks
|
||||
* The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,
|
||||
* e.g. for an API review.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*/
|
||||
reportFolder?: string;
|
||||
/**
|
||||
* Specifies the folder where the temporary report file is written. The file name portion is determined by
|
||||
* the `reportFileName` setting.
|
||||
*
|
||||
* @remarks
|
||||
* After the temporary file is written to disk, it is compared with the file in the `reportFolder`.
|
||||
* If they are different, a production build will fail.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*/
|
||||
reportTempFolder?: string;
|
||||
/**
|
||||
* Whether "forgotten exports" should be included in the API report file.
|
||||
*
|
||||
* @remarks
|
||||
* Forgotten exports are declarations flagged with `ae-forgotten-export` warnings. See
|
||||
* https://api-extractor.com/pages/messages/ae-forgotten-export/ to learn more.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
*/
|
||||
includeForgottenExports?: boolean;
|
||||
/**
|
||||
* Specifies a list of {@link https://tsdoc.org/ | TSDoc} tags that should be reported in the API report file for
|
||||
* items whose documentation contains them.
|
||||
*
|
||||
* @remarks
|
||||
* Tag names must begin with `@`.
|
||||
*
|
||||
* This list may include standard TSDoc tags as well as custom ones.
|
||||
* For more information on defining custom TSDoc tags, see
|
||||
* {@link https://api-extractor.com/pages/configs/tsdoc_json/#defining-your-own-tsdoc-tags | here}.
|
||||
*
|
||||
* Note that an item's release tag will always reported; this behavior cannot be overridden.
|
||||
*
|
||||
* @defaultValue `@sealed`, `@virtual`, `@override`, `@eventProperty`, and `@deprecated`
|
||||
*
|
||||
* @example Omitting default tags
|
||||
* To omit the `@sealed` and `@virtual` tags from API reports, you would specify `tagsToReport` as follows:
|
||||
* ```json
|
||||
* "tagsToReport": {
|
||||
* "@sealed": false,
|
||||
* "@virtual": false
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @example Including additional tags
|
||||
* To include additional tags to the set included in API reports, you could specify `tagsToReport` like this:
|
||||
* ```json
|
||||
* "tagsToReport": {
|
||||
* "@customTag": true
|
||||
* }
|
||||
* ```
|
||||
* This will result in `@customTag` being included in addition to the default tags.
|
||||
*/
|
||||
tagsToReport?: Readonly<Record<`@${string}`, boolean>>;
|
||||
}
|
||||
/**
|
||||
* The allowed release tags that can be used to mark API items.
|
||||
* @public
|
||||
*/
|
||||
export type ReleaseTagForTrim = '@internal' | '@alpha' | '@beta' | '@public';
|
||||
/**
|
||||
* Configures how the doc model file (*.api.json) will be generated.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IConfigDocModel {
|
||||
/**
|
||||
* Whether to generate a doc model file.
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The output path for the doc model file. The file extension should be ".api.json".
|
||||
*
|
||||
* @remarks
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*/
|
||||
apiJsonFilePath?: string;
|
||||
/**
|
||||
* Whether "forgotten exports" should be included in the doc model file.
|
||||
*
|
||||
* @remarks
|
||||
* Forgotten exports are declarations flagged with `ae-forgotten-export` warnings. See
|
||||
* https://api-extractor.com/pages/messages/ae-forgotten-export/ to learn more.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
*/
|
||||
includeForgottenExports?: boolean;
|
||||
/**
|
||||
* The base URL where the project's source code can be viewed on a website such as GitHub or
|
||||
* Azure DevOps. This URL path corresponds to the `<projectFolder>` path on disk.
|
||||
*
|
||||
* @remarks
|
||||
* This URL is concatenated with the file paths serialized to the doc model to produce URL file paths to individual API items.
|
||||
* For example, if the `projectFolderUrl` is "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor" and an API
|
||||
* item's file path is "api/ExtractorConfig.ts", the full URL file path would be
|
||||
* "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor/api/ExtractorConfig.js".
|
||||
*
|
||||
* Can be omitted if you don't need source code links in your API documentation reference.
|
||||
*/
|
||||
projectFolderUrl?: string;
|
||||
/**
|
||||
* Specifies a list of release tags that will be trimmed from the doc model.
|
||||
*
|
||||
* @defaultValue `["@internal"]`
|
||||
*/
|
||||
releaseTagsToTrim?: ReleaseTagForTrim[];
|
||||
}
|
||||
/**
|
||||
* Configures how the .d.ts rollup file will be generated.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IConfigDtsRollup {
|
||||
/**
|
||||
* Whether to generate the .d.ts rollup file.
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated without any trimming.
|
||||
*
|
||||
* @remarks
|
||||
* This file will include all declarations that are exported by the main entry point.
|
||||
*
|
||||
* If the path is an empty string, then this file will not be written.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*/
|
||||
untrimmedFilePath?: string;
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release.
|
||||
*
|
||||
* @remarks
|
||||
* This file will include only declarations that are marked as `@public`, `@beta`, or `@alpha`.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*/
|
||||
alphaTrimmedFilePath?: string;
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
|
||||
*
|
||||
* @remarks
|
||||
* This file will include only declarations that are marked as `@public` or `@beta`.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*/
|
||||
betaTrimmedFilePath?: string;
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
|
||||
*
|
||||
* @remarks
|
||||
* This file will include only declarations that are marked as `@public`.
|
||||
*
|
||||
* If the path is an empty string, then this file will not be written.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*/
|
||||
publicTrimmedFilePath?: string;
|
||||
/**
|
||||
* When a declaration is trimmed, by default it will be replaced by a code comment such as
|
||||
* "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
|
||||
* declaration completely.
|
||||
*/
|
||||
omitTrimmingComments?: boolean;
|
||||
}
|
||||
/**
|
||||
* Configures how the tsdoc-metadata.json file will be generated.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IConfigTsdocMetadata {
|
||||
/**
|
||||
* Whether to generate the tsdoc-metadata.json file.
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Specifies where the TSDoc metadata file should be written.
|
||||
*
|
||||
* @remarks
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as `<projectFolder>`.
|
||||
*
|
||||
* The default value is `<lookup>`, which causes the path to be automatically inferred from the `tsdocMetadata`,
|
||||
* `typings` or `main` fields of the project's package.json. If none of these fields are set, the lookup
|
||||
* falls back to `tsdoc-metadata.json` in the package folder.
|
||||
*/
|
||||
tsdocMetadataFilePath?: string;
|
||||
}
|
||||
/**
|
||||
* Configures reporting for a given message identifier.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IConfigMessageReportingRule {
|
||||
/**
|
||||
* Specifies whether the message should be written to the the tool's output log.
|
||||
*
|
||||
* @remarks
|
||||
* Note that the `addToApiReportFile` property may supersede this option.
|
||||
*/
|
||||
logLevel: ExtractorLogLevel;
|
||||
/**
|
||||
* When `addToApiReportFile` is true: If API Extractor is configured to write an API report file (.api.md),
|
||||
* then the message will be written inside that file; otherwise, the message is instead logged according to
|
||||
* the `logLevel` option.
|
||||
*/
|
||||
addToApiReportFile?: boolean;
|
||||
}
|
||||
/**
|
||||
* Specifies a table of reporting rules for different message identifiers, and also the default rule used for
|
||||
* identifiers that do not appear in the table.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IConfigMessageReportingTable {
|
||||
/**
|
||||
* The key is a message identifier for the associated type of message, or "default" to specify the default policy.
|
||||
* For example, the key might be `TS2551` (a compiler message), `tsdoc-link-tag-unescaped-text` (a TSDOc message),
|
||||
* or `ae-extra-release-tag` (a message related to the API Extractor analysis).
|
||||
*/
|
||||
[messageId: string]: IConfigMessageReportingRule;
|
||||
}
|
||||
/**
|
||||
* Configures how API Extractor reports error and warning messages produced during analysis.
|
||||
*
|
||||
* @remarks
|
||||
* This is part of the {@link IConfigFile} structure.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IExtractorMessagesConfig {
|
||||
/**
|
||||
* Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the
|
||||
* input .d.ts files.
|
||||
*/
|
||||
compilerMessageReporting?: IConfigMessageReportingTable;
|
||||
/**
|
||||
* Configures handling of messages reported by API Extractor during its analysis.
|
||||
*/
|
||||
extractorMessageReporting?: IConfigMessageReportingTable;
|
||||
/**
|
||||
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
|
||||
*/
|
||||
tsdocMessageReporting?: IConfigMessageReportingTable;
|
||||
}
|
||||
/**
|
||||
* Configuration options for the API Extractor tool. These options can be constructed programmatically
|
||||
* or loaded from the api-extractor.json config file using the {@link ExtractorConfig} class.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface IConfigFile {
|
||||
/**
|
||||
* Optionally specifies another JSON config file that this file extends from. This provides a way for
|
||||
* standard settings to be shared across multiple projects.
|
||||
*
|
||||
* @remarks
|
||||
* If the path starts with `./` or `../`, the path is resolved relative to the folder of the file that contains
|
||||
* the `extends` field. Otherwise, the first path segment is interpreted as an NPM package name, and will be
|
||||
* resolved using NodeJS `require()`.
|
||||
*/
|
||||
extends?: string;
|
||||
/**
|
||||
* Determines the `<projectFolder>` token that can be used with other config file settings. The project folder
|
||||
* typically contains the tsconfig.json and package.json config files, but the path is user-defined.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting.
|
||||
*
|
||||
* The default value for `projectFolder` is the token `<lookup>`, which means the folder is determined using
|
||||
* the following heuristics:
|
||||
*
|
||||
* If the config/rig.json system is used (as defined by {@link https://www.npmjs.com/package/@rushstack/rig-package
|
||||
* | @rushstack/rig-package}), then the `<lookup>` value will be the package folder that referenced the rig.
|
||||
*
|
||||
* Otherwise, the `<lookup>` value is determined by traversing parent folders, starting from the folder containing
|
||||
* api-extractor.json, and stopping at the first folder that contains a tsconfig.json file. If a tsconfig.json file
|
||||
* cannot be found in this way, then an error will be reported.
|
||||
*/
|
||||
projectFolder?: string;
|
||||
/**
|
||||
* Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
|
||||
* analyzes the symbols exported by this module.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* The file extension must be ".d.ts" and not ".ts".
|
||||
* The path is resolved relative to the "projectFolder" location.
|
||||
*/
|
||||
mainEntryPointFilePath: string;
|
||||
/**
|
||||
* A list of NPM package names whose exports should be treated as part of this package.
|
||||
*
|
||||
* @remarks
|
||||
* Also supports glob patterns.
|
||||
* Note: glob patterns will **only** be resolved against dependencies listed in the project's package.json file.
|
||||
*
|
||||
* * This is both a safety and a performance precaution.
|
||||
*
|
||||
* Exact package names will be applied against any dependency encountered while walking the type graph, regardless of
|
||||
* dependencies listed in the package.json.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* Suppose that Webpack is used to generate a distributed bundle for the project `library1`,
|
||||
* and another NPM package `library2` is embedded in this bundle. Some types from `library2` may become part
|
||||
* of the exported API for `library1`, but by default API Extractor would generate a .d.ts rollup that explicitly
|
||||
* imports `library2`. To avoid this, we can specify:
|
||||
*
|
||||
* ```js
|
||||
* "bundledPackages": [ "library2" ],
|
||||
* ```
|
||||
*
|
||||
* This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
|
||||
* local files for `library1`.
|
||||
*/
|
||||
bundledPackages?: string[];
|
||||
/**
|
||||
* Specifies what type of newlines API Extractor should use when writing output files.
|
||||
*
|
||||
* @remarks
|
||||
* By default, the output files will be written with Windows-style newlines.
|
||||
* To use POSIX-style newlines, specify "lf" instead.
|
||||
* To use the OS's default newline kind, specify "os".
|
||||
*/
|
||||
newlineKind?: 'crlf' | 'lf' | 'os';
|
||||
/**
|
||||
* Set to true when invoking API Extractor's test harness.
|
||||
* @remarks
|
||||
* When `testMode` is true, the `toolVersion` field in the .api.json file is assigned an empty string
|
||||
* to prevent spurious diffs in output files tracked for tests.
|
||||
*/
|
||||
testMode?: boolean;
|
||||
/**
|
||||
* Specifies how API Extractor sorts members of an enum when generating the .api.json file.
|
||||
*
|
||||
* @remarks
|
||||
* By default, the output files will be sorted alphabetically, which is "by-name".
|
||||
* To keep the ordering in the source code, specify "preserve".
|
||||
*
|
||||
* @defaultValue `by-name`
|
||||
*/
|
||||
enumMemberOrder?: EnumMemberOrder;
|
||||
/**
|
||||
* {@inheritDoc IConfigCompiler}
|
||||
*/
|
||||
compiler?: IConfigCompiler;
|
||||
/**
|
||||
* {@inheritDoc IConfigApiReport}
|
||||
*/
|
||||
apiReport?: IConfigApiReport;
|
||||
/**
|
||||
* {@inheritDoc IConfigDocModel}
|
||||
*/
|
||||
docModel?: IConfigDocModel;
|
||||
/**
|
||||
* {@inheritDoc IConfigDtsRollup}
|
||||
* @beta
|
||||
*/
|
||||
dtsRollup?: IConfigDtsRollup;
|
||||
/**
|
||||
* {@inheritDoc IConfigTsdocMetadata}
|
||||
* @beta
|
||||
*/
|
||||
tsdocMetadata?: IConfigTsdocMetadata;
|
||||
/**
|
||||
* {@inheritDoc IExtractorMessagesConfig}
|
||||
*/
|
||||
messages?: IExtractorMessagesConfig;
|
||||
}
|
||||
//# sourceMappingURL=IConfigFile.d.ts.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/IConfigFile.d.ts.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/IConfigFile.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IConfigFile.d.ts","sourceRoot":"","sources":["../../src/api/IConfigFile.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,EAAE,CAAC;IAEtB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;OAeG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAEpC;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7E;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;;;;;OAUG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;OAUG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;OAKG;IACH,QAAQ,EAAE,iBAAiB,CAAC;IAE5B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,CAAC,SAAS,EAAE,MAAM,GAAG,2BAA2B,CAAC;CAClD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,4BAA4B,CAAC;IAExD;;OAEG;IACH,yBAAyB,CAAC,EAAE,4BAA4B,CAAC;IAEzD;;OAEG;IACH,qBAAqB,CAAC,EAAE,4BAA4B,CAAC;CACtD;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;;OAQG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAEnC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;;OAGG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,wBAAwB,CAAC;CACrC"}
|
||||
5
node_modules/@microsoft/api-extractor/lib/api/IConfigFile.js
generated
vendored
Normal file
5
node_modules/@microsoft/api-extractor/lib/api/IConfigFile.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=IConfigFile.js.map
|
||||
1
node_modules/@microsoft/api-extractor/lib/api/IConfigFile.js.map
generated
vendored
Normal file
1
node_modules/@microsoft/api-extractor/lib/api/IConfigFile.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user