aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/monorepo-scripts')
-rw-r--r--packages/monorepo-scripts/src/utils/publish_utils.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/monorepo-scripts/src/utils/publish_utils.ts b/packages/monorepo-scripts/src/utils/publish_utils.ts
index 7209fa344..9b5ff378e 100644
--- a/packages/monorepo-scripts/src/utils/publish_utils.ts
+++ b/packages/monorepo-scripts/src/utils/publish_utils.ts
@@ -190,10 +190,21 @@ export async function generateAndUploadDocsAsync(packageName: string, isStaging:
cwd,
});
- // For each entry, see if it was exported in index.ts. If not, remove it.
+ // Unfortunately TypeDoc children names will only be prefixed with the name of the package _if_ we passed
+ // TypeDoc files outside of the packages root path (i.e this package exports another package found in our
+ // monorepo). In order to enforce that the names are always prefixed with the package's name, we check and add
+ // it here when necessary.
const typedocOutputString = readFileSync(jsonFilePath).toString();
const typedocOutput = JSON.parse(typedocOutputString);
const finalTypeDocOutput = _.clone(typedocOutput);
+ _.each(typedocOutput.children, (child, i) => {
+ if (!_.includes(child.name, '/src/')) {
+ const nameWithoutQuotes = child.name.replace(/"/g, '');
+ finalTypeDocOutput.children[i].name = `"${packageName}/src/${nameWithoutQuotes}"`;
+ }
+ });
+
+ // For each entry, see if it was exported in index.ts. If not, remove it.
_.each(typedocOutput.children, (file, i) => {
const exportItems = findExportItemsGivenTypedocName(exportPathToExportedItems, packageName, file.name);
_.each(file.children, (child, j) => {