Skip to content

Commit 62ae02e

Browse files
authored
chore(cli): synth is now default command name, synthesize is alias (#32823)
As a product we have standardized on `cdk synth`. This change reflects that while not changing behavior of the CDK CLI at all. It will however matter for the behavior of a future feature where we allow defaults specified in a schematic way in `cdk.json`. The payoff is that instead of requiring `synthesize: { ... }` we instead will require `synth: { ... }`. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a8ad62c commit 62ae02e

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

packages/aws-cdk/lib/config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ export async function makeConfig(): Promise<CliConfig> {
5656
'show-dependencies': { type: 'boolean', default: false, alias: 'd', desc: 'Display stack dependency information for each stack' },
5757
},
5858
},
59-
synthesize: {
59+
synth: {
6060
arg: {
6161
name: 'STACKS',
6262
variadic: true,
6363
},
64-
aliases: ['synth'],
64+
aliases: ['synthesize'],
6565
description: 'Synthesizes and prints the CloudFormation template for this stack',
6666
options: {
6767
exclusively: { type: 'boolean', alias: 'e', desc: 'Only synthesize requested stacks, don\'t include dependencies' },

packages/aws-cdk/lib/convert-to-user-input.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export function convertYargsToUserInput(args: any): UserInput {
4646
};
4747
break;
4848

49-
case 'synthesize':
5049
case 'synth':
50+
case 'synthesize':
5151
commandOptions = {
5252
exclusively: args.exclusively,
5353
validation: args.validation,
@@ -292,10 +292,10 @@ export function convertConfigToUserInput(config: any): UserInput {
292292
long: config.list?.long,
293293
showDependencies: config.list?.showDependencies,
294294
};
295-
const synthesizeOptions = {
296-
exclusively: config.synthesize?.exclusively,
297-
validation: config.synthesize?.validation,
298-
quiet: config.synthesize?.quiet,
295+
const synthOptions = {
296+
exclusively: config.synth?.exclusively,
297+
validation: config.synth?.validation,
298+
quiet: config.synth?.quiet,
299299
};
300300
const bootstrapOptions = {
301301
bootstrapBucketName: config.bootstrap?.bootstrapBucketName,
@@ -431,7 +431,7 @@ export function convertConfigToUserInput(config: any): UserInput {
431431
const userInput: UserInput = {
432432
globalOptions,
433433
list: listOptions,
434-
synthesize: synthesizeOptions,
434+
synth: synthOptions,
435435
bootstrap: bootstrapOptions,
436436
gc: gcOptions,
437437
deploy: deployOptions,

packages/aws-cdk/lib/parse-command-line-arguments.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export function parseCommandLineArguments(args: Array<string>): any {
172172
desc: 'Display stack dependency information for each stack',
173173
}),
174174
)
175-
.command(['synthesize [STACKS..]', 'synth [STACKS..]'], 'Synthesizes and prints the CloudFormation template for this stack', (yargs: Argv) =>
175+
.command(['synth [STACKS..]', 'synthesize [STACKS..]'], 'Synthesizes and prints the CloudFormation template for this stack', (yargs: Argv) =>
176176
yargs
177177
.option('exclusively', {
178178
default: undefined,

packages/aws-cdk/lib/user-input.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export interface UserInput {
3131
/**
3232
* Synthesizes and prints the CloudFormation template for this stack
3333
*
34-
* aliases: synth
34+
* aliases: synthesize
3535
*/
36-
readonly synthesize?: SynthesizeOptions;
36+
readonly synth?: SynthOptions;
3737

3838
/**
3939
* Deploys the CDK toolkit stack into an AWS environment
@@ -337,11 +337,11 @@ export interface ListOptions {
337337
/**
338338
* Synthesizes and prints the CloudFormation template for this stack
339339
*
340-
* aliases: synth
340+
* aliases: synthesize
341341
*
342342
* @struct
343343
*/
344-
export interface SynthesizeOptions {
344+
export interface SynthOptions {
345345
/**
346346
* Only synthesize requested stacks, don't include dependencies
347347
*
@@ -368,7 +368,7 @@ export interface SynthesizeOptions {
368368
readonly quiet?: boolean;
369369

370370
/**
371-
* Positional argument for synthesize
371+
* Positional argument for synth
372372
*/
373373
readonly STACKS?: Array<string>;
374374
}

packages/aws-cdk/test/cli-arguments.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('config', () => {
131131
metadata: expect.anything(),
132132
migrate: expect.anything(),
133133
rollback: expect.anything(),
134-
synthesize: expect.anything(),
134+
synth: expect.anything(),
135135
watch: expect.anything(),
136136
notices: expect.anything(),
137137
import: expect.anything(),

0 commit comments

Comments
 (0)