Skip to content

Commit a0fa042

Browse files
authored
chore(cli): update documentation for generated files (#33421)
We've moved some files around and the generated files point to the wrong place for the source of truth
1 parent ccd5f38 commit a0fa042

10 files changed

+18
-16
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// -------------------------------------------------------------------------------------------
2-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
2+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
33
// Do not edit by hand; all changes will be overwritten at build time from the config file.
44
// -------------------------------------------------------------------------------------------
55
/* eslint-disable @stylistic/max-len */

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// -------------------------------------------------------------------------------------------
2-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
2+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
33
// Do not edit by hand; all changes will be overwritten at build time from the config file.
44
// -------------------------------------------------------------------------------------------
55
/* eslint-disable @stylistic/max-len */

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// -------------------------------------------------------------------------------------------
2-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
2+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
33
// Do not edit by hand; all changes will be overwritten at build time from the config file.
44
// -------------------------------------------------------------------------------------------
55
/* eslint-disable @stylistic/max-len */

tools/@aws-cdk/user-input-gen/lib/convert-to-user-input-gen.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { code, FreeFunction, Module, SelectiveModuleImport, Type, TypeScriptRenderer } from '@cdklabs/typewriter';
22
import { EsLintRules } from '@cdklabs/typewriter/lib/eslint-rules';
33
import * as prettier from 'prettier';
4-
import { kebabToCamelCase } from './util';
4+
import { kebabToCamelCase, SOURCE_OF_TRUTH } from './util';
55
import { CliAction, CliConfig } from './yargs-types';
66

77
const CLI_ARG_NAME = 'args';
@@ -11,7 +11,7 @@ export async function renderUserInputFuncs(config: CliConfig): Promise<string> {
1111
const scope = new Module('aws-cdk');
1212

1313
scope.documentation.push( '-------------------------------------------------------------------------------------------');
14-
scope.documentation.push('GENERATED FROM packages/aws-cdk/lib/config.ts.');
14+
scope.documentation.push(`GENERATED FROM ${SOURCE_OF_TRUTH}.`);
1515
scope.documentation.push('Do not edit by hand; all changes will be overwritten at build time from the config file.');
1616
scope.documentation.push('-------------------------------------------------------------------------------------------');
1717

tools/@aws-cdk/user-input-gen/lib/user-input-gen.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { Module, SelectiveModuleImport, StructType, Type, TypeScriptRenderer } from '@cdklabs/typewriter';
22
import { EsLintRules } from '@cdklabs/typewriter/lib/eslint-rules';
33
import * as prettier from 'prettier';
4-
import { kebabToCamelCase, kebabToPascal } from './util';
4+
import { kebabToCamelCase, kebabToPascal, SOURCE_OF_TRUTH } from './util';
55
import { CliConfig } from './yargs-types';
66

77
export async function renderUserInputType(config: CliConfig): Promise<string> {
88
const scope = new Module('aws-cdk');
99

1010
scope.documentation.push( '-------------------------------------------------------------------------------------------');
11-
scope.documentation.push('GENERATED FROM packages/aws-cdk/lib/config.ts.');
11+
scope.documentation.push(`GENERATED FROM ${SOURCE_OF_TRUTH}.`);
1212
scope.documentation.push('Do not edit by hand; all changes will be overwritten at build time from the config file.');
1313
scope.documentation.push('-------------------------------------------------------------------------------------------');
1414

tools/@aws-cdk/user-input-gen/lib/util.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { code, Expression } from '@cdklabs/typewriter';
22

3+
export const SOURCE_OF_TRUTH = 'packages/aws-cdk/lib/cli/cli-config.ts';
4+
35
export function lit(value: any): Expression {
46
switch (value) {
57
case undefined:

tools/@aws-cdk/user-input-gen/lib/yargs-gen.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { $E, Expression, ExternalModule, FreeFunction, IScope, Module, SelectiveModuleImport, Statement, ThingSymbol, Type, TypeScriptRenderer, code, expr } from '@cdklabs/typewriter';
22
import { EsLintRules } from '@cdklabs/typewriter/lib/eslint-rules';
33
import * as prettier from 'prettier';
4-
import { lit } from './util';
4+
import { lit, SOURCE_OF_TRUTH } from './util';
55
import { CliConfig, CliOption, YargsOption } from './yargs-types';
66

77
// to import lodash.clonedeep properly, we would need to set esModuleInterop: true
@@ -24,7 +24,7 @@ export async function renderYargs(config: CliConfig, helpers: CliHelpers): Promi
2424
const scope = new Module('aws-cdk');
2525

2626
scope.documentation.push( '-------------------------------------------------------------------------------------------');
27-
scope.documentation.push('GENERATED FROM packages/aws-cdk/lib/config.ts.');
27+
scope.documentation.push(`GENERATED FROM ${SOURCE_OF_TRUTH}.`);
2828
scope.documentation.push('Do not edit by hand; all changes will be overwritten at build time from the config file.');
2929
scope.documentation.push('-------------------------------------------------------------------------------------------');
3030

tools/@aws-cdk/user-input-gen/test/convert-to-user-input-gen.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('render', () => {
4545

4646
expect(await renderUserInputFuncs(config)).toMatchInlineSnapshot(`
4747
"// -------------------------------------------------------------------------------------------
48-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
48+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
4949
// Do not edit by hand; all changes will be overwritten at build time from the config file.
5050
// -------------------------------------------------------------------------------------------
5151
/* eslint-disable @stylistic/max-len */

tools/@aws-cdk/user-input-gen/test/user-input-gen.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('render', () => {
4545

4646
expect(await renderUserInputType(config)).toMatchInlineSnapshot(`
4747
"// -------------------------------------------------------------------------------------------
48-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
48+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
4949
// Do not edit by hand; all changes will be overwritten at build time from the config file.
5050
// -------------------------------------------------------------------------------------------
5151
/* eslint-disable @stylistic/max-len */
@@ -154,7 +154,7 @@ describe('render', () => {
154154

155155
expect(await renderUserInputType(config)).toMatchInlineSnapshot(`
156156
"// -------------------------------------------------------------------------------------------
157-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
157+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
158158
// Do not edit by hand; all changes will be overwritten at build time from the config file.
159159
// -------------------------------------------------------------------------------------------
160160
/* eslint-disable @stylistic/max-len */
@@ -236,7 +236,7 @@ describe('render', () => {
236236

237237
expect(await renderUserInputType(config)).toMatchInlineSnapshot(`
238238
"// -------------------------------------------------------------------------------------------
239-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
239+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
240240
// Do not edit by hand; all changes will be overwritten at build time from the config file.
241241
// -------------------------------------------------------------------------------------------
242242
/* eslint-disable @stylistic/max-len */

tools/@aws-cdk/user-input-gen/test/yargs-gen.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('render', () => {
2525

2626
expect(await renderYargs(config, YARGS_HELPERS)).toMatchInlineSnapshot(`
2727
"// -------------------------------------------------------------------------------------------
28-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
28+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
2929
// Do not edit by hand; all changes will be overwritten at build time from the config file.
3030
// -------------------------------------------------------------------------------------------
3131
/* eslint-disable @stylistic/max-len */
@@ -91,7 +91,7 @@ describe('render', () => {
9191

9292
expect(await renderYargs(config, YARGS_HELPERS)).toMatchInlineSnapshot(`
9393
"// -------------------------------------------------------------------------------------------
94-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
94+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
9595
// Do not edit by hand; all changes will be overwritten at build time from the config file.
9696
// -------------------------------------------------------------------------------------------
9797
/* eslint-disable @stylistic/max-len */
@@ -176,7 +176,7 @@ describe('render', () => {
176176

177177
expect(await renderYargs(config, YARGS_HELPERS)).toMatchInlineSnapshot(`
178178
"// -------------------------------------------------------------------------------------------
179-
// GENERATED FROM packages/aws-cdk/lib/config.ts.
179+
// GENERATED FROM packages/aws-cdk/lib/cli/cli-config.ts.
180180
// Do not edit by hand; all changes will be overwritten at build time from the config file.
181181
// -------------------------------------------------------------------------------------------
182182
/* eslint-disable @stylistic/max-len */

0 commit comments

Comments
 (0)