Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli): CliArguments interface generated from config.ts #32556

Merged
merged 18 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws-cdk.code-workspace
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
"name": "aws-custom-resource-sdk-adapter",
"rootPath": "packages/@aws-cdk/aws-custom-resource-sdk-adapter"
},
{ "name": "yargs-gen", "rootPath": "tools/@aws-cdk/yargs-gen" }
{ "name": "cli-args-gen", "rootPath": "tools/@aws-cdk/cli-args-gen" }
]
},
"extensions": {
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -30,3 +30,7 @@ component_management:
name: packages/aws-cdk # display name that can change freely
paths:
- packages/aws-cdk/**

# https://docs.codecov.com/docs/ignoring-paths
ignore:
- packages/aws-cdk/lib/parse-command-line-arguments.ts # this file is generated and some lines cannot be tested
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -10,7 +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/cli-args-gen",
"tools/@aws-cdk/cdk-release",
"tools/@aws-cdk/node-bundle",
"tools/@aws-cdk/pkglint",
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@
"packages/@aws-cdk-testing/*",
"packages/@aws-cdk/*/lambda-packages/*",
"tools/@aws-cdk/cdk-build-tools",
"tools/@aws-cdk/yargs-gen",
"tools/@aws-cdk/cli-args-gen",
"tools/@aws-cdk/cdk-release",
"tools/@aws-cdk/node-bundle",
"tools/@aws-cdk/pkglint",
8 changes: 4 additions & 4 deletions packages/aws-cdk/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
## 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`.
into a valid `yargs` configuration by `bin/cli-args-gen`, which is generated by `@aws-cdk/cli-args-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`.
the CLI, you must add support for it to `@aws-cdk/cli-args-gen`.

Note that `bin/yargs-gen` is executed by `ts-node`, which allows `config.ts` to
Note that `bin/cli-args-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
Some commands depend on these values, and thus `cli-args-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`.
Loading
Loading