Implement ignoring config types
This commit is contained in:
parent
e7c7af8ef4
commit
635373febb
@ -55,6 +55,7 @@ export interface DocGenConfigs {
|
|||||||
EXTERNAL_TYPE_TO_LINK: { [externalType: string]: string };
|
EXTERNAL_TYPE_TO_LINK: { [externalType: string]: string };
|
||||||
EXTERNAL_EXPORT_TO_LINK: { [externalExport: string]: string };
|
EXTERNAL_EXPORT_TO_LINK: { [externalExport: string]: string };
|
||||||
CLASSES_WITH_HIDDEN_CONSTRUCTORS: string[];
|
CLASSES_WITH_HIDDEN_CONSTRUCTORS: string[];
|
||||||
|
IGNORED_EXCESSIVE_TYPES: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ExportPathToExportedItems {
|
export interface ExportPathToExportedItems {
|
||||||
|
@ -308,9 +308,13 @@ export class DocGenerateAndUploadUtils {
|
|||||||
private _lookForUnusedExportedTypesThrowIfExists(referenceNames: string[], typedocOutput: any): void {
|
private _lookForUnusedExportedTypesThrowIfExists(referenceNames: string[], typedocOutput: any): void {
|
||||||
const exportedTypes = DocGenerateAndUploadUtils._getAllTypeNames(typedocOutput, []);
|
const exportedTypes = DocGenerateAndUploadUtils._getAllTypeNames(typedocOutput, []);
|
||||||
const excessiveReferences = _.difference(exportedTypes, referenceNames);
|
const excessiveReferences = _.difference(exportedTypes, referenceNames);
|
||||||
if (!_.isEmpty(excessiveReferences)) {
|
const excessiveReferencesExceptIgnored = _.difference(
|
||||||
|
excessiveReferences,
|
||||||
|
docGenConfigs.IGNORED_EXCESSIVE_TYPES,
|
||||||
|
);
|
||||||
|
if (!_.isEmpty(excessiveReferencesExceptIgnored)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`${this._packageName} package exports BUT does not need: \n${excessiveReferences.join(
|
`${this._packageName} package exports BUT does not need: \n${excessiveReferencesExceptIgnored.join(
|
||||||
'\n',
|
'\n',
|
||||||
)} \nin it\'s index.ts. Remove them then try again.`,
|
)} \nin it\'s index.ts. Remove them then try again.`,
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user