Skip to content

Commit

Permalink
chore: pin and update dependencies (#24129)
Browse files Browse the repository at this point in the history
Due to DefinitelyTyped/DefinitelyTyped#64266, `@types/node` can't receive any minor updates or it will break us. So, we need to remove it from the minor upgrades allowed by the scripts. 

Fixing that set of dependencies required updates to some instances of `@types/jest` and `@types/fs-extra`. 

The rest of the dependency updates are as a result of running the script to make sure it behaved as expected.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
TheRealAmazonKendra committed Feb 13, 2023
1 parent 5272908 commit fd5d2f5
Show file tree
Hide file tree
Showing 52 changed files with 340 additions and 427 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/yarn-upgrade-v1main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,19 @@ jobs:
echo -n "::set-output name=list::"
node -p "$(lerna ls --all --json 2>/dev/null).map(item => item.name).join(',')"
- 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
# We special-case some @types because they need to be pinned to specific versions due to breaking changes in minor upgrades https://github.com/DefinitelyTyped/DefinitelyTyped/issues/64266
# We special-case aws-sdk because of breaking changes with TS interface exports in recent minor versions - https://github.com/aws/aws-sdk-js/issues/3453
# We special-case typescript because it's not semantically versionned
# We special-case typescript because it's not semantically versioned
# We special-case constructs because we want to stay in control of the minimum compatible version
# We special-case lerna because we have a patch on it that stops applying if Lerna upgrades. Remove this once https://github.com/lerna/lerna/pull/2874 releases.
# We special-case aws-sdk-mock because of breaking changes in type exports https://github.com/dwyl/aws-sdk-mock/pull/260. We are not respecting `@ts-ignore`
run: |-
# Upgrade dependencies at repository root
ncu --upgrade --filter=@types/node,@types/fs-extra --target=minor
ncu --upgrade --filter=typescript --target=patch
ncu --upgrade --reject=@types/node,@types/prettier,@types/fs-extra,constructs,typescript,lerna --target=minor
ncu --upgrade --reject=@types/node,@types/prettier,constructs,typescript,lerna --target=minor
# Upgrade all the packages
lerna exec --parallel ncu -- --upgrade --filter=@types/node,@types/fs-extra --target=minor
lerna exec --parallel ncu -- --upgrade --filter=typescript --target=patch
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
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/prettier,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}' --target=minor
# 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
13 changes: 5 additions & 8 deletions .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,21 @@ jobs:
# These need to be ignored from the `ncu` runs!
run: |-
echo -n "::set-output name=list::"
echo "list=$(lerna ls --all --json 2>/dev/null | jq -r 'map(.name) | join(",")')" >> $GITHUB_OUTPUT
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
# We special-case some @types because they need to be pinned to specific versions due to breaking changes in minor upgrades https://github.com/DefinitelyTyped/DefinitelyTyped/issues/64266
# We special-case aws-sdk because of breaking changes with TS interface exports in recent minor versions - https://github.com/aws/aws-sdk-js/issues/3453
# We special-case typescript because it's not semantically versionned
# We special-case typescript because it's not semantically versioned
# We special-case constructs because we want to stay in control of the minimum compatible version
# We special-case lerna because we have a patch on it that stops applying if Lerna upgrades. Remove this once https://github.com/lerna/lerna/pull/2874 releases.
# We special-case aws-sdk-mock because of breaking changes in type exports https://github.com/dwyl/aws-sdk-mock/pull/260. We are not respecting `@ts-ignore`
run: |-
# Upgrade dependencies at repository root
ncu --upgrade --filter=@types/node,@types/fs-extra --target=minor
ncu --upgrade --filter=typescript --target=patch
ncu --upgrade --reject=@types/node,@types/prettier,@types/fs-extra,constructs,typescript,lerna --target=minor
ncu --upgrade --reject=@types/node,@types/prettier,constructs,typescript,lerna --target=minor
# Upgrade all the packages
lerna exec --parallel ncu -- --upgrade --filter=@types/node,@types/fs-extra --target=minor
lerna exec --parallel ncu -- --upgrade --filter=typescript --target=patch
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
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/prettier,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='constructs,${{ steps.list-packages.outputs.list }}')
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"postinstall": "patch-package --error-on-fail"
},
"devDependencies": {
"@types/node": "18.11.18",
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.140",
"cdk-generate-synthetic-examples": "^0.1.151",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const MINIMUM_VERSION = '3.9';
* Use NPM preinstalled on the machine to look up a list of TypeScript versions
*/
export function typescriptVersionsSync(): string[] {
const { stdout } = spawnSync('npm', ['--silent', 'view', `typescript@>=${MINIMUM_VERSION}`, 'version', '--json']);
const { stdout } = spawnSync('npm', ['--silent', 'view', `typescript@>=${MINIMUM_VERSION}`, 'version', '--json'], { encoding: 'utf-8' });

const versions: string[] = JSON.parse(stdout);
return Array.from(new Set(versions.map(v => v.split('.').slice(0, 2).join('.'))));
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk-testing/cli-integ/lib/staging/npm.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable no-console */
import * as path from 'path';
import { updateIniKey, loadLines, writeLines } from '../files';
import { shell } from '../shell';
import { LoginInformation } from './codeartifact';
import { parallelShell } from './parallel-shell';
import { UsageDir } from './usage-dir';
import { updateIniKey, loadLines, writeLines } from '../files';
import { shell } from '../shell';

export async function npmLogin(login: LoginInformation, usageDir: UsageDir) {
// Creating an ~/.npmrc that references an envvar is what you're supposed to do. (https://docs.npmjs.com/private-modules/ci-server-config)
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk-testing/cli-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/node": "^14.18.36",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@types/semver": "^7.3.13",
"@types/yargs": "^15.0.15",
Expand All @@ -41,7 +40,7 @@
"dependencies": {
"@octokit/rest": "^18.12.0",
"jest": "^27.5.1",
"aws-sdk": "^2.1211.0",
"aws-sdk": "^2.1313.0",
"axios": "^0.27.2",
"jest-junit": "^14.0.1",
"semver": "^7.3.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"aws-cdk-lib": "0.0.0",
"aws-cdk-migration": "0.0.0",
"constructs": "^10.0.0",
"jest": "^27.3.1",
"jest": "^27.5.1",
"ts-jest": "^27.1.5"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-amplifyuibuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^26.0.24"
"@types/jest": "^27.5.2",
"@types/node": "18.11.18"
},
"dependencies": {
"@aws-cdk/core": "0.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-eks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.85",
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.96",
"aws-cdk-lib": "2.47.0",
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
Expand All @@ -93,8 +93,8 @@
"@types/sinon": "^9.0.11",
"@types/yaml": "1.9.6",
"aws-sdk": "^2.1211.0",
"cdk8s": "^2.6.36",
"cdk8s-plus-24": "2.4.8",
"cdk8s": "^2.6.47",
"cdk8s-plus-24": "2.4.19",
"jest": "^27.5.1",
"sinon": "^9.2.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "eks-service-account-sdk-call-integ-test",
"private": "true",
"dependencies": {
"aws-sdk": "^2.1226.0"
"aws-sdk": "^2.1313.0"
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-evidently/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^26.0.24"
"@types/jest": "^27.5.2"
},
"dependencies": {
"@aws-cdk/core": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@aws-cdk/triggers": "0.0.0",
"@types/jest": "^27.5.2",
"delay": "5.0.0",
"esbuild": "^0.17.5"
"esbuild": "^0.17.7"
},
"dependencies": {
"@aws-cdk/aws-lambda": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^26.0.24"
"@types/jest": "^27.5.2"
},
"dependencies": {
"@aws-cdk/core": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-refactorspaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^26.0.24"
"@types/jest": "^27.5.2"
},
"dependencies": {
"@aws-cdk/core": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-resiliencehub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^26.0.24"
"@types/jest": "^27.5.2"
},
"dependencies": {
"@aws-cdk/core": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-rum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^26.0.24"
"@types/jest": "^27.5.2"
},
"dependencies": {
"@aws-cdk/core": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cfnspec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"devDependencies": {
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/fs-extra": "^8.1.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.5.2",
"@types/md5": "^2.3.2",
"fast-json-patch": "^3.1.1",
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/cli-lib/THIRD_PARTY_LICENSES
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The @aws-cdk/cli-lib package includes the following third-party software/licensing:

** @jsii/check-node@1.72.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.72.0 | Apache-2.0
** @jsii/check-node@1.74.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.74.0 | Apache-2.0
jsii
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Expand Down Expand Up @@ -37,7 +37,7 @@ THE SOFTWARE.

----------------

** acorn@8.8.1 - https://www.npmjs.com/package/acorn/v/8.8.1 | MIT
** acorn@8.8.2 - https://www.npmjs.com/package/acorn/v/8.8.2 | MIT
MIT License

Copyright (C) 2012-2022 by various contributors (see AUTHORS)
Expand Down Expand Up @@ -268,7 +268,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE

----------------

** aws-sdk@2.1287.0 - https://www.npmjs.com/package/aws-sdk/v/2.1287.0 | Apache-2.0
** aws-sdk@2.1313.0 - https://www.npmjs.com/package/aws-sdk/v/2.1313.0 | Apache-2.0
AWS SDK for JavaScript
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Expand Down Expand Up @@ -2208,10 +2208,10 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

----------------

** minimatch@5.1.2 - https://www.npmjs.com/package/minimatch/v/5.1.2 | ISC
** minimatch@5.1.6 - https://www.npmjs.com/package/minimatch/v/5.1.6 | ISC
The ISC License

Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -3482,7 +3482,7 @@ SOFTWARE.

----------------

** tslib@2.4.1 - https://www.npmjs.com/package/tslib/v/2.4.1 | 0BSD
** tslib@2.5.0 - https://www.npmjs.com/package/tslib/v/2.5.0 | 0BSD
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
Expand Down Expand Up @@ -3612,7 +3612,7 @@ OTHER DEALINGS IN THE SOFTWARE.

----------------

** vm2@3.9.13 - https://www.npmjs.com/package/vm2/v/3.9.13 | MIT
** vm2@3.9.14 - https://www.npmjs.com/package/vm2/v/3.9.14 | MIT

----------------

Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/cli-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"@aws-cdk/node-bundle": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/node": "^14.18.36",
"aws-cdk": "0.0.0",
"constructs": "^10.0.0",
"jest": "^27.5.1",
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/cloudformation-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"license": "Apache-2.0",
"dependencies": {
"@aws-cdk/cfnspec": "0.0.0",
"@types/node": "^14.18.36",
"chalk": "^4",
"diff": "^5.1.0",
"fast-deep-equal": "^3.1.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,11 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.110",
"@types/fs-extra": "^8.1.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.191",
"@types/minimatch": "^3.0.5",
"aws-sdk": "^2.928.0",
"@types/node": "^14.18.36",
"@types/sinon": "^9.0.11",
"fast-check": "^2.25.0",
"jest": "^27.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/custom-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.110",
"@types/fs-extra": "^8.1.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.5.2",
"@types/sinon": "^9.0.11",
"aws-sdk": "^2.1211.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE

----------------

** aws-sdk@2.1306.0 - https://www.npmjs.com/package/aws-sdk/v/2.1306.0 | Apache-2.0
** aws-sdk@2.1313.0 - https://www.npmjs.com/package/aws-sdk/v/2.1313.0 | Apache-2.0
AWS SDK for JavaScript
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/integ-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
"@aws-cdk/core": "0.0.0",
"@aws-cdk/integ-tests": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/fs-extra": "^8.1.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.5.2",
"@types/mock-fs": "^4.13.1",
"@types/node": "^14.18.36",
"@types/workerpool": "^6.1.1",
"@types/yargs": "^15.0.15",
"constructs": "^10.0.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/integ-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/fs-extra": "^8.1.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.5.2",
"@types/node": "^14.18.36",
"aws-sdk": "^2.1211.0",
"aws-sdk-mock": "5.6.0",
"jest": "^27.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/lambda-layer-awscli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"dependencies": {
"@aws-cdk/aws-lambda": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/asset-awscli-v1": "^2.2.52",
"@aws-cdk/asset-awscli-v1": "^2.2.65",
"constructs": "^10.0.0"
},
"homepage": "https://github.com/aws/aws-cdk",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"dependencies": {
"@aws-cdk/aws-lambda": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/asset-node-proxy-agent-v5": "^2.0.42",
"@aws-cdk/asset-node-proxy-agent-v5": "^2.0.54",
"constructs": "^10.0.0"
},
"homepage": "https://github.com/aws/aws-cdk",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/region-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"devDependencies": {
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/fs-extra": "^8.1.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.5.2",
"fs-extra": "^9.1.0"
},
Expand Down

0 comments on commit fd5d2f5

Please sign in to comment.