Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
enabled: !!dtsBundleOut,
untrimmedFilePath: dtsBundleOut && path.resolve(dtsBundleOut),
},
tsdocMetadata: {
enabled: false,
}
};
const options: IExtractorConfigPrepareOptions = {
configObject,
packageJson: undefined,
packageJsonFullPath: pkgJson,
configObjectFullPath: undefined,
};
const extractorConfig = ExtractorConfig.prepare(options);
const {succeeded} = Extractor.invoke(extractorConfig, extractorOptions);
// API extractor errors are emitted by it's logger.
return succeeded ? 0 : 1;
}
const configObject = ExtractorConfig.loadFile(
path.join(projectRoot, "api-extractor.json")
);
configObject.mainEntryPointFilePath = entrypoint;
configObject.projectFolder = path.join(projectRoot, `packages/${p}`);
configObject.dtsRollup.enabled = true;
configObject.dtsRollup.untrimmedFilePath = path.join(
projectRoot,
`packages/${p}/index.d.ts`
);
configObject.docModel.apiJsonFilePath = path.join(
projectRoot,
`temp/${p}.api.json`
);
const extractorConfig = ExtractorConfig.prepare({
configObject,
packageJsonFullPath: path.join(projectRoot, `packages/${p}/package.json`),
});
const extractorResult = Extractor.invoke(extractorConfig, {
localBuild: true,
showVerboseMessages: true,
});
if (
!extractorResult.succeeded ||
extractorResult.errorCount > 0 ||
extractorResult.warningCount > 0
) {
console.error(
`API Extractor completed with ${extractorResult.errorCount} errors` +
function buildExtractorConfig(pkg: LernaPackage, options: ExtractorOptions) {
const configObj: IConfigFile = createRawExtractorConfig(pkg, options);
const extractorConfig = ExtractorConfig.prepare({
configObject: configObj,
configObjectFullPath: '',
packageJsonFullPath: pkg.manifestLocation,
});
return extractorConfig;
}
enabled: false,
},
messages: {
extractorMessageReporting: {
default: {
logLevel: 'warning' as ExtractorLogLevel.Warning,
addToApiReportFile: true,
},
'ae-internal-missing-underscore': {
logLevel: 'none' as ExtractorLogLevel.None,
addToApiReportFile: false,
},
},
},
};
const con = ExtractorConfig.prepare({
configObject: config,
configObjectFullPath: undefined,
packageJsonFullPath: path.resolve('package.json'),
});
return con;
};