Skip to content

Commit 3e048c1

Browse files
authored
chore: use locked version of cdk-generate-synthetic-examples (#36242)
### Reason for this change The repository was using `npx cdk-generate-synthetic-examples@latest` which could lead to unexpected builds due to the latest version being used. This change locks the version to ensure reproducible builds. It also allows us to release changes to `cdk-generate-synthetic-examples` without having to worry much about the implications on this repo. ### Description of changes - Updated `cdk-generate-synthetic-examples` from `^0.2.32` to `^0.2.36` in package.json - Added npm scripts `rosetta` and `synthetic-examples` to use locked versions via yarn - Updated `scripts/run-rosetta.sh` to use `yarn run` instead of `npx` for both tools - Removed init template upgrades from yarn-upgrade workflow (unrelated cleanup) - Minor formatting fixes in yarn-upgrade workflow This ensures all developers and CI use the same version of the synthetic examples generator, preventing potential inconsistencies. ### Describe any new or updated permissions being added No new permissions are added. ### Description of how you validated changes - Verified the scripts use the locked versions from package.json - Confirmed yarn.lock contains the updated dependencies ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5a8be4f commit 3e048c1

File tree

4 files changed

+42
-43
lines changed

4 files changed

+42
-43
lines changed

.github/workflows/yarn-upgrade.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ jobs:
5959
# Upgrade all the packages
6060
lerna exec --parallel ncu -- --upgrade --filter=jsii,jsii-rosetta,typescript --target=patch
6161
lerna exec --parallel ncu -- --upgrade --reject='@aws-cdk/asset-awscli-v1,@types/conventional-commits-parser,@types/node,@types/prettier,constructs,jsii,jsii-rosetta,typescript,aws-sdk-mock,@aws-sdk/*,@aws-cdk/aws-service-spec,@aws-cdk/service-spec-types,${{ steps.list-packages.outputs.list }}' --target=minor
62-
# Upgrade package.json files in init templates
63-
for pj in $(find packages/aws-cdk/lib/init-templates -name package.json); do
64-
(cd $(dirname $pj) && ncu --upgrade --reject='constructs,${{ steps.list-packages.outputs.list }}')
65-
done
6662
# Upgrade dependencies at an aws-eks integ test docker image
6763
cd packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/sdk-call-integ-test-docker-app/app/ && ncu --upgrade --reject='@aws-sdk/*,${{ steps.list-packages.outputs.list }}'
6864
@@ -103,7 +99,8 @@ jobs:
10399
path: ${{ runner.temp }}
104100

105101
- name: Apply patch
106-
run: '[ -s ${{ runner.temp }}/upgrade.patch ] && git apply ${{ runner.temp
102+
run:
103+
'[ -s ${{ runner.temp }}/upgrade.patch ] && git apply ${{ runner.temp
107104
}}/upgrade.patch || echo "Empty patch. Skipping."'
108105

109106
- name: Make Pull Request
@@ -116,7 +113,7 @@ jobs:
116113
chore: npm-check-updates && yarn upgrade
117114
Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date.
118115
# Pull Request details
119-
title: 'chore: npm-check-updates && yarn upgrade'
116+
title: "chore: npm-check-updates && yarn upgrade"
120117
body: |-
121118
Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date.
122119
labels: contribution/core,dependencies,auto-approve

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@
1313
"compat": "./scripts/check-api-compatibility.sh",
1414
"bump": "./bump.sh",
1515
"build-all": "tsc -b",
16-
"atmosphere-integ-test": "lerna run build --scope @aws-cdk/integration-test-deployment && node tools/@aws-cdk/integration-test-deployment/bin/index.js"
16+
"atmosphere-integ-test": "lerna run build --scope @aws-cdk/integration-test-deployment && node tools/@aws-cdk/integration-test-deployment/bin/index.js",
17+
"rosetta": "jsii-rosetta",
18+
"synthetic-examples": "cdk-generate-synthetic-examples"
1719
},
1820
"devDependencies": {
1921
"@nx/workspace": "^20",
2022
"@types/node": "18.19.129",
2123
"@types/prettier": "2.6.0",
2224
"@yarnpkg/lockfile": "^1.1.0",
2325
"aws-sdk-js-codemod": "^2.4.5",
24-
"cdk-generate-synthetic-examples": "^0.2.32",
26+
"cdk-generate-synthetic-examples": "^0.2.36",
2527
"conventional-changelog-cli": "^2.2.2",
2628
"fs-extra": "^9.1.0",
2729
"graceful-fs": "^4.2.11",

scripts/run-rosetta.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
set -eu
2222
scriptdir=$(cd $(dirname $0) && pwd)
2323

24-
ROSETTA=${ROSETTA:-npx jsii-rosetta}
24+
ROSETTA=${ROSETTA:-yarn run rosetta}
2525

2626
infuse=false
2727
jsii_pkgs_file=""
@@ -73,7 +73,7 @@ time $ROSETTA extract \
7373

7474
if $infuse; then
7575
echo "💎 Generating synthetic examples for the remainder" >&2
76-
time npx cdk-generate-synthetic-examples@latest \
76+
time yarn run synthetic-examples \
7777
$(cat $jsii_pkgs_file)
7878

7979
time $ROSETTA extract \

yarn.lock

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3667,14 +3667,6 @@
36673667
chalk "^4.1.2"
36683668
semver "^7.7.2"
36693669

3670-
3671-
version "1.115.0"
3672-
resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.115.0.tgz#ac6c67d27ab484d0625e44592bb201514ed9d7b9"
3673-
integrity sha512-DEcg6DWa7UFgPipR0FqnqWBd9d/zzmTW6fJSUORFhh1USYjYofyCNc76IXxBDdd8gMQYMnvuQ1GTjygLcRjlRA==
3674-
dependencies:
3675-
chalk "^4.1.2"
3676-
semver "^7.7.2"
3677-
36783670
36793671
version "1.118.0"
36803672
resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.118.0.tgz#0be4fef43c7058764e3b4d146c6fbc80306de6bd"
@@ -3691,20 +3683,21 @@
36913683
chalk "^4.1.2"
36923684
semver "^7.7.2"
36933685

3686+
3687+
version "1.120.0"
3688+
resolved "https://registry.npmjs.org/@jsii/check-node/-/check-node-1.120.0.tgz#f451a16ef45cb5033727b42391b3b3231d30cea0"
3689+
integrity sha512-seQxZ+r3PxHCRBwLZz8F9FjjVAyDtXW2tdsHAp1gITPNehfc650vKu0gk5fCtCo85NA+Fv38ysNqimHCfa8A+Q==
3690+
dependencies:
3691+
chalk "^4.1.2"
3692+
semver "^7.7.2"
3693+
36943694
36953695
version "1.114.1"
36963696
resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.114.1.tgz#9c064d57f062d913bcfda25b5496bdf4c9c95c46"
36973697
integrity sha512-SdjVQaNqLkTUK+2R0/t/MnM/NBvv1vzqxO5sn1nnoFD5Wlih8TFOIjl+Q8npzYmOtN+et3D+BMVYrxmVfq4X0w==
36983698
dependencies:
36993699
ajv "^8.17.1"
37003700

3701-
"@jsii/[email protected]", "@jsii/spec@^1.115.0":
3702-
version "1.115.0"
3703-
resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.115.0.tgz#be0818bd31509687cb6445873d1ec65e8d24bd24"
3704-
integrity sha512-qnicuByM0G5L6ZF2yO/e5cHwT6pb5E0aUvgHBycFPHBkgf5yjtvm+Wtk6q61srNuRASYI25BiTOonyABNeRjlw==
3705-
dependencies:
3706-
ajv "^8.17.1"
3707-
37083701
37093702
version "1.118.0"
37103703
resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.118.0.tgz#66d6da3089e002ee3ee89dcc6e9d284a039acf94"
@@ -3719,6 +3712,13 @@
37193712
dependencies:
37203713
ajv "^8.17.1"
37213714

3715+
"@jsii/[email protected]", "@jsii/spec@^1.120.0":
3716+
version "1.120.0"
3717+
resolved "https://registry.npmjs.org/@jsii/spec/-/spec-1.120.0.tgz#fc0fe02e3cd946ca45698c7b9ddb382e31cab89c"
3718+
integrity sha512-BurJOykpQNhqR80h6/RXX5i8rEO574KUP5BfiKApe+RAsEevCdfF7+Ev5ekrUgMfxxfvaQZyNEY640hXPQgq1w==
3719+
dependencies:
3720+
ajv "^8.17.1"
3721+
37223722
37233723
version "8.2.4"
37243724
resolved "https://registry.npmjs.org/@lerna/create/-/create-8.2.4.tgz#59a050f58681e9236db38cc5bcc6986ae79d1389"
@@ -6607,13 +6607,13 @@ [email protected], case@^1.6.3:
66076607
resolved "https://registry.npmjs.org/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9"
66086608
integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==
66096609

6610-
cdk-generate-synthetic-examples@^0.2.32:
6611-
version "0.2.32"
6612-
resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.2.32.tgz#e79900e3b1f6ecc7fdb5141086561eb847fd9184"
6613-
integrity sha512-Uj7s8dHNv2xUM3E9iLMeSaNwWp1oJ3PmW3fZQ3wlyhUoAielOJP2eH3aMsY81FNy7vJa5KxvGZjWHi101stuWQ==
6610+
cdk-generate-synthetic-examples@^0.2.36:
6611+
version "0.2.36"
6612+
resolved "https://registry.npmjs.org/cdk-generate-synthetic-examples/-/cdk-generate-synthetic-examples-0.2.36.tgz#eadf34cd497552fbcc3acc4c356e3f17506c5808"
6613+
integrity sha512-rybNIxro8Z2i6HPy7Zea/STbnnyR5gMQlKeuQ/Bx1ZB6XdPlN11YuL79RXG59Bc/JDMJCxDhQdyQWbkte24+Nw==
66146614
dependencies:
6615-
"@jsii/spec" "^1.115.0"
6616-
jsii-reflect "^1.115.0"
6615+
"@jsii/spec" "^1.120.0"
6616+
jsii-reflect "^1.120.0"
66176617
yargs "^17.7.2"
66186618

66196619
@@ -10325,16 +10325,16 @@ [email protected], jsii-reflect@^1.119.0:
1032510325
oo-ascii-tree "^1.119.0"
1032610326
yargs "^17.7.2"
1032710327

10328-
jsii-reflect@^1.115.0:
10329-
version "1.115.0"
10330-
resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.115.0.tgz#debe523fa2de0ba020d54d41a2f7b0e0bc8ef048"
10331-
integrity sha512-svWvulZ8IH035sLR0aEt3UiN4Ejqh99zSBfVTFsr3bjBfDZqcxIlExFI/fMb7O+a7XwT0WdTakTuX/aajQt3cg==
10328+
jsii-reflect@^1.120.0:
10329+
version "1.120.0"
10330+
resolved "https://registry.npmjs.org/jsii-reflect/-/jsii-reflect-1.120.0.tgz#9e20890f0ffe6315d27fb39c923ed6f34b016331"
10331+
integrity sha512-gmQNRwdsCP+hqW+vijOVbh/TdleFo1+QUqsEXXr+kERWKa0qxWHaLb+saVUkeUSl4sLQbAYDPTSMi5s4M9T2qA==
1033210332
dependencies:
10333-
"@jsii/check-node" "1.115.0"
10334-
"@jsii/spec" "1.115.0"
10333+
"@jsii/check-node" "1.120.0"
10334+
"@jsii/spec" "1.120.0"
1033510335
chalk "^4"
1033610336
fs-extra "^10.1.0"
10337-
oo-ascii-tree "^1.115.0"
10337+
oo-ascii-tree "^1.120.0"
1033810338
yargs "^17.7.2"
1033910339

1034010340
jsii-rosetta@~5.9.14:
@@ -11961,16 +11961,16 @@ onetime@^5.1.0, onetime@^5.1.2:
1196111961
dependencies:
1196211962
mimic-fn "^2.1.0"
1196311963

11964-
oo-ascii-tree@^1.115.0:
11965-
version "1.115.0"
11966-
resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.115.0.tgz#60a28f29cc449cd4274140f5d939c08a18c5ac8b"
11967-
integrity sha512-KbZpipKiCQ5Ws2GryfOUWBxuVpVYosqAi85mtplgMyhQuueOZAO8qeTmNqYYHUxBHOz9O+kKCCjidEkLmCDhLQ==
11968-
1196911964
oo-ascii-tree@^1.119.0:
1197011965
version "1.119.0"
1197111966
resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.119.0.tgz#642c9906bc93e419917bfaf4f8ed1559773d8125"
1197211967
integrity sha512-4Aj3mBl0nM/YsUWEoUGPtO8gQ/tUJqaLyTGV63vag1plJuQuJShWHKEXcS0k8r70EDoOcx3q3Dql0U6YuMW2kw==
1197311968

11969+
oo-ascii-tree@^1.120.0:
11970+
version "1.120.0"
11971+
resolved "https://registry.npmjs.org/oo-ascii-tree/-/oo-ascii-tree-1.120.0.tgz#87d8abd43e84efb5a23827277ef40ed64f1aa2fe"
11972+
integrity sha512-8aZZbPwoizq9fGRcn7MkCmYdZ2G4RSA/k2s8OlF4ijbbGFzxhG2jt4xVw4uRPpt9aLOgU051h/t0LePFBVppsQ==
11973+
1197411974
open@^8.4.0:
1197511975
version "8.4.2"
1197611976
resolved "https://registry.npmjs.org/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9"

0 commit comments

Comments
 (0)