From 247d0f3f0a0f208391d4ed1480f9269c6941ae6b Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Mon, 28 Nov 2022 22:51:35 +0000 Subject: [PATCH] fix(cli): typescript init templates fails with error in build step (#23125) Fixes the compile error when running `cdk init app --language typescript && npm run build`. Fixes: #23126 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .github/workflows/yarn-upgrade.yml | 2 +- packages/aws-cdk/lib/init-templates/app/typescript/package.json | 1 + packages/aws-cdk/lib/init-templates/lib/typescript/package.json | 1 + .../lib/init-templates/sample-app/typescript/package.json | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index f677c9369d128..df9615a68c650 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -65,7 +65,7 @@ jobs: lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/prettier,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}' --target=minor # Upgrade package.jsons in init templates for pj in $(find packages/aws-cdk/lib/init-templates -name package.json); do - (cd $(dirname $pj) && ncu --upgrade --reject='@types/jest,@types/node,@types/prettier,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,ts-jest,jest,${{ steps.list-packages.outputs.list }}') + (cd $(dirname $pj) && ncu --upgrade --reject='@types/babel__traverse,@types/jest,@types/node,@types/prettier,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,ts-jest,jest,${{ steps.list-packages.outputs.list }}') done # Upgrade dependencies at an aws-eks integ test docker image cd packages/@aws-cdk/aws-eks/test/sdk-call-integ-test-docker-app/app/ && ncu --upgrade --reject='@types/jest,@types/node,@types/prettier,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,ts-jest,jest,${{ steps.list-packages.outputs.list }}' diff --git a/packages/aws-cdk/lib/init-templates/app/typescript/package.json b/packages/aws-cdk/lib/init-templates/app/typescript/package.json index 8c26e44800521..5e8c69ae41a4d 100644 --- a/packages/aws-cdk/lib/init-templates/app/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/app/typescript/package.json @@ -11,6 +11,7 @@ "cdk": "cdk" }, "devDependencies": { + "@types/babel__traverse": "7.18.2", "@types/jest": "^27.5.2", "@types/node": "10.17.27", "@types/prettier": "2.6.0", diff --git a/packages/aws-cdk/lib/init-templates/lib/typescript/package.json b/packages/aws-cdk/lib/init-templates/lib/typescript/package.json index ff17adb798745..d1f389889adf0 100644 --- a/packages/aws-cdk/lib/init-templates/lib/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/lib/typescript/package.json @@ -9,6 +9,7 @@ "test": "jest" }, "devDependencies": { + "@types/babel__traverse": "7.18.2", "@types/jest": "^27.5.2", "@types/node": "10.17.27", "@types/prettier": "2.6.0", diff --git a/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json b/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json index 3a57b69dac065..ab4ef616cc1a8 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/sample-app/typescript/package.json @@ -12,6 +12,7 @@ }, "devDependencies": { "aws-cdk": "%cdk-version%", + "@types/babel__traverse": "7.18.2", "@types/jest": "^27.5.2", "@types/node": "10.17.27", "@types/prettier": "2.6.0",