Don't check if types are used for libraries only include types
This commit is contained in:
@@ -38,4 +38,7 @@ export const docGenConfigs: DocGenConfigs = {
|
|||||||
// want them exported. E.g error enum types that can be thrown by methods. These must be manually added to this
|
// want them exported. E.g error enum types that can be thrown by methods. These must be manually added to this
|
||||||
// config
|
// config
|
||||||
IGNORED_EXCESSIVE_TYPES: ['NonceSubproviderErrors', 'Web3WrapperErrors', 'ContractWrappersError', 'OrderError'],
|
IGNORED_EXCESSIVE_TYPES: ['NonceSubproviderErrors', 'Web3WrapperErrors', 'ContractWrappersError', 'OrderError'],
|
||||||
|
// Some libraries only export types. In those cases, we cannot check if the exported types are part of the
|
||||||
|
// "exported public interface". Thus we add them here and skip those checks.
|
||||||
|
TYPES_ONLY_LIBRARIES: ['ethereum-types', 'types'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -212,10 +212,16 @@ export class DocGenerateAndUploadUtils {
|
|||||||
let modifiedTypedocOutput = this._standardizeTypedocOutputTopLevelChildNames(typedocOutput);
|
let modifiedTypedocOutput = this._standardizeTypedocOutputTopLevelChildNames(typedocOutput);
|
||||||
modifiedTypedocOutput = this._pruneTypedocOutput(modifiedTypedocOutput);
|
modifiedTypedocOutput = this._pruneTypedocOutput(modifiedTypedocOutput);
|
||||||
|
|
||||||
|
if (!_.includes(docGenConfigs.TYPES_ONLY_LIBRARIES, this._packageName)) {
|
||||||
const propertyName = ''; // Root has no property name
|
const propertyName = ''; // Root has no property name
|
||||||
const referenceNames = DocGenerateAndUploadUtils._getAllReferenceNames(propertyName, modifiedTypedocOutput, []);
|
const referenceNames = DocGenerateAndUploadUtils._getAllReferenceNames(
|
||||||
|
propertyName,
|
||||||
|
modifiedTypedocOutput,
|
||||||
|
[],
|
||||||
|
);
|
||||||
this._lookForUnusedExportedTypesThrowIfExists(referenceNames, modifiedTypedocOutput);
|
this._lookForUnusedExportedTypesThrowIfExists(referenceNames, modifiedTypedocOutput);
|
||||||
this._lookForMissingReferenceExportsThrowIfExists(referenceNames);
|
this._lookForMissingReferenceExportsThrowIfExists(referenceNames);
|
||||||
|
}
|
||||||
|
|
||||||
// Some of our packages re-export external package exports in their index.ts
|
// Some of our packages re-export external package exports in their index.ts
|
||||||
// Typedoc is incapable of rendering these packages, so we need to special-case them
|
// Typedoc is incapable of rendering these packages, so we need to special-case them
|
||||||
|
|||||||
Reference in New Issue
Block a user