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(init-templates): allow renaming in templates for cdk migrate apps #27166

Merged
merged 49 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
bacccb3
chore: empty test for future canary
Sep 15, 2023
9809217
dummify test even more
Sep 15, 2023
deb71a1
fix clippy being upset
Sep 15, 2023
68e53a3
add migrate test into cli-integ-tets
Sep 18, 2023
5984f1a
integ test for CDK migrate
Sep 19, 2023
7b5a39e
test fixes
Sep 19, 2023
7c8ff72
working migrate test
Sep 20, 2023
07b71e4
add multi language support
Sep 20, 2023
6f02a66
more testing templates and update to cdk-from-cfn
Sep 20, 2023
d995ab9
fix go stack name issue
Sep 21, 2023
0772315
fix package.json version issue
Sep 21, 2023
a92fc50
csharp has too many stacks in it's name
Sep 21, 2023
2529935
modify cdk-from-cfn package versions
Sep 21, 2023
42cd312
typescript does PEMDAS weirdly
Sep 22, 2023
046bd4d
modify init template for csharp
Sep 22, 2023
f2740e4
Merge branch 'main' into bobertzh/testing
HBobertz Sep 22, 2023
a7aabde
add 0.23.0 to yarn lock
Sep 22, 2023
0bfabe2
fix THIRD_PARTY_LICENSCES
Sep 26, 2023
db85102
remove random whitespace
Sep 26, 2023
01e1c62
modify Third party licensces in alpha lib
Sep 26, 2023
dd43de7
Merge branch 'main' into bobertzh/testing
HBobertz Sep 26, 2023
3b4d9ca
Merge branch 'main' into bobertzh/testing
HBobertz Sep 26, 2023
9b1cb62
fix unit tests for new cdk-from-cfn version
Sep 26, 2023
70768d5
Conditionally add csharp stack name
Sep 26, 2023
321c23e
update S3Stack.cs snapshot
Sep 26, 2023
3144267
stackname and namespace should include stack
Sep 26, 2023
0ebb6f4
update to 0.27.0
Sep 27, 2023
25f91ed
Merge branch 'main' into bobertzh/testing
HBobertz Sep 27, 2023
b8d033b
add 0.27.0 to yarn lock
Sep 27, 2023
7883cdb
Merge branch 'main' into bobertzh/testing
HBobertz Sep 27, 2023
31feecb
Delete packages/@aws-cdk-testing/cli-integ/resources/templates/autosc…
TheRealAmazonKendra Sep 28, 2023
d4d4dcc
Delete packages/@aws-cdk-testing/cli-integ/resources/templates/simple…
TheRealAmazonKendra Sep 28, 2023
eb7842e
Merge branch 'main' into bobertzh/testing
TheRealAmazonKendra Sep 28, 2023
924fe5c
Merge branch 'main' into bobertzh/testing
TheRealAmazonKendra Oct 5, 2023
3dea05a
python needs to install requirements
TheRealAmazonKendra Oct 5, 2023
ad6daea
make cli available
TheRealAmazonKendra Oct 9, 2023
cd74b8a
only use one fixture
TheRealAmazonKendra Oct 9, 2023
69c5632
Merge branch 'main' into bobertzh/testing
mergify[bot] Oct 9, 2023
0e8bdb1
remove imports
TheRealAmazonKendra Oct 9, 2023
fef88d6
use codebuild pip instead of venv
TheRealAmazonKendra Oct 9, 2023
474713c
just troubleshooting
TheRealAmazonKendra Oct 10, 2023
5ac289a
more troubleshooting
TheRealAmazonKendra Oct 10, 2023
bdaaffb
fix test
TheRealAmazonKendra Oct 10, 2023
b13a080
fix path
TheRealAmazonKendra Oct 11, 2023
0c6770d
wrong path
TheRealAmazonKendra Oct 11, 2023
f319e9c
kendra is dumb
TheRealAmazonKendra Oct 11, 2023
b6aa7ec
remove test updates and only update init
TheRealAmazonKendra Oct 11, 2023
385232a
Merge branch 'main' into bobertzh/testing
TheRealAmazonKendra Oct 11, 2023
52d024b
Merge branch 'main' into bobertzh/testing
mergify[bot] Oct 11, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
using System.Collections.Generic;
using System.Linq;

namespace %name.PascalCased%
namespace %PascalNameSpace%
{
sealed class Program
{
public static void Main(string[] args)
{
var app = new App();
new %name.PascalCased%Stack(app, "%stackname%", new StackProps
new %name.PascalCased%Stack(app, "%stackname%", new %PascalStackProps%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As previously mentioned, the stack props name should not be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
// If you don't specify 'env', this stack will be environment-agnostic.
// Account/Region-dependent features and context lookups will not work,
Expand Down
2 changes: 2 additions & 0 deletions packages/aws-cdk/lib/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ export class InitTemplate {
}
return template.replace(/%name%/g, project.name)
.replace(/%stackname%/, project.stackName ?? '%name.PascalCased%Stack')
.replace(/%PascalNameSpace%/, project.stackName ? camelCase(project.stackName + 'Stack', { pascalCase: true }) : '%name.PascalCased%')
.replace(/%PascalStackProps%/, project.stackName ? (camelCase(project.stackName, { pascalCase: true }) + 'StackProps') : 'StackProps')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as last review on this line.

Copy link
Contributor Author

@HBobertz HBobertz Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

.replace(/%name\.camelCased%/g, camelCase(project.name))
.replace(/%name\.PascalCased%/g, camelCase(project.name, { pascalCase: true }))
.replace(/%cdk-version%/g, cdkVersion)
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/test/commands/migrate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('Migrate Function Tests', () => {
// Replaced stack file is referenced correctly in app file
const app = fs.readFileSync(path.join(workDir, 'GoodCSharp', 'src', 'GoodCSharp', 'Program.cs'), 'utf8').split('\n');
expect(app.map(line => line.match('namespace GoodCSharp')).filter(line => line).length).toEqual(1);
expect(app.map(line => line.match(/ new GoodCSharpStack\(app, "GoodCSharp", new StackProps/)).filter(line => line).length).toEqual(1);
expect(app.map(line => line.match(/ new GoodCSharpStack\(app, "GoodCSharp", new GoodCSharpStackProps/)).filter(line => line).length).toEqual(1);

// Replaced stack file is correctly generated
const replacedStack = fs.readFileSync(path.join(workDir, 'GoodCSharp', 'src', 'GoodCSharp', 'GoodCSharpStack.cs'), 'utf8');
Expand Down
Loading