Files
blockly/patches/@microsoft+api-documenter+7.26.26.patch
dependabot[bot] e5e32548d6 chore(deps): bump @microsoft/api-documenter from 7.26.7 to 7.26.26 (#8987)
* chore(deps): bump @microsoft/api-documenter from 7.26.7 to 7.26.26

Bumps [@microsoft/api-documenter](https://github.com/microsoft/rushstack/tree/HEAD/apps/api-documenter) from 7.26.7 to 7.26.26.
- [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/api-documenter/CHANGELOG.md)
- [Commits](https://github.com/microsoft/rushstack/commits/@microsoft/api-documenter_v7.26.26/apps/api-documenter)

---
updated-dependencies:
- dependency-name: "@microsoft/api-documenter"
  dependency-version: 7.26.26
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(deps): Update patch for api-documenter

The patch was failing to apply because the contents of the file
had moved too much.  Fixed by manually applying changes to the
file in question then running

    node_modules/.bin/patch-package @microsoft/api-documenter

to recreate the patch, then diffing old patch vs. new to verify
that contents of patch were unchanged except for chunk positions,
then deleting old patch.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2025-05-07 13:49:51 -07:00

82 lines
4.0 KiB
Diff

diff --git a/node_modules/@microsoft/api-documenter/lib/documenters/MarkdownDocumenter.js b/node_modules/@microsoft/api-documenter/lib/documenters/MarkdownDocumenter.js
index 0f4e2ba..3af2014 100644
--- a/node_modules/@microsoft/api-documenter/lib/documenters/MarkdownDocumenter.js
+++ b/node_modules/@microsoft/api-documenter/lib/documenters/MarkdownDocumenter.js
@@ -893,12 +893,15 @@ class MarkdownDocumenter {
}
_writeBreadcrumb(output, apiItem) {
const configuration = this._tsdocConfiguration;
- output.appendNodeInParagraph(new tsdoc_1.DocLinkTag({
- configuration,
- tagName: '@link',
- linkText: 'Home',
- urlDestination: this._getLinkFilenameForApiItem(this._apiModel)
- }));
+ // Don't print the first breadcrumb, because there's only one package, so we don't need the Home link.
+ // output.appendNodeInParagraph(new tsdoc_1.DocLinkTag({
+ // configuration,
+ // tagName: '@link',
+ // linkText: 'Home',
+ // urlDestination: this._getLinkFilenameForApiItem(this._apiModel)
+ // }));
+
+ let first = true;
for (const hierarchyItem of apiItem.getHierarchy()) {
switch (hierarchyItem.kind) {
case api_extractor_model_1.ApiItemKind.Model:
@@ -908,18 +911,24 @@ class MarkdownDocumenter {
// this may change in the future.
break;
default:
- output.appendNodesInParagraph([
- new tsdoc_1.DocPlainText({
- configuration,
- text: ' > '
- }),
+ if (!first) {
+ // Only print the breadcrumb separator if it's not the first item we're printing.
+ output.appendNodeInParagraph(
+ new tsdoc_1.DocPlainText({
+ configuration,
+ text: ' > '
+ })
+ );
+ }
+ first = false;
+ output.appendNodeInParagraph(
new tsdoc_1.DocLinkTag({
configuration,
tagName: '@link',
linkText: hierarchyItem.displayName,
urlDestination: this._getLinkFilenameForApiItem(hierarchyItem)
})
- ]);
+ );
}
}
}
@@ -992,11 +1001,8 @@ class MarkdownDocumenter {
// For overloaded methods, add a suffix such as "MyClass.myMethod_2".
let qualifiedName = Utilities_1.Utilities.getSafeFilenameForName(hierarchyItem.displayName);
if (api_extractor_model_1.ApiParameterListMixin.isBaseClassOf(hierarchyItem)) {
- if (hierarchyItem.overloadIndex > 1) {
- // Subtract one for compatibility with earlier releases of API Documenter.
- // (This will get revamped when we fix GitHub issue #1308)
- qualifiedName += `_${hierarchyItem.overloadIndex - 1}`;
- }
+ // https://github.com/microsoft/rushstack/issues/1921
+ qualifiedName += `_${hierarchyItem.overloadIndex}`;
}
switch (hierarchyItem.kind) {
case api_extractor_model_1.ApiItemKind.Model:
@@ -1007,7 +1013,8 @@ class MarkdownDocumenter {
baseName = Utilities_1.Utilities.getSafeFilenameForName(node_core_library_1.PackageName.getUnscopedName(hierarchyItem.displayName));
break;
default:
- baseName += '.' + qualifiedName;
+ // https://github.com/microsoft/rushstack/issues/1921
+ baseName += '.' + qualifiedName + '_' + hierarchyItem.kind.toLowerCase();
}
}
return baseName + '.md';