Skip to content

Commit 88fe797

Browse files
authoredJan 17, 2025··
chore(toolkit): generate docs (#32991)
In lack of a public docs page, use typedoc for now. ### Description of how you validated changes Docs only ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c9d1684 commit 88fe797

File tree

6 files changed

+171
-40
lines changed

6 files changed

+171
-40
lines changed
 

‎packages/@aws-cdk/toolkit/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dist
99
coverage
1010
.nyc_output
1111
*.tgz
12+
docs
1213

1314
# Ignore config files
1415
.eslintrc.js

‎packages/@aws-cdk/toolkit/lib/actions/diff/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class DiffMethod {
3434
*
3535
* This will create, analyze, and subsequently delete a changeset against the CloudFormation stack.
3636
*/
37-
public static ChangeSet(options: ChangeSetDiffOptions = {}) {
37+
public static ChangeSet(options: ChangeSetDiffOptions = {}): DiffMethod {
3838
return new class extends DiffMethod {
3939
public override readonly options: ChangeSetDiffOptions;
4040
public constructor(opts: ChangeSetDiffOptions) {
@@ -44,7 +44,7 @@ export class DiffMethod {
4444
}(options);
4545
}
4646

47-
public static TemplateOnly(options: CloudFormationDiffOptions = {}) {
47+
public static TemplateOnly(options: CloudFormationDiffOptions = {}): DiffMethod {
4848
return new class extends DiffMethod {
4949
public override readonly options: CloudFormationDiffOptions;
5050
public constructor(opts: CloudFormationDiffOptions) {
@@ -54,7 +54,7 @@ export class DiffMethod {
5454
}(options);
5555
}
5656

57-
public static LocalFile(path: string) {
57+
public static LocalFile(path: string): DiffMethod {
5858
return new class extends DiffMethod {
5959
public override readonly options: { path: string };
6060
public constructor(opts: { path: string }) {

‎packages/@aws-cdk/toolkit/lib/api/cloud-assembly/private/source-builder.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export abstract class CloudAssemblySourceBuilder {
1919

2020
/**
2121
* Create a Cloud Assembly from a Cloud Assembly builder function.
22+
* @param builder the builder function
23+
* @param props additional configuration properties
24+
* @returns the CloudAssembly source
2225
*/
2326
public async fromAssemblyBuilder(
2427
builder: AssemblyBuilder,
@@ -52,9 +55,8 @@ export abstract class CloudAssemblySourceBuilder {
5255

5356
/**
5457
* Creates a Cloud Assembly from an existing assembly directory.
55-
* @param directory the directory of the AWS CDK app. Defaults to the current working directory.
56-
* @param props additional configuration properties
57-
* @returns an instance of `AwsCdkCli`
58+
* @param directory the directory of a already produced Cloud Assembly.
59+
* @returns the CloudAssembly source
5860
*/
5961
public async fromAssemblyDirectory(directory: string): Promise<ICloudAssemblySource> {
6062
const services: ToolkitServices = await this.toolkitServices();
@@ -78,9 +80,8 @@ export abstract class CloudAssemblySourceBuilder {
7880
}
7981
/**
8082
* Use a directory containing an AWS CDK app as source.
81-
* @param directory the directory of the AWS CDK app. Defaults to the current working directory.
8283
* @param props additional configuration properties
83-
* @returns an instance of `AwsCdkCli`
84+
* @returns the CloudAssembly source
8485
*/
8586
public async fromCdkApp(app: string, props: CdkAppSourceProps = {}): Promise<ICloudAssemblySource> {
8687
const services: ToolkitServices = await this.toolkitServices();

‎packages/@aws-cdk/toolkit/lib/api/cloud-assembly/stack-assembly.ts

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ export class StackAssembly extends CloudAssembly implements ICloudAssemblySource
8787
/**
8888
* Select all stacks that have the validateOnSynth flag et.
8989
*
90-
* @param assembly
9190
* @returns a `StackCollection` of all stacks that needs to be validated
9291
*/
9392
public selectStacksForValidation() {

‎packages/@aws-cdk/toolkit/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"build+extract": "yarn build",
2121
"build+test+extract": "yarn build+test",
2222
"bundle": "node bundle.mjs",
23+
"docs": "typedoc lib/index.ts --excludeExternals --excludePrivate --excludeProtected --excludeInternal",
2324
"lint": "cdk-lint",
2425
"package": "cdk-package",
2526
"pkglint": "pkglint -f",
@@ -49,6 +50,7 @@
4950
"aws-cdk-lib": "0.0.0",
5051
"esbuild": "^0.24.0",
5152
"jest": "^29.7.0",
53+
"typedoc": "^0.27.6",
5254
"typescript": "~5.6.3"
5355
},
5456
"dependencies": {

0 commit comments

Comments
 (0)
Please sign in to comment.