Skip to content

Commit

Permalink
fix: apply review feedbacks
Browse files Browse the repository at this point in the history
Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
  • Loading branch information
AllanZhengYP and trivikr authored Nov 18, 2020
1 parent 45451c0 commit 690fea5
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class SdkClientCommentUpdatePlugin extends ConverterComponent {
}

/**
* Update documentation block to exclude empty lines
* Update documentation block to exclude empty lines.
*/
private cleanEmptyCommentLines(comment: string): string {
return comment.startsWith("/*") && comment.endsWith("*/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component, RendererComponent } from "typedoc/dist/lib/output/components
import { RendererEvent } from "typedoc/dist/lib/output/events";

/**
* Correct the package name in the navigator
* Correct the package name in the navigator.
*/
@Component({ name: "SdkClientRenameProject" })
export class SdkClientRenameProjectPlugin extends RendererComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PageEvent } from "typedoc/dist/lib/output/events";
import { NavigationItem } from "typedoc/dist/lib/output/models/NavigationItem";

/**
* Group the ToC for easier observability
* Group the ToC for easier observability.
*/
@Component({ name: "SdkClientTocPlugin" })
export class SdkClientTocPlugin extends RendererComponent {
Expand Down Expand Up @@ -55,7 +55,7 @@ export class SdkClientTocPlugin extends RendererComponent {
const { extendedTypes = [] } = model;
return (
model.kindOf(ReflectionKind.Class) &&
model.getFullName() !== "Client" && // Exclude the Smithy Client class
model.getFullName() !== "Client" && // Exclude the Smithy Client class.
(model.name.endsWith("Client") /* Modular client like S3Client */ ||
(extendedTypes.length === 1 &&
(extendedTypes[0] as ReferenceType).name.endsWith("Client"))) /* Legacy client like S3 */
Expand All @@ -65,7 +65,7 @@ export class SdkClientTocPlugin extends RendererComponent {
private isCommand(model: DeclarationReflection): boolean {
return (
model.kindOf(ReflectionKind.Class) &&
model.getFullName() !== "Command" && // Exclude the Smithy Command class
model.getFullName() !== "Command" && // Exclude the Smithy Command class.
model.name.endsWith("Command") &&
model.children?.some((child) => child.name === "resolveMiddleware")
);
Expand Down Expand Up @@ -127,7 +127,7 @@ export class SdkClientTocPlugin extends RendererComponent {
}
}
});
// Group commands and input/output interface of each command
// Group commands and input/output interface of each command.
this.commandsNavigationItem?.children.sort((childA, childB) => childA.title.localeCompare(childB.title));
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core-packages-documentation-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"typescript": "~4.0.2"
},
"private": true,
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/master/packages/client-documentation-generator",
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/master/packages/core-packages-documentation-generator",
"repository": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-js-v3.git",
"directory": "packages/client-documentation-generator"
"directory": "packages/core-packages-documentation-generator"
}
}
4 changes: 2 additions & 2 deletions packages/core-packages-documentation-generator/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { ParameterType, PluginHost } from "typedoc/dist/lib/utils";
import { SdkIndexLinkClientPlugin } from "./sdk-index-link-client";

/**
*
* @param pluginHost An instance of PluginHost.
*/
module.exports = function load(pluginHost: PluginHost) {
const application = pluginHost.owner;
// Core packages doc generator plugins

// Core packages doc generator plugins.
application.options.addDeclaration({
name: "clientDocs",
help:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class SdkIndexLinkClientPlugin extends RendererComponent {
onPageBegin(page: PageEvent) {
const out = isAbsolute(this.out) ? this.out : resolve(PROJECT_ROOT, this.out);
const clientDocs = isAbsolute(this.clientDocs) ? this.clientDocs : resolve(PROJECT_ROOT, this.clientDocs);
// Get relative path from core packages doc to clients' doc

// Get relative path from core packages doc to clients' doc.
const clientDocsPattern = relative(out, clientDocs);
if (page.model === page.project) {
// Entry point index.html and global.html page.
Expand All @@ -36,11 +37,12 @@ export class SdkIndexLinkClientPlugin extends RendererComponent {
const clientName = child.sources[0].fileName.split(sep)[1];
const clientDocDir = clientDocsPattern.replace(/{{CLIENT}}/g, clientName);
child.url = join(clientDocDir, "index.html");
//@ts-ignore attach temporary flag
// @ts-ignore attach temporary flag.
child._skipRendering = true;
});
}
// Skip rendering empty landing page for each client

// Skip rendering empty landing page for each client.
if (page.model._skipRendering) {
page.preventDefault();
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"out": "docs",
"exclude": ["**/node_modules/**", "**/*.spec.ts"],
"excludeExternals": true,
"name": "AWS SDK v3",
"name": "AWS SDK for JavaScript v3",
"ignoreCompilerErrors": true,
"theme": "minimal",
"hideGenerator": true,
Expand Down

0 comments on commit 690fea5

Please sign in to comment.