Skip to content

Commit

Permalink
feat(cli): use up-to-date dependencies in init templates (aws#23124)
Browse files Browse the repository at this point in the history
Upgrades dependencies for all init templates.
Also changes the upgrade workflow to be less restrictive in which dependencies should be updated for the init-templates.

----

### 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

* [x] 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*
  • Loading branch information
mrgrain authored and Brennan Ho committed Dec 9, 2022
1 parent ecc4b53 commit f38a5af
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/yarn-upgrade.yml
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"aws-cdk": "%cdk-version%",
"jest": "^27.5.1"
"jest": "^29.3.1"
},
"dependencies": {
"aws-cdk-lib": "%cdk-version%",
Expand Down
12 changes: 5 additions & 7 deletions packages/aws-cdk/lib/init-templates/app/typescript/package.json
Expand Up @@ -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%",
Expand Down
12 changes: 5 additions & 7 deletions packages/aws-cdk/lib/init-templates/lib/typescript/package.json
Expand Up @@ -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%",
Expand Down
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"aws-cdk": "%cdk-version%",
"jest": "^27.5.1"
"jest": "^29.3.1"
},
"dependencies": {
"aws-cdk-lib": "%cdk-version%",
Expand Down
Expand Up @@ -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%",
Expand Down

0 comments on commit f38a5af

Please sign in to comment.