aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-07 03:27:28 +0800
committerFabio Berger <me@fabioberger.com>2018-08-07 03:27:28 +0800
commitfdcb42d8e17f4f5f324dd644077a07cbd4be65c7 (patch)
tree246241c4cfbdc7167063d76a2f2f8d176fe0bce0 /packages/monorepo-scripts/src/utils
parent4e6322beb55302e10770c4e16bf480e17bbf27e9 (diff)
downloaddexon-0x-contracts-fdcb42d8e17f4f5f324dd644077a07cbd4be65c7.tar
dexon-0x-contracts-fdcb42d8e17f4f5f324dd644077a07cbd4be65c7.tar.gz
dexon-0x-contracts-fdcb42d8e17f4f5f324dd644077a07cbd4be65c7.tar.bz2
dexon-0x-contracts-fdcb42d8e17f4f5f324dd644077a07cbd4be65c7.tar.lz
dexon-0x-contracts-fdcb42d8e17f4f5f324dd644077a07cbd4be65c7.tar.xz
dexon-0x-contracts-fdcb42d8e17f4f5f324dd644077a07cbd4be65c7.tar.zst
dexon-0x-contracts-fdcb42d8e17f4f5f324dd644077a07cbd4be65c7.zip
Fix bug where we only rendered one TypeDoc JSON key per export, instead of all of them
Diffstat (limited to 'packages/monorepo-scripts/src/utils')
-rw-r--r--packages/monorepo-scripts/src/utils/publish_utils.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/monorepo-scripts/src/utils/publish_utils.ts b/packages/monorepo-scripts/src/utils/publish_utils.ts
index 2cf67946b..709a48799 100644
--- a/packages/monorepo-scripts/src/utils/publish_utils.ts
+++ b/packages/monorepo-scripts/src/utils/publish_utils.ts
@@ -18,12 +18,12 @@ interface ExportInfo {
exportPathOrder: string[];
}
-interface ExportNameToTypedocName {
- [exportName: string]: string;
+interface ExportNameToTypedocNames {
+ [exportName: string]: string[];
}
interface Metadata {
- exportPathToTypedocName: ExportNameToTypedocName;
+ exportPathToTypedocNames: ExportNameToTypedocNames;
exportPathOrder: string[];
}
@@ -224,10 +224,12 @@ export async function generateAndUploadDocsAsync(packageName: string, isStaging:
});
// For each entry, see if it was exported in index.ts. If not, remove it.
- const exportPathToTypedocName: ExportNameToTypedocName = {};
+ const exportPathToTypedocNames: ExportNameToTypedocNames = {};
_.each(typedocOutput.children, (file, i) => {
const exportPath = findExportPathGivenTypedocName(exportPathToExportedItems, packageName, file.name);
- exportPathToTypedocName[exportPath] = file.name;
+ exportPathToTypedocNames[exportPath] = _.isUndefined(exportPathToTypedocNames[exportPath])
+ ? [file.name]
+ : [...exportPathToTypedocNames[exportPath], file.name];
const exportItems = exportPathToExportedItems[exportPath];
_.each(file.children, (child, j) => {
@@ -245,7 +247,7 @@ export async function generateAndUploadDocsAsync(packageName: string, isStaging:
// Since we need additional metadata included in the doc JSON, we nest the TypeDoc JSON
const docJson = {
metadata: {
- exportPathToTypedocName,
+ exportPathToTypedocNames,
exportPathOrder,
},
typedocJson: finalTypeDocOutput,