You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor the code so that we can never fail to have an option that is only supported in cdk.json but not as CLI option or vice versa.
We do NOT have to support all variations of cli options, i.e. rollback: bool in cdk.json is fine to represent --rollback, --no-rollback or --rollback=false
The text was updated successfully, but these errors were encountered:
This PR:
- generates a new type, `CliArguments` which is an interface created from the cli source-of-truth in `config.ts`.
- renames `yargs-gen` into `cli-args-gen` to better reflect what we are generating now
The purpose of `CliArguments` is to eventually replace our current `Arguments` type, turning it into a strongly-typed object. `Arguments` today looks like this:
```ts
export type Arguments = {
readonly _: [Command, ...string[]];
readonly exclusively?: boolean;
readonly STACKS?: string[];
readonly lookups?: boolean;
readonly [name: string]: unknown;
};
```
And because the last line in the definition essentially accepts any kind of property, we end up passing in and using values that are not documented anywhere. The purpose of this PR is to introduce a better type to enforce that the `args` object in `cli.ts` only holds values we expect. We are not currently using the new type anywhere; that will be done in a subsequent PR.
The success criteria of this PR is that we are generating a new type from the source of truth that will eventually represent the type of the object we receive from CLI inputs.
Part of #32474
### 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*
Refactor the code so that we can never fail to have an option that is only supported in cdk.json but not as CLI option or vice versa.
We do NOT have to support all variations of cli options, i.e.
rollback: bool
incdk.json
is fine to represent--rollback
,--no-rollback
or--rollback=false
The text was updated successfully, but these errors were encountered: