Skip to content

Commit 860c229

Browse files
authored
chore(toolkit-lib): resolve API Extractor warnings and improve documentation (#489)
This PR addresses API Extractor warnings in the toolkit-lib package: - Updates API Extractor configuration to treat most issues as errors - Configures proper handling of specific warnings like - Adds support for `@module` tag in TSDoc configuration - Fixes documentation formatting issues in source files to comply with API Extractor requirements - Makes parameter descriptions consistent with hyphen format These changes help maintain better API documentation quality and reduce warning noise during builds. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 2c70a50 commit 860c229

File tree

6 files changed

+32
-16
lines changed

6 files changed

+32
-16
lines changed

.projenrc.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,20 +860,23 @@ new pj.JsonFile(toolkitLib, 'api-extractor.json', {
860860
messages: {
861861
compilerMessageReporting: {
862862
default: {
863-
logLevel: 'warning',
863+
logLevel: 'error',
864864
},
865865
},
866866
extractorMessageReporting: {
867867
'default': {
868-
logLevel: 'warning',
868+
logLevel: 'error',
869869
},
870870
'ae-missing-release-tag': {
871871
logLevel: 'none',
872872
},
873+
'ae-forgotten-export': {
874+
logLevel: 'warning', // @todo fix issues and change to error
875+
},
873876
},
874877
tsdocMessageReporting: {
875878
default: {
876-
logLevel: 'warning',
879+
logLevel: 'error',
877880
},
878881
},
879882
},
@@ -894,9 +897,14 @@ new pj.JsonFile(toolkitLib, 'tsdoc.json', {
894897
tagName: '@default',
895898
syntaxKind: 'block',
896899
},
900+
{
901+
tagName: '@module',
902+
syntaxKind: 'block',
903+
},
897904
],
898905
supportForTags: {
899906
'@default': true,
907+
'@module': true,
900908
},
901909
},
902910
});

packages/@aws-cdk/toolkit-lib/api-extractor.json

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface ChangeSetDiffOptions extends CloudFormationDiffOptions {
2323
/**
2424
* Additional parameters for CloudFormation when creating a diff change set
2525
*
26-
* @default {}
26+
* @default - no parameters
2727
*/
2828
readonly parameters?: { [name: string]: string | undefined };
2929
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export abstract class CloudAssemblySourceBuilder {
3737
* directory. This means that while the CloudAssembly is being used, no CDK
3838
* app synthesis can take place into that directory.
3939
*
40-
* @param builder the builder function
41-
* @param props additional configuration properties
40+
* @param builder - the builder function
41+
* @param props - additional configuration properties
4242
* @returns the CloudAssembly source
4343
*/
4444
public async fromAssemblyBuilder(
@@ -102,7 +102,7 @@ export abstract class CloudAssemblySourceBuilder {
102102
* the CloudAssembly is being used, no CDK app synthesis can take place into
103103
* that directory.
104104
*
105-
* @param directory the directory of a already produced Cloud Assembly.
105+
* @param directory - directory the directory of a already produced Cloud Assembly.
106106
* @returns the CloudAssembly source
107107
*/
108108
public async fromAssemblyDirectory(directory: string, props: AssemblyDirectoryProps = {}): Promise<ICloudAssemblySource> {
@@ -146,7 +146,7 @@ export abstract class CloudAssemblySourceBuilder {
146146
* directory. This means that while the CloudAssembly is being used, no CDK
147147
* app synthesis can take place into that directory.
148148
*
149-
* @param props additional configuration properties
149+
* @param props - additional configuration properties
150150
* @returns the CloudAssembly source
151151
*/
152152
public async fromCdkApp(app: string, props: FromCdkAppOptions = {}): Promise<ICloudAssemblySource> {

packages/@aws-cdk/toolkit-lib/lib/api/plugin/plugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export class PluginHost implements IPluginHost {
3030
*
3131
* Will use `require.resolve()` to get the most accurate representation of what
3232
* code will get loaded in error messages. As such, it will not work in
33-
* unit tests with Jest virtual modules becauase of <https://github.com/jestjs/jest/issues/9543>.
33+
* unit tests with Jest virtual modules becauase of \<https://github.com/jestjs/jest/issues/9543\>.
3434
*
35-
* @param moduleSpec the specification (path or name) of the plug-in module to be loaded.
36-
* @param ioHost the I/O host to use for printing progress information
35+
* @param moduleSpec - the specification (path or name) of the plug-in module to be loaded.
36+
* @param ioHost - the I/O host to use for printing progress information
3737
*/
3838
public load(moduleSpec: string, ioHost?: IIoHost) {
3939
try {
@@ -85,7 +85,7 @@ export class PluginHost implements IPluginHost {
8585
/**
8686
* Allows plug-ins to register new CredentialProviderSources.
8787
*
88-
* @param source a new CredentialProviderSource to register.
88+
* @param source - a new CredentialProviderSource to register.
8989
*/
9090
public registerCredentialProviderSource(source: CredentialProviderSource) {
9191
// Forward to the right credentials-related plugin host

packages/@aws-cdk/toolkit-lib/tsdoc.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)