Skip to content

Commit

Permalink
Merge branch 'main' into issue-32018
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanbarlog authored Nov 5, 2024
2 parents d4ec9c9 + b3de7e6 commit 198bbb8
Show file tree
Hide file tree
Showing 31 changed files with 2,106 additions and 471 deletions.
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"packages/@aws-cdk-testing/*",
"packages/@aws-cdk/*/lambda-packages/*",
"tools/@aws-cdk/cdk-build-tools",
"tools/@aws-cdk/yargs-gen",
"tools/@aws-cdk/cdk-release",
"tools/@aws-cdk/node-bundle",
"tools/@aws-cdk/pkglint",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"packages/@aws-cdk-testing/*",
"packages/@aws-cdk/*/lambda-packages/*",
"tools/@aws-cdk/cdk-build-tools",
"tools/@aws-cdk/yargs-gen",
"tools/@aws-cdk/cdk-release",
"tools/@aws-cdk/node-bundle",
"tools/@aws-cdk/pkglint",
Expand Down
23 changes: 23 additions & 0 deletions packages/aws-cdk/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## CLI Commands

All CDK CLI Commands are defined in `lib/config.ts`. This file is translated
into a valid `yargs` configuration by `bin/yargs-gen`, which is generated by `@aws-cdk/yargs-gen`.
The `yargs` configuration is generated into the function `parseCommandLineArguments()`,
in `lib/parse-command-line-arguments.ts`, and is checked into git for readability and
inspectability; do not edit this file by hand, as every subsequent `yarn build` will
overwrite any manual edits. If you need to leverage a `yargs` feature not used by
the CLI, you must add support for it to `@aws-cdk/yargs-gen`.

Note that `bin/yargs-gen` is executed by `ts-node`, which allows `config.ts` to
reference functions and other identifiers defined in the CLI before the CLI is
built.

### Dynamic Values

Some values, such as the user's platform, cannot be computed at build time.
Some commands depend on these values, and thus `yargs-gen` must generate the
code to compute these values at build time.

The only way to do this today is to reference a parameter with `DynamicValue.fromParameter`.
The caller of `parseCommandLineArguments()` must pass the parameter.

## Integration Tests

Unit tests are automatically run as part of the regular build. Integration tests
Expand Down
342 changes: 14 additions & 328 deletions packages/aws-cdk/lib/cli.ts

Large diffs are not rendered by default.

419 changes: 419 additions & 0 deletions packages/aws-cdk/lib/config.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/aws-cdk/lib/notices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface NoticesProps {
*
* @default false
*/
readonly includeAcknowlegded?: boolean;
readonly includeAcknowledged?: boolean;

}

Expand Down Expand Up @@ -223,7 +223,7 @@ export class Notices {
private constructor(props: NoticesProps) {
this.configuration = props.configuration;
this.acknowledgedIssueNumbers = new Set(this.configuration.context.get('acknowledged-issue-numbers') ?? []);
this.includeAcknowlegded = props.includeAcknowlegded ?? false;
this.includeAcknowlegded = props.includeAcknowledged ?? false;
}

/**
Expand Down
Loading

0 comments on commit 198bbb8

Please sign in to comment.