diff --git a/codecov.yml b/codecov.yml index e21d3c0ecbf7d..b73c1ed223090 100644 --- a/codecov.yml +++ b/codecov.yml @@ -36,5 +36,4 @@ component_management: # 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 - packages/aws-cdk/lib/cli.ts # we integ test this file diff --git a/packages/aws-cdk/jest.config.js b/packages/aws-cdk/jest.config.js index f26c2c7b13c4e..f82ca932d08a3 100644 --- a/packages/aws-cdk/jest.config.js +++ b/packages/aws-cdk/jest.config.js @@ -17,6 +17,10 @@ const config = { ...baseConfig.coveragePathIgnorePatterns, // Mostly wrappers around the SDK, which get mocked in unit tests "/lib/api/aws-auth/sdk.ts", + // Files generated by cli-args-gen + "/lib/parse-command-line-arguments.ts", + "/lib/cli-arguments.ts", + "/lib/convert-to-cli-args.ts", ], // We have many tests here that commonly time out diff --git a/packages/aws-cdk/lib/cli-arguments.ts b/packages/aws-cdk/lib/cli-arguments.ts index 126eee3ad4f94..ea957cd036765 100644 --- a/packages/aws-cdk/lib/cli-arguments.ts +++ b/packages/aws-cdk/lib/cli-arguments.ts @@ -2,6 +2,7 @@ // GENERATED FROM packages/aws-cdk/lib/config.ts. // Do not edit by hand; all changes will be overwritten at build time from the config file. // ------------------------------------------------------------------------------------------- +// istanbul ignore file /* eslint-disable @stylistic/max-len */ import { Command } from './settings'; diff --git a/packages/aws-cdk/lib/convert-to-cli-args.ts b/packages/aws-cdk/lib/convert-to-cli-args.ts new file mode 100644 index 0000000000000..a55fa39092195 --- /dev/null +++ b/packages/aws-cdk/lib/convert-to-cli-args.ts @@ -0,0 +1,242 @@ +// ------------------------------------------------------------------------------------------- +// GENERATED FROM packages/aws-cdk/lib/config.ts. +// Do not edit by hand; all changes will be overwritten at build time from the config file. +// ------------------------------------------------------------------------------------------- +// istanbul ignore file +/* eslint-disable @stylistic/max-len */ +import { CliArguments, GlobalOptions } from './cli-arguments'; +import { Command } from './settings'; + +// @ts-ignore TS6133 +export function convertToCliArgs(args: any): CliArguments { + const globalOptions: GlobalOptions = { + app: args.app, + build: args.build, + context: args.context, + plugin: args.plugin, + trace: args.trace, + strict: args.strict, + lookups: args.lookups, + ignoreErrors: args.ignoreErrors, + json: args.json, + verbose: args.verbose, + debug: args.debug, + profile: args.profile, + proxy: args.proxy, + caBundlePath: args.caBundlePath, + ec2creds: args.ec2creds, + versionReporting: args.versionReporting, + pathMetadata: args.pathMetadata, + assetMetadata: args.assetMetadata, + roleArn: args.roleArn, + staging: args.staging, + output: args.output, + notices: args.notices, + noColor: args.noColor, + ci: args.ci, + unstable: args.unstable, + }; + let commandOptions; + switch (args._[0] as Command) { + case 'list': + commandOptions = { + long: args.long, + showDependencies: args.showDependencies, + }; + break; + + case 'synthesize': + commandOptions = { + exclusively: args.exclusively, + validation: args.validation, + quiet: args.quiet, + }; + break; + + case 'bootstrap': + commandOptions = { + bootstrapBucketName: args.bootstrapBucketName, + bootstrapKmsKeyId: args.bootstrapKmsKeyId, + examplePermissionsBoundary: args.examplePermissionsBoundary, + customPermissionsBoundary: args.customPermissionsBoundary, + bootstrapCustomerKey: args.bootstrapCustomerKey, + qualifier: args.qualifier, + publicAccessBlockConfiguration: args.publicAccessBlockConfiguration, + tags: args.tags, + execute: args.execute, + trust: args.trust, + trustForLookup: args.trustForLookup, + cloudformationExecutionPolicies: args.cloudformationExecutionPolicies, + force: args.force, + terminationProtection: args.terminationProtection, + showTemplate: args.showTemplate, + toolkitStackName: args.toolkitStackName, + template: args.template, + previousParameters: args.previousParameters, + }; + break; + + case 'gc': + commandOptions = { + action: args.action, + type: args.type, + rollbackBufferDays: args.rollbackBufferDays, + createdBufferDays: args.createdBufferDays, + confirm: args.confirm, + bootstrapStackName: args.bootstrapStackName, + }; + break; + + case 'deploy': + commandOptions = { + all: args.all, + buildExclude: args.buildExclude, + exclusively: args.exclusively, + requireApproval: args.requireApproval, + notificationArns: args.notificationArns, + tags: args.tags, + execute: args.execute, + changeSetName: args.changeSetName, + method: args.method, + importExistingResources: args.importExistingResources, + force: args.force, + parameters: args.parameters, + outputsFile: args.outputsFile, + previousParameters: args.previousParameters, + toolkitStackName: args.toolkitStackName, + progress: args.progress, + rollback: args.rollback, + hotswap: args.hotswap, + hotswapFallback: args.hotswapFallback, + watch: args.watch, + logs: args.logs, + concurrency: args.concurrency, + assetParallelism: args.assetParallelism, + assetPrebuild: args.assetPrebuild, + ignoreNoStacks: args.ignoreNoStacks, + }; + break; + + case 'rollback': + commandOptions = { + all: args.all, + toolkitStackName: args.toolkitStackName, + force: args.force, + validateBootstrapVersion: args.validateBootstrapVersion, + orphan: args.orphan, + }; + break; + + case 'import': + commandOptions = { + execute: args.execute, + changeSetName: args.changeSetName, + toolkitStackName: args.toolkitStackName, + rollback: args.rollback, + force: args.force, + recordResourceMapping: args.recordResourceMapping, + resourceMapping: args.resourceMapping, + }; + break; + + case 'watch': + commandOptions = { + buildExclude: args.buildExclude, + exclusively: args.exclusively, + changeSetName: args.changeSetName, + force: args.force, + toolkitStackName: args.toolkitStackName, + progress: args.progress, + rollback: args.rollback, + hotswap: args.hotswap, + hotswapFallback: args.hotswapFallback, + logs: args.logs, + concurrency: args.concurrency, + }; + break; + + case 'destroy': + commandOptions = { + all: args.all, + exclusively: args.exclusively, + force: args.force, + }; + break; + + case 'diff': + commandOptions = { + exclusively: args.exclusively, + contextLines: args.contextLines, + template: args.template, + strict: args.strict, + securityOnly: args.securityOnly, + fail: args.fail, + processed: args.processed, + quiet: args.quiet, + changeSet: args.changeSet, + }; + break; + + case 'metadata': + commandOptions = {}; + break; + + case 'acknowledge': + commandOptions = {}; + break; + + case 'notices': + commandOptions = { + unacknowledged: args.unacknowledged, + }; + break; + + case 'init': + commandOptions = { + language: args.language, + list: args.list, + generateOnly: args.generateOnly, + }; + break; + + case 'migrate': + commandOptions = { + stackName: args.stackName, + language: args.language, + account: args.account, + region: args.region, + fromPath: args.fromPath, + fromStack: args.fromStack, + outputPath: args.outputPath, + fromScan: args.fromScan, + filter: args.filter, + compress: args.compress, + }; + break; + + case 'context': + commandOptions = { + reset: args.reset, + force: args.force, + clear: args.clear, + }; + break; + + case 'docs': + commandOptions = { + browser: args.browser, + }; + break; + + case 'doctor': + commandOptions = {}; + break; + } + const cliArguments: CliArguments = { + _: args._, + globalOptions, + [args._[0]]: commandOptions, + }; + + return cliArguments; +} diff --git a/packages/aws-cdk/lib/parse-command-line-arguments.ts b/packages/aws-cdk/lib/parse-command-line-arguments.ts index b0d4f3060024e..88c379a035dea 100644 --- a/packages/aws-cdk/lib/parse-command-line-arguments.ts +++ b/packages/aws-cdk/lib/parse-command-line-arguments.ts @@ -2,6 +2,7 @@ // GENERATED FROM packages/aws-cdk/lib/config.ts. // Do not edit by hand; all changes will be overwritten at build time from the config file. // ------------------------------------------------------------------------------------------- +// istanbul ignore file /* eslint-disable @stylistic/max-len */ import { Argv } from 'yargs'; import * as helpers from './util/yargs-helpers'; diff --git a/packages/aws-cdk/scripts/cli-args-gen.ts b/packages/aws-cdk/scripts/cli-args-gen.ts index cde589928e1a4..68d53eeff0597 100644 --- a/packages/aws-cdk/scripts/cli-args-gen.ts +++ b/packages/aws-cdk/scripts/cli-args-gen.ts @@ -1,11 +1,12 @@ import * as fs from 'fs'; // eslint-disable-next-line import/no-extraneous-dependencies -import { renderYargs, renderCliType } from '@aws-cdk/cli-args-gen'; +import { renderYargs, renderCliArgsType, renderCliArgsFunc } from '@aws-cdk/cli-args-gen'; import { makeConfig, YARGS_HELPERS } from '../lib/config'; async function main() { fs.writeFileSync('./lib/parse-command-line-arguments.ts', await renderYargs(await makeConfig(), YARGS_HELPERS)); - fs.writeFileSync('./lib/cli-arguments.ts', await renderCliType(await makeConfig())); + fs.writeFileSync('./lib/cli-arguments.ts', await renderCliArgsType(await makeConfig())); + fs.writeFileSync('./lib/convert-to-cli-args.ts', await renderCliArgsFunc(await makeConfig())); } main().then(() => { diff --git a/packages/aws-cdk/test/cli-arguments.test.ts b/packages/aws-cdk/test/cli-arguments.test.ts index 24ad03c46aaa6..d749efb2785bd 100644 --- a/packages/aws-cdk/test/cli-arguments.test.ts +++ b/packages/aws-cdk/test/cli-arguments.test.ts @@ -1,19 +1,66 @@ -import { CliArguments } from '../lib/cli-arguments'; -import { Command } from '../lib/settings'; +import { convertToCliArgs } from '../lib/convert-to-cli-args'; +import { parseCommandLineArguments } from '../lib/parse-command-line-arguments'; -// CliArguments is not being used right now, so the testing suite is rather redundant. -// This file is meant to be populated when CliArguments is used. -test('cli arguments can be used as a type', async () => { - const argv: CliArguments = { - _: [Command.DEPLOY], +test('yargs object can be converted to cli arguments', async () => { + const input = await parseCommandLineArguments(['deploy', '-R', '-v', '--ci']); + + const result = convertToCliArgs(input); + + expect(result).toEqual({ + _: ['deploy'], globalOptions: { - lookups: true, + app: undefined, + assetMetadata: undefined, + build: undefined, + caBundlePath: undefined, + context: [], ignoreErrors: false, + noColor: false, + pathMetadata: undefined, + plugin: [], + profile: undefined, + proxy: undefined, + roleArn: undefined, + staging: true, + strict: undefined, + verbose: 1, + versionReporting: undefined, + ci: true, + debug: false, + ec2creds: undefined, json: false, - verbose: false, + lookups: true, + trace: undefined, + unstable: [], + notices: undefined, + output: undefined, }, - }; - - expect(argv._[0]).toBe('deploy'); - expect(argv.globalOptions?.lookups).toBeTruthy(); + deploy: { + all: false, + assetParallelism: undefined, + assetPrebuild: true, + buildExclude: [], + changeSetName: undefined, + concurrency: 1, + execute: undefined, + exclusively: undefined, + force: false, + hotswap: undefined, + hotswapFallback: undefined, + ignoreNoStacks: false, + importExistingResources: false, + logs: true, + method: undefined, + notificationArns: undefined, + outputsFile: undefined, + parameters: [{}], + previousParameters: true, + progress: undefined, + requireApproval: undefined, + rollback: false, + tags: [], + toolkitStackName: undefined, + watch: undefined, + }, + }); }); diff --git a/tools/@aws-cdk/cli-args-gen/README.md b/tools/@aws-cdk/cli-args-gen/README.md index d3a6396495bf8..8915e8d8de23b 100644 --- a/tools/@aws-cdk/cli-args-gen/README.md +++ b/tools/@aws-cdk/cli-args-gen/README.md @@ -1,8 +1,11 @@ # cli-args-gen Generates CDK CLI configurations from the source of truth in `packages/aws-cdk/lib/config.ts`. -Currently generates `yargs` config into `packages/aws-cdk/lib/parse-command-line-arguments.ts` and -strongly-typed CLI arguments interface into `packages/aws-cdk-lib/cli-arguments.ts`. +Currently generates the following files: + +- `packages/aws-cdk/lib/parse-command-line-arguments.ts`: `yargs` config. +- `packages/aws-cdk-lib/cli-arguments.ts`: strongly typed `CliArguments` interface. +- `packages/aws-cdk-lib/convert-to-cli-args.ts`: converts the `any` returned by `yargs` to `CliArguments`. ## Usage diff --git a/tools/@aws-cdk/cli-args-gen/lib/cli-args-function-gen.ts b/tools/@aws-cdk/cli-args-gen/lib/cli-args-function-gen.ts new file mode 100644 index 0000000000000..67aa076528238 --- /dev/null +++ b/tools/@aws-cdk/cli-args-gen/lib/cli-args-function-gen.ts @@ -0,0 +1,97 @@ +import { code, FreeFunction, Module, SelectiveModuleImport, Type, TypeScriptRenderer } from '@cdklabs/typewriter'; +import { EsLintRules } from '@cdklabs/typewriter/lib/eslint-rules'; +import * as prettier from 'prettier'; +import { kebabToCamelCase } from './util'; +import { CliAction, CliConfig } from './yargs-types'; + +export async function renderCliArgsFunc(config: CliConfig): Promise { + const scope = new Module('aws-cdk'); + + scope.documentation.push( '-------------------------------------------------------------------------------------------'); + scope.documentation.push('GENERATED FROM packages/aws-cdk/lib/config.ts.'); + scope.documentation.push('Do not edit by hand; all changes will be overwritten at build time from the config file.'); + scope.documentation.push('-------------------------------------------------------------------------------------------'); + + scope.addImport(new SelectiveModuleImport(scope, './cli-arguments', ['CliArguments', 'GlobalOptions'])); + const cliArgType = Type.fromName(scope, 'CliArguments'); + + scope.addImport(new SelectiveModuleImport(scope, './settings', ['Command'])); + + const createCliArguments = new FreeFunction(scope, { + name: 'convertToCliArgs', + export: true, + returnType: cliArgType, + parameters: [ + { name: 'args', type: Type.ANY }, + ], + }); + createCliArguments.addBody(code.expr.directCode(buildCliArgsFunction(config))); + + const ts = new TypeScriptRenderer({ + disabledEsLintRules: [EsLintRules.MAX_LEN], // the default disabled rules result in 'Definition for rule 'prettier/prettier' was not found' + }).render(scope); + + return prettier.format(ts, { + parser: 'typescript', + printWidth: 150, + singleQuote: true, + quoteProps: 'consistent', + }); +} + +function buildCliArgsFunction(config: CliConfig): string { + const globalOptions = buildGlobalOptions(config); + const commandSwitch = buildCommandSwitch(config); + const cliArgs = buildCliArgs(); + return [ + globalOptions, + commandSwitch, + cliArgs, + ].join('\n'); +} + +function buildGlobalOptions(config: CliConfig): string { + const globalOptionExprs = ['const globalOptions: GlobalOptions = {']; + for (const optionName of Object.keys(config.globalOptions)) { + const name = kebabToCamelCase(optionName); + globalOptionExprs.push(`'${name}': args.${name},`); + } + globalOptionExprs.push('}'); + return globalOptionExprs.join('\n'); +} + +function buildCommandSwitch(config: CliConfig): string { + const commandSwitchExprs = ['let commandOptions;', 'switch (args._[0] as Command) {']; + for (const commandName of Object.keys(config.commands)) { + commandSwitchExprs.push( + `case '${commandName}':`, + 'commandOptions = {', + ...buildCommandOptions(config.commands[commandName]), + '};', + `break; + `); + } + commandSwitchExprs.push('}'); + return commandSwitchExprs.join('\n'); +} + +function buildCommandOptions(options: CliAction): string[] { + const commandOptions: string[] = []; + for (const optionName of Object.keys(options.options ?? {})) { + const name = kebabToCamelCase(optionName); + commandOptions.push(`'${name}': args.${name},`); + } + return commandOptions; +} + +function buildCliArgs(): string { + return [ + 'const cliArguments: CliArguments = {', + '_: args._,', + 'globalOptions,', + '[args._[0]]: commandOptions', + '}', + '', + 'return cliArguments', + ].join('\n'); +} diff --git a/tools/@aws-cdk/cli-args-gen/lib/cli-type-gen.ts b/tools/@aws-cdk/cli-args-gen/lib/cli-args-gen.ts similarity index 97% rename from tools/@aws-cdk/cli-args-gen/lib/cli-type-gen.ts rename to tools/@aws-cdk/cli-args-gen/lib/cli-args-gen.ts index 84ee0bdca21bd..139e4dd7a6c9d 100644 --- a/tools/@aws-cdk/cli-args-gen/lib/cli-type-gen.ts +++ b/tools/@aws-cdk/cli-args-gen/lib/cli-args-gen.ts @@ -4,7 +4,7 @@ import * as prettier from 'prettier'; import { generateDefault, kebabToCamelCase, kebabToPascal } from './util'; import { CliConfig } from './yargs-types'; -export async function renderCliType(config: CliConfig): Promise { +export async function renderCliArgsType(config: CliConfig): Promise { const scope = new Module('aws-cdk'); scope.documentation.push( '-------------------------------------------------------------------------------------------'); @@ -52,6 +52,7 @@ export async function renderCliType(config: CliConfig): Promise { optional: true, }); } + cliArgType.addProperty({ name: 'globalOptions', type: Type.fromName(scope, globalOptionType.name), @@ -106,6 +107,7 @@ export async function renderCliType(config: CliConfig): Promise { parser: 'typescript', printWidth: 150, singleQuote: true, + quoteProps: 'consistent', }); } diff --git a/tools/@aws-cdk/cli-args-gen/lib/index.ts b/tools/@aws-cdk/cli-args-gen/lib/index.ts index 7b8f3eea63ace..6dfee4beeac38 100644 --- a/tools/@aws-cdk/cli-args-gen/lib/index.ts +++ b/tools/@aws-cdk/cli-args-gen/lib/index.ts @@ -1,3 +1,4 @@ export * from './yargs-gen'; export * from './yargs-types'; -export * from './cli-type-gen'; +export * from './cli-args-gen'; +export * from './cli-args-function-gen'; diff --git a/tools/@aws-cdk/cli-args-gen/lib/util.ts b/tools/@aws-cdk/cli-args-gen/lib/util.ts index 7a0d99a0c3879..6d7d050315738 100644 --- a/tools/@aws-cdk/cli-args-gen/lib/util.ts +++ b/tools/@aws-cdk/cli-args-gen/lib/util.ts @@ -1,7 +1,20 @@ +import { code, Expression } from '@cdklabs/typewriter'; + export function generateDefault(type: string) { return type === 'array' ? [] : undefined; } +export function lit(value: any): Expression { + switch (value) { + case undefined: + return code.expr.UNDEFINED; + case null: + return code.expr.NULL; + default: + return code.expr.lit(value); + } +} + export function kebabToCamelCase(str: string): string { return str .split('-') diff --git a/tools/@aws-cdk/cli-args-gen/lib/yargs-gen.ts b/tools/@aws-cdk/cli-args-gen/lib/yargs-gen.ts index fee7fdaa61e3d..89fdbe4523cb1 100644 --- a/tools/@aws-cdk/cli-args-gen/lib/yargs-gen.ts +++ b/tools/@aws-cdk/cli-args-gen/lib/yargs-gen.ts @@ -1,7 +1,7 @@ import { $E, Expression, ExternalModule, FreeFunction, IScope, Module, SelectiveModuleImport, Statement, ThingSymbol, Type, TypeScriptRenderer, code, expr } from '@cdklabs/typewriter'; import { EsLintRules } from '@cdklabs/typewriter/lib/eslint-rules'; import * as prettier from 'prettier'; -import { generateDefault } from './util'; +import { generateDefault, lit } from './util'; import { CliConfig, CliOption, YargsOption } from './yargs-types'; // to import lodash.clonedeep properly, we would need to set esModuleInterop: true @@ -173,13 +173,3 @@ function makeEpilogue(prefix: Expression, helpers: CliHelpers) { return completeDefinition; } -function lit(value: any): Expression { - switch (value) { - case undefined: - return code.expr.UNDEFINED; - case null: - return code.expr.NULL; - default: - return code.expr.lit(value); - } -} diff --git a/tools/@aws-cdk/cli-args-gen/lib/yargs-types.ts b/tools/@aws-cdk/cli-args-gen/lib/yargs-types.ts index 6605f14eec2b7..91c23b288cd04 100644 --- a/tools/@aws-cdk/cli-args-gen/lib/yargs-types.ts +++ b/tools/@aws-cdk/cli-args-gen/lib/yargs-types.ts @@ -5,7 +5,7 @@ interface YargsCommand { arg?: YargsArg; } -interface CliAction extends YargsCommand { +export interface CliAction extends YargsCommand { options?: { [optionName: string]: CliOption }; } diff --git a/tools/@aws-cdk/cli-args-gen/test/cli-args-function-gen.test.ts b/tools/@aws-cdk/cli-args-gen/test/cli-args-function-gen.test.ts new file mode 100644 index 0000000000000..2f5f1a96e57ed --- /dev/null +++ b/tools/@aws-cdk/cli-args-gen/test/cli-args-function-gen.test.ts @@ -0,0 +1,77 @@ +import { CliConfig, renderCliArgsFunc } from '../lib'; + +describe('render', () => { + test('can generate conversion function', async () => { + const config: CliConfig = { + globalOptions: { + app: { + type: 'string', + desc: 'REQUIRED: Command-line for executing your app', + }, + debug: { + type: 'boolean', + desc: 'Enable debug logging', + default: false, + }, + context: { + default: [], + type: 'array', + alias: 'c', + desc: 'context values', + }, + plugin: { + type: 'array', + desc: 'plugins to load', + }, + }, + commands: { + deploy: { + description: 'Deploy a stack', + options: { + all: { + type: 'boolean', + desc: 'Deploy all stacks', + default: false, + }, + }, + }, + }, + }; + + expect(await renderCliArgsFunc(config)).toMatchInlineSnapshot(` + "// ------------------------------------------------------------------------------------------- + // GENERATED FROM packages/aws-cdk/lib/config.ts. + // Do not edit by hand; all changes will be overwritten at build time from the config file. + // ------------------------------------------------------------------------------------------- + /* eslint-disable @stylistic/max-len */ + import { CliArguments, GlobalOptions } from './cli-arguments'; + import { Command } from './settings'; + + // @ts-ignore TS6133 + export function convertToCliArgs(args: any): CliArguments { + const globalOptions: GlobalOptions = { + app: args.app, + debug: args.debug, + context: args.context, + plugin: args.plugin, + }; + let commandOptions; + switch (args._[0] as Command) { + case 'deploy': + commandOptions = { + all: args.all, + }; + break; + } + const cliArguments: CliArguments = { + _: args._, + globalOptions, + [args._[0]]: commandOptions, + }; + + return cliArguments; + } + " + `); + }); +}); diff --git a/tools/@aws-cdk/cli-args-gen/test/cli-type-gen.test.ts b/tools/@aws-cdk/cli-args-gen/test/cli-args-gen.test.ts similarity index 96% rename from tools/@aws-cdk/cli-args-gen/test/cli-type-gen.test.ts rename to tools/@aws-cdk/cli-args-gen/test/cli-args-gen.test.ts index a3d119fc5fd89..cdae7d1a6d967 100644 --- a/tools/@aws-cdk/cli-args-gen/test/cli-type-gen.test.ts +++ b/tools/@aws-cdk/cli-args-gen/test/cli-args-gen.test.ts @@ -1,4 +1,4 @@ -import { CliConfig, renderCliType } from '../lib'; +import { CliConfig, renderCliArgsType } from '../lib'; describe('render', () => { test('can generate CliArguments type', async () => { @@ -38,7 +38,7 @@ describe('render', () => { }, }; - expect(await renderCliType(config)).toMatchInlineSnapshot(` + expect(await renderCliArgsType(config)).toMatchInlineSnapshot(` "// ------------------------------------------------------------------------------------------- // GENERATED FROM packages/aws-cdk/lib/config.ts. // Do not edit by hand; all changes will be overwritten at build time from the config file. @@ -140,7 +140,7 @@ describe('render', () => { globalOptions: {}, }; - expect(await renderCliType(config)).toMatchInlineSnapshot(` + expect(await renderCliArgsType(config)).toMatchInlineSnapshot(` "// ------------------------------------------------------------------------------------------- // GENERATED FROM packages/aws-cdk/lib/config.ts. // Do not edit by hand; all changes will be overwritten at build time from the config file.