Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
let compilerState: CompilerState | undefined = undefined;
let anyErrors: boolean = false;
process.exitCode = 1;
for (const scenarioFolderName of buildConfig.scenarioFolderNames) {
const apiExtractorJsonPath: string = `./temp/configs/api-extractor-${scenarioFolderName}.json`;
console.log('Scenario: ' + scenarioFolderName);
// Run the API Extractor command-line
const extractorConfig: ExtractorConfig = ExtractorConfig.loadFileAndPrepare(apiExtractorJsonPath);
if (!compilerState) {
compilerState = CompilerState.create(extractorConfig, {
additionalEntryPoints: entryPoints
});
}
const extractorResult: ExtractorResult = Extractor.invoke(extractorConfig, {
localBuild: true,
showVerboseMessages: true,
messageCallback: (message: ExtractorMessage) => {
if (message.messageId === ConsoleMessageId.ApiReportCreated) {
// This script deletes the outputs for a clean build, so don't issue a warning if the file gets created
message.logLevel = ExtractorLogLevel.None;
}
},
compilerState
});
function invokeExtractor(
extractorConfig: ExtractorConfig,
options: ExtractorOptions,
) {
const compilerState = CompilerState.create(extractorConfig, {
// typescriptCompilerFolder: options.typescriptCompilerFolder,
});
/* istanbul ignore if */
if (options.dryRun) return;
const extractorResult: ExtractorResult = Extractor.invoke(extractorConfig, {
typescriptCompilerFolder: options.typescriptCompilerFolder,
localBuild: true,
showVerboseMessages: !options.silent,
messageCallback: (message: ExtractorMessage) => {
if (message.messageId === ConsoleMessageId.ApiReportCreated) {
// This script deletes the outputs for a clean build,
// so don't issue a warning if the file gets created
message.logLevel = ExtractorLogLevel.None;
}