From a7468eb858bc730d4b7ca92260314cfa0c51416b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 21 Aug 2018 17:16:00 +0100 Subject: Don't check if types are used for libraries only include types --- packages/monorepo-scripts/src/doc_gen_configs.ts | 3 +++ .../monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'packages/monorepo-scripts/src') diff --git a/packages/monorepo-scripts/src/doc_gen_configs.ts b/packages/monorepo-scripts/src/doc_gen_configs.ts index 83fae1e7c..52cbc4f59 100644 --- a/packages/monorepo-scripts/src/doc_gen_configs.ts +++ b/packages/monorepo-scripts/src/doc_gen_configs.ts @@ -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 // config 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'], }; diff --git a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts index adb898628..cc4d70d63 100644 --- a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts +++ b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts @@ -212,10 +212,16 @@ export class DocGenerateAndUploadUtils { let modifiedTypedocOutput = this._standardizeTypedocOutputTopLevelChildNames(typedocOutput); modifiedTypedocOutput = this._pruneTypedocOutput(modifiedTypedocOutput); + if (!_.includes(docGenConfigs.TYPES_ONLY_LIBRARIES, this._packageName)) { const propertyName = ''; // Root has no property name - const referenceNames = DocGenerateAndUploadUtils._getAllReferenceNames(propertyName, modifiedTypedocOutput, []); + const referenceNames = DocGenerateAndUploadUtils._getAllReferenceNames( + propertyName, + modifiedTypedocOutput, + [], + ); this._lookForUnusedExportedTypesThrowIfExists(referenceNames, modifiedTypedocOutput); this._lookForMissingReferenceExportsThrowIfExists(referenceNames); + } // 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 -- cgit v1.2.3