From b3ddbb5044e0ccc23842ba3b1ae16cbd891b5482 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Mon, 28 Nov 2022 19:24:48 +0000 Subject: [PATCH] feat(cli): use up-to-date dependencies in init templates --- .github/workflows/yarn-upgrade.yml | 8 ++++---- .../lib/init-templates/app/javascript/package.json | 2 +- .../lib/init-templates/app/typescript/package.json | 12 +++++------- .../lib/init-templates/lib/typescript/package.json | 12 +++++------- .../sample-app/javascript/package.json | 2 +- .../sample-app/typescript/package.json | 12 +++++------- 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/.github/workflows/yarn-upgrade.yml b/.github/workflows/yarn-upgrade.yml index df9615a68c650..c662783a4108d 100644 --- a/.github/workflows/yarn-upgrade.yml +++ b/.github/workflows/yarn-upgrade.yml @@ -24,7 +24,7 @@ jobs: - name: Locate Yarn cache id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Restore Yarn cache uses: actions/cache@v3 @@ -45,7 +45,7 @@ jobs: # These need to be ignored from the `ncu` runs! run: |- echo -n "::set-output name=list::" - node -p "$(lerna ls --all --json 2>/dev/null).map(item => item.name).join(',')" + echo "list=$(lerna ls --all --json 2>/dev/null | jq -r 'map(.name) | join(",")')" >> $GITHUB_OUTPUT - name: Run "ncu -u" # We special-case @types/node because we want to stay on the current major (minimum supported node release) # We special-case @types/fs-extra because the current major (9.x) is broken with @types/node >= 10 @@ -65,10 +65,10 @@ 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/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 }}') + (cd $(dirname $pj) && ncu --upgrade --reject='constructs,${{ 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 }}' + cd packages/@aws-cdk/aws-eks/test/sdk-call-integ-test-docker-app/app/ && ncu --upgrade --reject='aws-sdk,${{ steps.list-packages.outputs.list }}' # This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run) - name: Run "yarn install" diff --git a/packages/aws-cdk/lib/init-templates/app/javascript/package.json b/packages/aws-cdk/lib/init-templates/app/javascript/package.json index 065a5f226d93a..976b94ae09bf4 100644 --- a/packages/aws-cdk/lib/init-templates/app/javascript/package.json +++ b/packages/aws-cdk/lib/init-templates/app/javascript/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "aws-cdk": "%cdk-version%", - "jest": "^27.5.1" + "jest": "^29.3.1" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", 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 5e8c69ae41a4d..82979c1479e80 100644 --- a/packages/aws-cdk/lib/init-templates/app/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/app/typescript/package.json @@ -11,15 +11,13 @@ "cdk": "cdk" }, "devDependencies": { - "@types/babel__traverse": "7.18.2", - "@types/jest": "^27.5.2", - "@types/node": "10.17.27", - "@types/prettier": "2.6.0", - "jest": "^27.5.1", - "ts-jest": "^27.1.4", + "@types/jest": "^29.2.3", + "@types/node": "18.11.9", + "jest": "^29.3.1", + "ts-jest": "^29.0.3", "aws-cdk": "%cdk-version%", "ts-node": "^10.9.1", - "typescript": "~3.9.7" + "typescript": "~4.9.3" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", 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 d1f389889adf0..3905d72692f24 100644 --- a/packages/aws-cdk/lib/init-templates/lib/typescript/package.json +++ b/packages/aws-cdk/lib/init-templates/lib/typescript/package.json @@ -9,15 +9,13 @@ "test": "jest" }, "devDependencies": { - "@types/babel__traverse": "7.18.2", - "@types/jest": "^27.5.2", - "@types/node": "10.17.27", - "@types/prettier": "2.6.0", + "@types/jest": "^29.2.3", + "@types/node": "18.11.9", "aws-cdk-lib": "%cdk-version%", "constructs": "%constructs-version%", - "jest": "^27.5.1", - "ts-jest": "^27.1.4", - "typescript": "~3.9.7" + "jest": "^29.3.1", + "ts-jest": "^29.0.3", + "typescript": "~4.9.3" }, "peerDependencies": { "aws-cdk-lib": "%cdk-version%", diff --git a/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json b/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json index 065a5f226d93a..976b94ae09bf4 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json +++ b/packages/aws-cdk/lib/init-templates/sample-app/javascript/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "aws-cdk": "%cdk-version%", - "jest": "^27.5.1" + "jest": "^29.3.1" }, "dependencies": { "aws-cdk-lib": "%cdk-version%", 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 ab4ef616cc1a8..ce8fe7eec4a9f 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 @@ -11,15 +11,13 @@ "cdk": "cdk" }, "devDependencies": { + "@types/jest": "^29.2.3", + "@types/node": "18.11.9", + "jest": "^29.3.1", + "ts-jest": "^29.0.3", "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", - "jest": "^27.5.1", - "ts-jest": "^27.1.4", "ts-node": "^10.9.1", - "typescript": "~3.9.7" + "typescript": "~4.9.3" }, "dependencies": { "aws-cdk-lib": "%cdk-version%",